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

28 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.OAExpensesMapper">
<select id="selectOAEXPENSES" resultType="OASysExpenses">
select q.exp_id as expId,q.exp_code as expCode,sq.exp_id oaExpId,sq.state,sq.remark
from expenses q
inner join (
select t.exp_id,t.exp_code,t.state,t.remark,t.exp_vice_president_approved from (
select a.exp_id,a.exp_code,a.state,a.remark,a.exp_vice_president_approved, row_number() over(partition by exp_code order by create_time desc) rw
from sys_oa_expenses a
where a.triggerflag = '1' and a.state in ('2','3') and a.isFinish = '0'
) t where t.rw = 1
) sq on q.exp_code = sq.exp_code
where q.exp_oa_approval_status = '1'
</select>
<update id="updateExpensesOAApprovalStatus">
update expenses set exp_approval_status = #{state},exp_oa_approval_status = #{state},exp_oa_remark = #{remark}
where exp_id = #{expId}
</update>
<update id="updateOAExpensesByExpensesCode">
update sys_oa_expenses set isFinish = '1' where exp_id = #{oaExpId}
</update>
</mapper>