无关风月
1 天以前 307ac5ff5f5f917f2eec2629449729e577b42dee
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?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.order.mapper.TSettlementConfirmMapper">
    <select id="settlementTotal" resultType="com.ruoyi.order.api.model.TSettlementConfirm">
        select t1.* from
            t_settlement_confirm t1
        where 1=1
        <if test="null != siteIds and siteIds.size()>0" >
            and t1.site_id in
            <foreach collection="siteIds" item="item" index="index" separator="," open="(" close=")">
                #{item}
            </foreach>
        </if>
        <if test="time != null and time!='' ">
            AND DATE_FORMAT(t1.start_time, '%Y-%m') = DATE_FORMAT(#{time}, '%Y-%m')
        </if>
    </select>
    <select id="settlementList" resultType="com.ruoyi.order.api.model.TSettlementConfirm">
        select t1.* from
            t_settlement_confirm t1
        where 1=1
        <if test="req.partnerId != null ">
            and t1.partner_id = #{req.partnerId}
        </if>
        <if test="req.siteIds != null ">
            and t1.site_id = #{req.siteIds}
        </if>
        <if test="null != req.siteIdss and req.siteIdss.size()>0" >
            and t1.site_id in
            <foreach collection="req.siteIdss" item="item" index="index" separator="," open="(" close=")">
                #{item}
            </foreach>
        </if>
        <if test="req.type == 1 ">
            <if test="req.startTime != null and req.startTime!=''">
                and (t1.start_time between #{req.startTime} and #{req.endTime})
            </if>
        </if>
        <if test="req.type == 2 ">
            <if test="req.startTime != null and req.startTime!=''">
                and (t1.end_time between #{req.startTime} and #{req.endTime})
            </if>
        </if>
        and t1.del_flag = 0
    </select>
</mapper>