<?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.jcdm.main.em.inspectionItems.mapper.EmInspectionItemsMapper">
|
|
<resultMap type="EmInspectionItems" id="EmInspectionItemsResult">
|
<result property="id" column="id" />
|
<result property="itemsCode" column="items_code" />
|
<result property="itemsName" column="items_name" />
|
<result property="itemsType" column="items_type" />
|
<result property="status" column="status" />
|
<result property="standard" column="standard" />
|
<result property="itemsContent" column="items_content" />
|
<result property="remark" column="remark" />
|
<result property="createUser" column="create_user" />
|
<result property="createTime" column="create_time" />
|
<result property="updateUser" column="update_user" />
|
<result property="updateTime" column="update_time" />
|
<result property="spareField1" column="spare_field_1" />
|
<result property="spareField2" column="spare_field_2" />
|
</resultMap>
|
|
<sql id="selectEmInspectionItemsVo">
|
select id, items_code, items_name, items_type, status, standard, items_content, remark, create_user, create_time, update_user, update_time, spare_field_1, spare_field_2 from em_inspection_items
|
</sql>
|
|
<select id="selectEmInspectionItemsList" parameterType="EmInspectionItems" resultMap="EmInspectionItemsResult">
|
<include refid="selectEmInspectionItemsVo"/>
|
<where>
|
<if test="itemsCode != null and itemsCode != ''"> and items_code like concat('%', #{itemsCode}, '%')</if>
|
<if test="itemsName != null and itemsName != ''"> and items_name like concat('%', #{itemsName}, '%')</if>
|
<if test="itemsType != null and itemsType != ''"> and items_type = #{itemsType}</if>
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
</where>
|
</select>
|
|
<select id="selectEmInspectionItemsById" parameterType="Long" resultMap="EmInspectionItemsResult">
|
<include refid="selectEmInspectionItemsVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertEmInspectionItems" parameterType="EmInspectionItems" useGeneratedKeys="true" keyProperty="id">
|
insert into em_inspection_items
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="itemsCode != null">items_code,</if>
|
<if test="itemsName != null">items_name,</if>
|
<if test="itemsType != null">items_type,</if>
|
<if test="status != null">status,</if>
|
<if test="standard != null">standard,</if>
|
<if test="itemsContent != null">items_content,</if>
|
<if test="remark != null">remark,</if>
|
<if test="createUser != null">create_user,</if>
|
<if test="createTime != null">create_time,</if>
|
<if test="updateUser != null">update_user,</if>
|
<if test="updateTime != null">update_time,</if>
|
<if test="spareField1 != null">spare_field_1,</if>
|
<if test="spareField2 != null">spare_field_2,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="itemsCode != null">#{itemsCode},</if>
|
<if test="itemsName != null">#{itemsName},</if>
|
<if test="itemsType != null">#{itemsType},</if>
|
<if test="status != null">#{status},</if>
|
<if test="standard != null">#{standard},</if>
|
<if test="itemsContent != null">#{itemsContent},</if>
|
<if test="remark != null">#{remark},</if>
|
<if test="createUser != null">#{createUser},</if>
|
<if test="createTime != null">#{createTime},</if>
|
<if test="updateUser != null">#{updateUser},</if>
|
<if test="updateTime != null">#{updateTime},</if>
|
<if test="spareField1 != null">#{spareField1},</if>
|
<if test="spareField2 != null">#{spareField2},</if>
|
</trim>
|
</insert>
|
|
<update id="updateEmInspectionItems" parameterType="EmInspectionItems">
|
update em_inspection_items
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="itemsCode != null">items_code = #{itemsCode},</if>
|
<if test="itemsName != null">items_name = #{itemsName},</if>
|
<if test="itemsType != null">items_type = #{itemsType},</if>
|
<if test="status != null">status = #{status},</if>
|
<if test="standard != null">standard = #{standard},</if>
|
<if test="itemsContent != null">items_content = #{itemsContent},</if>
|
<if test="remark != null">remark = #{remark},</if>
|
<if test="createUser != null">create_user = #{createUser},</if>
|
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="updateUser != null">update_user = #{updateUser},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
<if test="spareField1 != null">spare_field_1 = #{spareField1},</if>
|
<if test="spareField2 != null">spare_field_2 = #{spareField2},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteEmInspectionItemsById" parameterType="Long">
|
delete from em_inspection_items where id = #{id}
|
</delete>
|
|
<delete id="deleteEmInspectionItemsByIds" parameterType="String">
|
delete from em_inspection_items where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
</mapper>
|