puzhibing
2024-02-05 640ff18d2d7f4be02ddb7f8f75e899f05545eb98
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
47
48
49
50
51
52
<?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.dsh.other.mapper.SiteBookingMapper">
 
 
    <select id="queryDatas" resultType="com.dsh.other.model.BillingRequestOfType">
        SELECT DATE_FORMAT(insertTime, '%m-%d %H:%i')as `time`,DATE_FORMAT(payTime, '%m-%d %H:%i')as `time1`,
        payMoney as amount,
        `status`
        from t_site_booking
        where payType != 3 and status != 0
        <if test="null != monthStart and '' != monthStart and null != monthEnd and '' != monthEnd">
            and DATE_FORMAT(payTime, '%Y-%m-%d %H:%i:%s') between #{monthStart} and #{monthEnd}
        </if>
        <if test="null != appUserId and '' != appUserId ">
            and appUserId = #{appUserId}
        </if>
    </select>
 
    <select id="listAll" resultType="com.dsh.other.entity.SiteBooking">
        select * from t_site_booking t1
        <where>
            <if test="amount!=null and amount!= ''">
                and t1.payMoney &lt;= #{amount}
            </if>
            <if test="query.userIds != null and query.userIds.size()>0">
                AND t1.appUserId IN
                <foreach collection="query.userIds" separator="," item="id" open="(" close=")">
                    #{id}
                </foreach>
            </if>
            <if test="query.storeIds != null and query.storeIds.size()>0">
                AND t1.storeId IN
                <foreach collection="query.storeIds" separator="," item="id" open="(" close=")">
                    #{id}
                </foreach>
            </if>
            <if test="sTime !=null and sTime!= '' and eTime !=null and eTime!= ''">
                and t1.insertTime between #{sTime} and #{eTime}
            </if>
        </where>
    </select>
    <select id="queryByCode" resultType="java.lang.Integer">
        SELECT  storeId
        from t_site_booking
        WHERE orderNo = #{code}
 
 
 
 
    </select>
</mapper>