JNBusinessTest/ruoyi-quartz/target/classes/mapper/quartz/OAZgysMapper.xml

29 lines
1.3 KiB
XML

<?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.quartz.mapper.OAZgysMapper">
<select id="selectOAZGYS" resultType="OASysZgys">
select q.pq_id as pqId,q.pq_code as pqCode,sq.state,sq.pq_id oaPqId,sq.remark,sq.pq_vp_approval as pqVpApproval
from zgys q
inner join (
select t.pq_id,t.pq_code,t.state,t.remark,t.pq_vp_approval from (
select a.pq_id,a.pq_code,a.state,a.remark,a.pq_vp_approval, row_number() over(partition by pq_code order by create_time desc) rw
from sys_oa_zgys a
where a.triggerflag = '1' and a.state in ('2','3') and a.isFinish = '0'
) t where t.rw = 1
) sq on q.pq_code = sq.pq_code
where q.pq_oa_approval_status = '1'
</select>
<update id="updateZgysOAApprovalStatus">
update zgys set pq_approval_status = #{state},pq_oa_approval_status = #{state},
pq_oa_remark = #{remark},pq_vp_approval = #{pqVpApproval}
where pq_id = #{pqId}
</update>
<update id="updateOAZgysByZgysCode">
update sys_oa_zgys set isFinish = '1' where pq_id = #{oaPqId}
</update>
</mapper>