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

28 lines
1.1 KiB
XML
Raw Normal View History

2024-07-24 14:53:01 +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.OABidMapper">
<select id="selectOABID" resultType="OASysBid">
select q.bid_id as bidId,q.bid_code as bidCode,sq.state,sq.remark
from bid q
inner join (
select t.bid_code,t.state,t.remark from (
select a.bid_code,a.state,a.remark, row_number() over(partition by bid_code order by create_time desc) rw
from sys_oa_bid a
where a.triggerflag = '1' and a.state in ('1','3') and a.isFinish = '0'
) t where t.rw = 1
) sq on q.bid_code = sq.bid_code
where q.bid_approval_status = '4'
</select>
<update id="updateBidOAApprovalStatus">
update bid set bid_approval_status = #{state},bid_returnRemark = #{remark}
where bid_id = #{bidId}
</update>
<update id="updateOABidByBidCode">
update sys_oa_bid set isFinish = '1' where bid_code = #{bidCode}
</update>
</mapper>