123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218 |
- <?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.TPssrOverhaulExchangerMapper">
- <resultMap type="TPssrOverhaulExchanger" id="TPssrOverhaulExchangerResult">
- <result property="id" column="id" />
- <result property="subId" column="sub_id" />
- <result property="approveId" column="approve_id" />
- <result property="tagNo" column="tag_no" />
- <result property="equipmentName" column="equipment_name" />
- <result property="workDes" column="work_des" />
- <result property="pidNo" column="pid_no" />
- <result property="devType" column="dev_type" />
- <result property="completionDate" column="completion_date" />
- <result property="confirmedPerson" column="confirmed_person" />
- <result property="confirmedName" column="confirmed_name" />
- <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="completionStatus" column="completion_status" />
- </resultMap>
- <sql id="selectTPssrOverhaulExchangerVo">
- select d.completion_status,d.dev_type,d.id, d.sub_id, d.approve_id, d.tag_no, d.equipment_name, d.work_des, d.pid_no, d.completion_date, d.confirmed_person,u.NICK_NAME confirmed_name, 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_overhaul_exchanger d
- left join sys_dept s on s.dept_id = d.dept_id
- left join sys_user u on u.user_id = d.CONFIRMED_PERSON
- </sql>
- <select id="selectNoConfirmCount" parameterType="Long" resultType="int">
- SELECT and d.del_flag = 0
- (SELECT COUNT(1) FROM T_PSSR_OVERHAUL_EXCHANGER WHERE sub_id = #{subId} and CONFIRMED_PERSON IS NULL) +
- (SELECT COUNT(1) FROM T_PSSR_OVERHAUL_FILTER WHERE sub_id = #{subId} and RESP_PERSON IS NULL) +
- (SELECT COUNT(1) FROM T_PSSR_OVERHAUL_TOWER WHERE sub_id = #{subId} and CONFIRMED_PERSON IS NULL) +
- (SELECT COUNT(1) FROM T_PSSR_OVERHAUL_VALVE WHERE sub_id = #{subId} and IDENTIFYING_PERSON IS NULL)
- FROM dual
- </select>
- <select id="selectTPssrOverhaulExchangerList" parameterType="TPssrOverhaulExchanger" resultMap="TPssrOverhaulExchangerResult">
- <include refid="selectTPssrOverhaulExchangerVo"/>
- <where>
- <if test="subId != null "> and sub_id = #{subId}</if>
- <if test="approveId != null "> and approve_id = #{approveId}</if>
- <if test="devType != null "> and dev_type = #{devType}</if>
- <if test="tagNo != null and tagNo != ''"> and tag_no = #{tagNo}</if>
- <if test="equipmentName != null and equipmentName != ''"> and equipment_name like concat(concat('%', #{equipmentName}), '%')</if>
- <if test="workDes != null and workDes != ''"> and work_des = #{workDes}</if>
- <if test="pidNo != null and pidNo != ''"> and pid_no = #{pidNo}</if>
- <if test="completionDate != null "> and completion_date = #{completionDate}</if>
- <if test="confirmedPerson != null and confirmedPerson != ''"> and confirmed_person = #{confirmedPerson}</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="completionStatus != null "> and completion_status = #{completionStatus}</if>
- <if test="searchValue != null "> and (pid_no like concat('%',concat(#{searchValue},'%')) or tag_no like concat('%',concat(#{searchValue},'%')))</if>
- and d.del_flag = 0
- </where>
- <!-- 数据范围过滤 -->
- ${params.dataScope}
- order by
- CASE
- WHEN confirmed_person IS NULL THEN 0
- ELSE 1
- END,createdate desc
- </select>
- <select id="selectTPssrOverhaulExchangerById" parameterType="Long" resultMap="TPssrOverhaulExchangerResult">
- <include refid="selectTPssrOverhaulExchangerVo"/>
- where id = #{id}
- </select>
- <select id="selectAllConfirmedPersonBySubId" parameterType="TPssrOverhaulExchanger" resultMap="TPssrOverhaulExchangerResult">
- SELECT LISTAGG(CONFIRMED_PERSON , ',') WITHIN GROUP (ORDER BY CONFIRMED_PERSON)AS CONFIRMED_PERSON
- FROM (
- select CONFIRMED_PERSON from T_PSSR_OVERHAUL_EXCHANGER where sub_id= #{subId}
- <if test="approveStatus != null "> and approve_status = #{approveStatus}</if>
- and del_flag = 0 union
- select RESP_PERSON from T_PSSR_OVERHAUL_FILTER where sub_id= #{subId}
- <if test="approveStatus != null "> and approve_status = #{approveStatus}</if>
- and del_flag = 0 union
- select CONFIRMER from T_PSSR_OVERHAUL_PIPE where sub_id= #{subId}
- <if test="approveStatus != null "> and approve_status = #{approveStatus}</if>
- and del_flag = 0 union
- select CONFIRMED_PERSON from T_PSSR_OVERHAUL_PUMP where sub_id= #{subId}
- <if test="approveStatus != null "> and approve_status = #{approveStatus}</if>
- and del_flag = 0 union
- select CONFIRMED_PERSON from T_PSSR_OVERHAUL_TOWER where sub_id= #{subId}
- <if test="approveStatus != null "> and approve_status = #{approveStatus}</if>
- and del_flag = 0 union
- select IDENTIFYING_PERSON from T_PSSR_OVERHAUL_VALVE where sub_id= #{subId}
- <if test="approveStatus != null "> and approve_status = #{approveStatus}</if>
- and del_flag = 0)
- </select>
- <update id="updateAllBySubId" parameterType="TPssrOverhaulExchanger">
- update T_PSSR_OVERHAUL_EXCHANGER
- <trim prefix="SET" suffixOverrides=",">
- <if test="approveStatus != null">approve_status = #{approveStatus},</if>
- <if test="updaterCode != null">updater_code = #{updaterCode},</if>
- <if test="updatedate != null">updatedate = #{updatedate},</if>
- </trim>
- where sub_id= #{subId} and APPROVE_STATUS=0
- </update>
- <insert id="insertTPssrOverhaulExchanger" parameterType="TPssrOverhaulExchanger">
- <selectKey keyProperty="id" resultType="long" order="BEFORE">
- SELECT seq_t_pssr_overhaul_exchanger.NEXTVAL as id FROM DUAL
- </selectKey>
- insert into t_pssr_overhaul_exchanger
- <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="tagNo != null">tag_no,</if>
- <if test="equipmentName != null">equipment_name,</if>
- <if test="workDes != null">work_des,</if>
- <if test="devType != null">dev_type,</if>
- <if test="pidNo != null">pid_no,</if>
- <if test="completionDate != null">completion_date,</if>
- <if test="confirmedPerson != null">confirmed_person,</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="completionStatus != null">completion_status,</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="tagNo != null">#{tagNo},</if>
- <if test="equipmentName != null">#{equipmentName},</if>
- <if test="workDes != null">#{workDes},</if>
- <if test="devType != null">#{devType},</if>
- <if test="pidNo != null">#{pidNo},</if>
- <if test="completionDate != null">#{completionDate},</if>
- <if test="confirmedPerson != null">#{confirmedPerson},</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="completionStatus != null">#{completionStatus},</if>
- </trim>
- </insert>
- <update id="updateTPssrOverhaulExchanger" parameterType="TPssrOverhaulExchanger">
- update t_pssr_overhaul_exchanger
- <trim prefix="SET" suffixOverrides=",">
- <if test="subId != null">sub_id = #{subId},</if>
- <if test="approveId != null">approve_id = #{approveId},</if>
- <if test="tagNo != null">tag_no = #{tagNo},</if>
- <if test="equipmentName != null">equipment_name = #{equipmentName},</if>
- <if test="workDes != null">work_des = #{workDes},</if>
- <if test="devType != null">dev_type = #{devType},</if>
- <if test="pidNo != null">pid_no = #{pidNo},</if>
- <if test="completionDate != null">completion_date = #{completionDate},</if>
- <if test="confirmedPerson != null">confirmed_person = #{confirmedPerson},</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="completionStatus != null">completion_status = #{completionStatus},</if>
- </trim>
- where id = #{id}
- </update>
- <update id="updateTPssrOverhaulExchangerByIds" parameterType="TPssrOverhaulExchanger">
- update t_pssr_overhaul_exchanger
- <trim prefix="SET" suffixOverrides=",">
- <if test="completionDate != null">completion_date = #{completionDate},</if>
- <if test="confirmedPerson != null">confirmed_person = #{confirmedPerson},</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>
- </trim>
- where id in
- <foreach item="id" collection="ids" open="(" separator="," close=")">
- #{id}
- </foreach>
- </update>
- <update id="deleteTPssrOverhaulExchangerById" parameterType="Long">
- update t_pssr_overhaul_exchanger set del_flag = 2 where id = #{id}
- </update>
- <update id="deleteTPssrOverhaulExchangerByIds" parameterType="String">
- update t_pssr_overhaul_exchanger set del_flag = 2 where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </update>
- </mapper>
|