<?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.inspectionPlanItems.mapper.EmInspectionPlanItemsMapper">
|
|
<resultMap type="EmInspectionPlanItems" id="EmInspectionPlanItemsResult">
|
<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="standard" column="standard" />
|
<result property="itemsContent" column="items_content" />
|
<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" />
|
<result property="planCode" column="plan_code" />
|
</resultMap>
|
|
<sql id="selectEmInspectionPlanItemsVo">
|
select id, items_code, items_name, items_type, standard, items_content, create_user, create_time, update_user, update_time, spare_field_1, spare_field_2, plan_code from em_inspection_plan_items
|
</sql>
|
|
<select id="selectEmInspectionPlanItemsList" parameterType="EmInspectionPlanItems" resultMap="EmInspectionPlanItemsResult">
|
<include refid="selectEmInspectionPlanItemsVo"/>
|
<where>
|
<if test="itemsCode != null and itemsCode != ''"> and items_code = #{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="standard != null and standard != ''"> and standard = #{standard}</if>
|
<if test="itemsContent != null and itemsContent != ''"> and items_content = #{itemsContent}</if>
|
<if test="createUser != null and createUser != ''"> and create_user = #{createUser}</if>
|
<if test="updateUser != null and updateUser != ''"> and update_user = #{updateUser}</if>
|
<if test="spareField1 != null and spareField1 != ''"> and spare_field_1 = #{spareField1}</if>
|
<if test="spareField2 != null and spareField2 != ''"> and spare_field_2 = #{spareField2}</if>
|
<if test="planCode != null and planCode != ''"> and plan_code = #{planCode}</if>
|
</where>
|
</select>
|
|
<select id="selectEmInspectionPlanItemsById" parameterType="Long" resultMap="EmInspectionPlanItemsResult">
|
<include refid="selectEmInspectionPlanItemsVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertEmInspectionPlanItems" parameterType="EmInspectionPlanItems" useGeneratedKeys="true" keyProperty="id">
|
insert into em_inspection_plan_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="standard != null">standard,</if>
|
<if test="itemsContent != null">items_content,</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>
|
<if test="planCode != null">plan_code,</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="standard != null">#{standard},</if>
|
<if test="itemsContent != null">#{itemsContent},</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>
|
<if test="planCode != null">#{planCode},</if>
|
</trim>
|
</insert>
|
|
<update id="updateEmInspectionPlanItems" parameterType="EmInspectionPlanItems">
|
update em_inspection_plan_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="standard != null">standard = #{standard},</if>
|
<if test="itemsContent != null">items_content = #{itemsContent},</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>
|
<if test="planCode != null">plan_code = #{planCode},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteEmInspectionPlanItemsById" parameterType="Long">
|
delete from em_inspection_plan_items where id = #{id}
|
</delete>
|
|
<delete id="deleteEmInspectionPlanItemsByIds" parameterType="String">
|
delete from em_inspection_plan_items where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
</mapper>
|