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

29 lines
1.4 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.OAAuthorizeMapper">
<select id="selectOAAUTHORIZE" resultType="OASysAuthorize">
select q.doa_id as doaId,q.doa_code as doaCode,sq.doa_id oaDoaId,sq.state,sq.remark,sq.doa_vice_president_approved as doaVicePresidentApproved
from authorize q
inner join (
select t.doa_id,t.doa_code,t.state,t.remark,t.doa_vice_president_approved from (
select a.doa_id,a.doa_code,a.state,a.remark,a.doa_vice_president_approved, row_number() over(partition by doa_code order by create_time desc) rw
from sys_oa_authorize a
where a.triggerflag = '1' and a.state in ('2','3') and a.isFinish = '0'
) t where t.rw = 1
) sq on q.doa_code = sq.doa_code
where q.doa_oa_approval_status = '1'
</select>
<update id="updateAuthorizeOAApprovalStatus">
update authorize set doa_approval_status = #{state},doa_oa_approval_status = #{state},
doa_oa_remark = #{remark},doa_vice_president_approved = #{doaVicePresidentApproved}
where doa_id = #{doaId}
</update>
<update id="updateOAAuthorizeByAuthorizeCode">
update sys_oa_authorize set isFinish = '1' where doa_id = #{oaDoaId}
</update>
</mapper>