小程序后台代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

63 lines
2.9 KiB

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zdxt.flow.mapper.IModelContentMapper">
<resultMap type="TwkfModelContentEntity" id="ModelContentResult">
<result property="modelId" column="model_id"/>
<result property="modelChart" column="model_chart"/>
<result property="modelBody" column="model_body"/>
</resultMap>
<sql id="selectTwkfContentModelVo">
select model_id, model_chart, model_body from twkf_model_content
</sql>
<select id="selectModelContentList" parameterType="TwkfModelContentEntity" resultMap="ModelContentResult">
<include refid="selectTwkfContentModelVo"/>
<where>
<if test="modelId != null and modelId != ''"> and model_id = #{modelId}</if>
<if test="modelChart != null and modelChart != ''"> and model_chart = #{modelChart}</if>
<if test="modelBody != null and modelBody != ''"> and model_body = #{modelBody}</if>
</where>
</select>
<select id="selectModelContentById" parameterType="String" resultMap="ModelContentResult">
<include refid="selectTwkfContentModelVo"/>
where model_id = #{modelId}
</select>
<insert id="insertModelContent" parameterType="TwkfModelContentEntity">
insert into twkf_model_content
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="modelId != null and modelId != ''">model_id,</if>
<if test="modelChart != null and modelChart != ''">model_chart,</if>
<if test="modelBody != null and modelBody != ''">model_body,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="modelId != null and modelId != ''">#{modelId},</if>
<if test="modelChart != null and modelChart != ''">#{modelChart},</if>
<if test="modelBody != null and modelBody != ''">#{modelBody},</if>
</trim>
</insert>
<update id="updateModelContent" parameterType="TwkfModelContentEntity">
update twkf_model_content
<trim prefix="SET" suffixOverrides=",">
<if test="modelChart != null and modelChart != ''">model_chart = #{modelChart},</if>
<if test="modelBody != null and modelBody != ''">model_body = #{modelBody},</if>
</trim>
where model_id = #{modelId}
</update>
<delete id="deleteModelContentById" parameterType="String">
delete from twkf_model_content where model_id = #{modelId}
</delete>
<delete id="deleteModelContentByIds" parameterType="String">
delete from twkf_model_content where model_id in
<foreach item="modelId" collection="array" open="(" separator="," close=")">
#{modelId}
</foreach>
</delete>
</mapper>