123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195 |
- <?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.pssr.mapper.TPssrLightingMapper">
- <resultMap type="TPssrLighting" id="TPssrLightingResult">
- <result property="id" column="id" />
- <result property="subId" column="sub_id" />
- <result property="approveId" column="approve_id" />
- <result property="checkContent" column="check_content" />
- <result property="checkResult" column="check_result" />
- <result property="checkDes" column="check_des" />
- <result property="changeResult" column="change_result" />
- <result property="confirm" column="confirm" />
- <result property="confirmationDate" column="confirmation_date" />
- <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="deptId" column="dept_id" />
- <result property="remarks" column="remarks" />
- <result property="approveStatus" column="approve_status" />
- <result property="deptName" column="dept_name" />
- <result property="confirm1" column="confirm1" />
- <result property="confirm2" column="confirm2" />
- <result property="lightingType" column="lighting_type" />
- <result property="confirm1Name" column="confirm1_name" />
- <result property="confirm2Name" column="confirm2_name" />
- <result property="serialNumber" column="serial_number" />
- </resultMap>
- <sql id="selectTPssrLightingVo">
- select d.id, d.serial_number, u1.nick_name confirm1_name, u2.nick_name confirm2_name, d.confirm1, d.confirm2, d.lighting_type, d.sub_id, d.approve_id, d.check_content, d.check_result, d.check_des, d.change_result, d.confirm, d.confirmation_date, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.approve_status ,s.dept_name from t_pssr_lighting d
- left join sys_dept s on s.dept_id = d.dept_id
- left join sys_user u1 on u1.user_id = d.CONFIRM1
- left join sys_user u2 on u2.user_id = d.CONFIRM2
- </sql>
- <select id="selectNoConfirmCount" parameterType="Long" resultType="int">
- select count(1) from t_pssr_Lighting where sub_id = #{subId} and (confirm1 is null or confirm2 is null) and d.del_flag = 0
- </select>
- <select id="selectTPssrLightingList" parameterType="TPssrLighting" resultMap="TPssrLightingResult">
- <include refid="selectTPssrLightingVo"/>
- <where>
- <if test="subId != null "> and sub_id = #{subId}</if>
- <if test="approveId != null "> and approve_id = #{approveId}</if>
- <if test="checkContent != null and checkContent != ''"> and check_content = #{checkContent}</if>
- <if test="checkResult != null and checkResult != ''"> and check_result = #{checkResult}</if>
- <if test="checkDes != null and checkDes != ''"> and check_des = #{checkDes}</if>
- <if test="changeResult != null and changeResult != ''"> and change_result = #{changeResult}</if>
- <if test="confirm != null and confirm != ''"> and confirm = #{confirm}</if>
- <if test="confirmationDate != null "> and confirmation_date = #{confirmationDate}</if>
- <if test="createrCode != null and createrCode != ''"> and creater_code = #{createrCode}</if>
- <if test="createdate != null "> and createdate = #{createdate}</if>
- <if test="updaterCode != null and updaterCode != ''"> and updater_code = #{updaterCode}</if>
- <if test="updatedate != null "> and updatedate = #{updatedate}</if>
- <if test="deptId != null "> and dept_id = #{deptId}</if>
- <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
- <if test="approveStatus != null "> and approve_status = #{approveStatus}</if>
- <if test="confirm1 != null and confirm1 != ''"> and confirm1 = #{confirm1}</if>
- <if test="confirm2 != null and confirm2 != ''"> and confirm2 = #{confirm2}</if>
- <if test="lightingType != null and lightingType != ''"> and lighting_type = #{lightingType}</if>
- <if test="serialNumber != null and serialNumber != ''"> and serial_number = #{serialNumber}</if>
- and d.del_flag = 0
- </where>
- <!-- 数据范围过滤 -->
- ${params.dataScope}
- order by
- CASE
- WHEN confirm1 IS NULL AND confirm2 IS NULL THEN 0
- WHEN confirm1 IS NULL OR confirm2 IS NULL THEN 1
- ELSE 2
- END,d.serial_number asc
- </select>
- <select id="selectTPssrLightingById" parameterType="Long" resultMap="TPssrLightingResult">
- <include refid="selectTPssrLightingVo"/>
- where id = #{id}
- </select>
- <insert id="insertTPssrLighting" parameterType="TPssrLighting">
- <selectKey keyProperty="id" resultType="long" order="BEFORE">
- SELECT seq_t_pssr_lighting.NEXTVAL as id FROM DUAL
- </selectKey>
- insert into t_pssr_lighting
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">id,</if>
- <if test="subId != null">sub_id,</if>
- <if test="approveId != null">approve_id,</if>
- <if test="checkContent != null">check_content,</if>
- <if test="checkResult != null">check_result,</if>
- <if test="checkDes != null">check_des,</if>
- <if test="changeResult != null">change_result,</if>
- <if test="confirm != null">confirm,</if>
- <if test="confirmationDate != null">confirmation_date,</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>
- <if test="deptId != null">dept_id,</if>
- <if test="remarks != null">remarks,</if>
- <if test="approveStatus != null">approve_status,</if>
- <if test="confirm1 != null">confirm1,</if>
- <if test="confirm2 != null">confirm2,</if>
- <if test="lightingType != null">lighting_type,</if>
- <if test="serialNumber != null">serial_number,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">#{id},</if>
- <if test="subId != null">#{subId},</if>
- <if test="approveId != null">#{approveId},</if>
- <if test="checkContent != null">#{checkContent},</if>
- <if test="checkResult != null">#{checkResult},</if>
- <if test="checkDes != null">#{checkDes},</if>
- <if test="changeResult != null">#{changeResult},</if>
- <if test="confirm != null">#{confirm},</if>
- <if test="confirmationDate != null">#{confirmationDate},</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>
- <if test="deptId != null">#{deptId},</if>
- <if test="remarks != null">#{remarks},</if>
- <if test="approveStatus != null">#{approveStatus},</if>
- <if test="confirm1 != null">#{confirm1},</if>
- <if test="confirm2 != null">#{confirm2},</if>
- <if test="lightingType != null">#{lightingType},</if>
- <if test="serialNumber != null">#{serialNumber},</if>
- </trim>
- </insert>
- <update id="updateTPssrLighting" parameterType="TPssrLighting">
- update t_pssr_lighting
- <trim prefix="SET" suffixOverrides=",">
- <if test="subId != null">sub_id = #{subId},</if>
- <if test="approveId != null">approve_id = #{approveId},</if>
- <if test="checkContent != null">check_content = #{checkContent},</if>
- <if test="checkResult != null">check_result = #{checkResult},</if>
- <if test="checkDes != null">check_des = #{checkDes},</if>
- <if test="changeResult != null">change_result = #{changeResult},</if>
- <if test="confirm != null">confirm = #{confirm},</if>
- <if test="confirmationDate != null">confirmation_date = #{confirmationDate},</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>
- <if test="deptId != null">dept_id = #{deptId},</if>
- <if test="remarks != null and remarks != ''">remarks = #{remarks},</if>
- <if test="approveStatus != null">approve_status = #{approveStatus},</if>
- <if test="confirm1 != null">confirm1 = #{confirm1},</if>
- <if test="confirm2 != null">confirm2 = #{confirm2},</if>
- <if test="lightingType != null">lighting_type = #{lightingType},</if>
- <if test="serialNumber != null">serial_number = #{serialNumber},</if>
- </trim>
- where id = #{id}
- </update>
- <update id="updateTPssrLightingByIds" parameterType="TPssrLighting">
- update t_pssr_lighting
- <trim prefix="SET" suffixOverrides=",">
- <if test="confirm1 != null">confirm1 = #{confirm1},</if>
- <if test="confirm2 != null">confirm2 = #{confirm2},</if>
- <if test="confirmationDate != null">confirmation_date = #{confirmationDate},</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>
- <if test="remarks != null and remarks != ''">remarks = #{remarks},</if>
- <if test="serialNumber != null">serial_number = #{serialNumber},</if>
- </trim>
- where id in
- <foreach item="id" collection="ids" open="(" separator="," close=")">
- #{id}
- </foreach>
- </update>
- <update id="deleteTPssrLightingById" parameterType="Long">
- update t_pssr_lighting set del_flag = 2 where id = #{id}
- </update>
- <update id="deleteTPssrLightingByIds" parameterType="String">
- update t_pssr_lighting set del_flag = 2 where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </update>
- </mapper>
|