zj
2025-01-06 0e7b38c2b3af72ea2a7f8a2fcbaad4d78e2c1977
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?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.gear.swx.mapper.SwxSmartOrderMapper">
 
    <select id="countByMarketId" resultType="integer">
        select count(*) from swx_smart_order so
                        where `status`=0
                          and so.user_id = #{userId} and so.market_id  = #{marketId} and so.all_day = #{allDay,jdbcType=INTEGER}
    </select>
 
    <update id="updateSmartById">
        update swx_smart_order set
                                   `status` = #{status},
                                   all_profit = #{allProfit},
                                   current_profit = #{currentProfit},
                                   current_day = #{currentDay},
                                   next_profit_time = #{nextProfitTime}
        where id = #{id}
    </update>
 
    <select id="getProfitCompensateList" resultType="com.gear.swx.domain.SwxSmartOrder">
        select * from swx_smart_order where `status`=0 and TIMESTAMPDIFF(MINUTE, next_profit_time, sysdate()) > 29
    </select>
</mapper>