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

29 lines
1.2 KiB
XML
Raw Normal View History

2024-08-05 17:16:54 +08:00
<?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.remark,sq.pq_vp_approval as pqVpApproval
from zgys q
inner join (
select t.pq_code,t.state,t.remark,t.pq_vp_approval from (
select 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},
2024-08-08 16:51:48 +08:00
pq_oa_remark = #{remark},pq_vp_approval = #{pqVpApproval}
2024-08-05 17:16:54 +08:00
where pq_id = #{pqId}
</update>
<update id="updateOAZgysByZgysCode">
update sys_oa_zgys set isFinish = '1' where pq_code = #{pqCode}
</update>
</mapper>