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

28 lines
1.2 KiB
XML
Raw Permalink Normal View History

2024-08-13 15:58:13 +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.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 (
2024-08-14 13:48:19 +08:00
select t.exp_id,t.exp_code,t.state,t.remark from (
select a.exp_id,a.exp_code,a.state,a.remark, row_number() over(partition by exp_code order by create_time desc) rw
2024-08-13 15:58:13 +08:00
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>