liujie
2023-09-16 1aa309700fb7e12d85f98bed22a45bdac448ec1c
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
<?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.activity.mapper.BodySideAppointmentMapper">
    <update id="changeState">
        update t_body_side_appointments set
        status = 2
        <where>
            <if test="ids != null and ids.size()>0">
                AND t_body_side_appointments.id IN
                <foreach collection="ids" separator="," item="id" open="(" close=")">
                    #{id}
                </foreach>
            </if>
        </where>
    </update>
 
    <select id="listAll" resultType="com.dsh.activity.model.QueryBodySideAppointmentVO">
            select t1.* from t_body_side_appointments t1
            <where>
                <if test="query.phone!=null and query.phone!= ''">
                    and t1.phone like concat('%',#{query.phone},'%')
                </if>
                <if test="query.parentName!=null and query.parentName!= ''">
                    t1.parentName like concat('%',#{query.parentName},'%')
                </if>
                <if test="query.state!=null and query.state!= ''">
                    and t1.status = #{query.state}
                </if>
 
                <if test="query.day!=null and query.day!= '' and query.day==1" >
                    and DATE(t1.appointmentTime) = CURDATE()
                </if>
                <if test="query.day!=null and query.day!= '' and query.day==2" >
                    and DATE(t1.appointmentTime) = DATE_ADD(CURDATE(), INTERVAL 1 DAY)
                </if>
                <if test="query.day!=null and query.day!= '' and query.day==7" >
                    AND DATE(t1.appointmentTime) BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 7 DAY)
                </if>
                <if test="query.ids != null and query.ids.size()>0">
                    AND t1.storeId IN
                    <foreach collection="query.ids" separator="," item="id" open="(" close=")">
                        #{id}
                    </foreach>
                </if>
            </where>
    </select>
 
</mapper>