<?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.inspectionPlanTask.mapper.EmInspectionPlanTaskMapper">
|
|
<resultMap type="EmInspectionPlanTask" id="EmInspectionPlanTaskResult">
|
<result property="id" column="id" />
|
<result property="planCode" column="plan_code" />
|
<result property="planName" column="plan_name" />
|
<result property="planType" column="plan_type" />
|
<result property="state" column="state" />
|
<result property="devicesCode" column="devices_code" />
|
<result property="devicesName" column="devices_name" />
|
<result property="brand" column="brand" />
|
<result property="specs" column="specs" />
|
<result property="results" column="results" />
|
<result property="remarks" column="remarks" />
|
<result property="createTime" column="create_time" />
|
<result property="createUser" column="create_user" />
|
<result property="updateTime" column="update_time" />
|
<result property="updateUser" column="update_user" />
|
</resultMap>
|
|
<sql id="selectEmInspectionPlanTaskVo">
|
select id, plan_code, plan_name, plan_type, state, devices_code, devices_name, brand, specs, results, remarks, create_time, create_user, update_time, update_user from em_inspection_plan_task
|
</sql>
|
|
<select id="selectEmInspectionPlanTaskList" parameterType="EmInspectionPlanTask" resultMap="EmInspectionPlanTaskResult">
|
<include refid="selectEmInspectionPlanTaskVo"/>
|
<where>
|
<if test="planCode != null and planCode != ''"> and plan_code = #{planCode}</if>
|
<if test="planName != null and planName != ''"> and plan_name like concat('%', #{planName}, '%')</if>
|
<if test="planType != null and planType != ''"> and plan_type = #{planType}</if>
|
<if test="state != null and state != ''"> and state = #{state}</if>
|
<if test="devicesCode != null and devicesCode != ''"> and devices_code = #{devicesCode}</if>
|
<if test="devicesName != null and devicesName != ''"> and devices_name like concat('%', #{devicesName}, '%')</if>
|
</where>
|
</select>
|
|
<select id="selectEmInspectionPlanTaskById" parameterType="Long" resultMap="EmInspectionPlanTaskResult">
|
<include refid="selectEmInspectionPlanTaskVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertEmInspectionPlanTask" parameterType="EmInspectionPlanTask" useGeneratedKeys="true" keyProperty="id">
|
insert into em_inspection_plan_task
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="planCode != null">plan_code,</if>
|
<if test="planName != null">plan_name,</if>
|
<if test="planType != null">plan_type,</if>
|
<if test="state != null">state,</if>
|
<if test="devicesCode != null">devices_code,</if>
|
<if test="devicesName != null">devices_name,</if>
|
<if test="brand != null">brand,</if>
|
<if test="specs != null">specs,</if>
|
<if test="results != null">results,</if>
|
<if test="remarks != null">remarks,</if>
|
<if test="createTime != null">create_time,</if>
|
<if test="createUser != null">create_user,</if>
|
<if test="updateTime != null">update_time,</if>
|
<if test="updateUser != null">update_user,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="planCode != null">#{planCode},</if>
|
<if test="planName != null">#{planName},</if>
|
<if test="planType != null">#{planType},</if>
|
<if test="state != null">#{state},</if>
|
<if test="devicesCode != null">#{devicesCode},</if>
|
<if test="devicesName != null">#{devicesName},</if>
|
<if test="brand != null">#{brand},</if>
|
<if test="specs != null">#{specs},</if>
|
<if test="results != null">#{results},</if>
|
<if test="remarks != null">#{remarks},</if>
|
<if test="createTime != null">#{createTime},</if>
|
<if test="createUser != null">#{createUser},</if>
|
<if test="updateTime != null">#{updateTime},</if>
|
<if test="updateUser != null">#{updateUser},</if>
|
</trim>
|
</insert>
|
|
<update id="updateEmInspectionPlanTask" parameterType="EmInspectionPlanTask">
|
update em_inspection_plan_task
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="planCode != null">plan_code = #{planCode},</if>
|
<if test="planName != null">plan_name = #{planName},</if>
|
<if test="planType != null">plan_type = #{planType},</if>
|
<if test="state != null">state = #{state},</if>
|
<if test="devicesCode != null">devices_code = #{devicesCode},</if>
|
<if test="devicesName != null">devices_name = #{devicesName},</if>
|
<if test="brand != null">brand = #{brand},</if>
|
<if test="specs != null">specs = #{specs},</if>
|
<if test="results != null">results = #{results},</if>
|
<if test="remarks != null">remarks = #{remarks},</if>
|
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="createUser != null">create_user = #{createUser},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
<if test="updateUser != null">update_user = #{updateUser},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteEmInspectionPlanTaskById" parameterType="Long">
|
delete from em_inspection_plan_task where id = #{id}
|
</delete>
|
|
<delete id="deleteEmInspectionPlanTaskByIds" parameterType="String">
|
delete from em_inspection_plan_task where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
</mapper>
|