123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- <?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.ruoyi.project.task.mapper.TTaskInspectionPlanMapper">
- <resultMap type="TTaskInspectionPlan" id="TTaskInspectionPlanResult">
- <result property="id" column="id" />
- <result property="plantId" column="plant_id" />
- <result property="plantName" column="plant_name" />
- <result property="inspectionPlanNo" column="inspection_plan_no" />
- <result property="inspectionPlanName" column="inspection_plan_name" />
- <result property="detectionFrequency" column="detection_frequency" />
- <result property="startTime" column="start_time" />
- <result property="endTime" column="end_time" />
- <result property="pointNum" column="point_num" />
- <result property="remarks" column="remarks" />
- <result property="deptId" column="dept_id" />
- <result property="delFlag" column="del_flag" />
- <result property="createrCode" column="creater_code" />
- <result property="createdate" column="createdate" />
- <result property="updaterCode" column="updater_code" />
- <result property="updatedate" column="updatedate" />
- <result property="creater" column="creater" />
- </resultMap>
- <sql id="selectTTaskInspectionPlanVo">
- select id, plant_id, inspection_plan_no, inspection_plan_name, detection_frequency, start_time, end_time, point_num, remarks, dept_id, del_flag, creater_code, createdate, updater_code, updatedate from t_task_inspection_plan
- </sql>
- <select id="selectTTaskInspectionPlanList" parameterType="TTaskInspectionPlan" resultMap="TTaskInspectionPlanResult">
- select d.*,bp.plant_name,su.user_name creater from t_task_inspection_plan d
- left join t_base_plant bp on bp.id=d.plant_id
- left join sys_user su on su.user_id=d.creater_code
- <where>
- <if test="plantId != null "> and d.plant_id = #{plantId}</if>
- <if test="inspectionPlanNo != null and inspectionPlanNo != ''"> and d.inspection_plan_no = #{inspectionPlanNo}</if>
- <if test="inspectionPlanName != null and inspectionPlanName != ''"> and d.inspection_plan_name like concat('%', #{inspectionPlanName}, '%')</if>
- <if test="detectionFrequency != null and detectionFrequency != ''"> and d.detection_frequency = #{detectionFrequency}</if>
- <if test="startTime != null "> and d.start_time = #{startTime}</if>
- <if test="endTime != null "> and d.end_time = #{endTime}</if>
- <if test="pointNum != null and pointNum != ''"> and d.point_num = #{pointNum}</if>
- <if test="remarks != null and remarks != ''"> and d.remarks = #{remarks}</if>
- <if test="deptId != null "> and d.dept_id = #{deptId}</if>
- <if test="createrCode != null "> and d.creater_code = #{createrCode}</if>
- <if test="createdate != null "> and d.createdate = #{createdate}</if>
- <if test="updaterCode != null "> and d.updater_code = #{updaterCode}</if>
- <if test="updatedate != null "> and d.updatedate = #{updatedate}</if>
- and d.del_flag = 0
- </where>
- </select>
- <select id="selectAllPlan" resultMap="TTaskInspectionPlanResult">
- <include refid="selectTTaskInspectionPlanVo"/>
- </select>
- <select id="selectTTaskInspectionPlanById" parameterType="Long" resultMap="TTaskInspectionPlanResult">
- <include refid="selectTTaskInspectionPlanVo"/>
- where id = #{id}
- </select>
- <insert id="insertTTaskInspectionPlan" parameterType="TTaskInspectionPlan" useGeneratedKeys="true" keyProperty="id">
- insert into t_task_inspection_plan
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="plantId != null">plant_id,</if>
- <if test="inspectionPlanNo != null">inspection_plan_no,</if>
- <if test="inspectionPlanName != null">inspection_plan_name,</if>
- <if test="detectionFrequency != null">detection_frequency,</if>
- <if test="startTime != null">start_time,</if>
- <if test="endTime != null">end_time,</if>
- <if test="pointNum != null">point_num,</if>
- <if test="remarks != null">remarks,</if>
- <if test="deptId != null">dept_id,</if>
- <if test="delFlag != null">del_flag,</if>
- <if test="createrCode != null">creater_code,</if>
- <if test="createdate != null">createdate,</if>
- <if test="updaterCode != null">updater_code,</if>
- <if test="updatedate != null">updatedate,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="plantId != null">#{plantId},</if>
- <if test="inspectionPlanNo != null">#{inspectionPlanNo},</if>
- <if test="inspectionPlanName != null">#{inspectionPlanName},</if>
- <if test="detectionFrequency != null">#{detectionFrequency},</if>
- <if test="startTime != null">#{startTime},</if>
- <if test="endTime != null">#{endTime},</if>
- <if test="pointNum != null">#{pointNum},</if>
- <if test="remarks != null">#{remarks},</if>
- <if test="deptId != null">#{deptId},</if>
- <if test="delFlag != null">#{delFlag},</if>
- <if test="createrCode != null">#{createrCode},</if>
- <if test="createdate != null">#{createdate},</if>
- <if test="updaterCode != null">#{updaterCode},</if>
- <if test="updatedate != null">#{updatedate},</if>
- </trim>
- </insert>
- <update id="updateTTaskInspectionPlan" parameterType="TTaskInspectionPlan">
- update t_task_inspection_plan
- <trim prefix="SET" suffixOverrides=",">
- <if test="plantId != null">plant_id = #{plantId},</if>
- <if test="inspectionPlanNo != null">inspection_plan_no = #{inspectionPlanNo},</if>
- <if test="inspectionPlanName != null">inspection_plan_name = #{inspectionPlanName},</if>
- <if test="detectionFrequency != null">detection_frequency = #{detectionFrequency},</if>
- <if test="startTime != null">start_time = #{startTime},</if>
- <if test="endTime != null">end_time = #{endTime},</if>
- <if test="pointNum != null">point_num = #{pointNum},</if>
- <if test="remarks != null">remarks = #{remarks},</if>
- <if test="deptId != null">dept_id = #{deptId},</if>
- <if test="delFlag != null">del_flag = #{delFlag},</if>
- <if test="createrCode != null">creater_code = #{createrCode},</if>
- <if test="createdate != null">createdate = #{createdate},</if>
- <if test="updaterCode != null">updater_code = #{updaterCode},</if>
- <if test="updatedate != null">updatedate = #{updatedate},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteTTaskInspectionPlanById" parameterType="Long">
- update t_task_inspection_plan set del_flag=1 where id = #{id}
- </delete>
- <delete id="deleteTTaskInspectionPlanByIds" parameterType="String">
- update t_task_inspection_plan set del_flag=1 where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|