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
<?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.account.mapper.CoachMapper">
    <update id="changeState">
        update t_coach set
        state = #{state}
        <where>
            <if test="ids != null and ids.size()>0">
                AND t_coach.id IN
                <foreach collection="ids" separator="," item="id" open="(" close=")">
                    #{id}
                </foreach>
            </if>
        </where>
    </update>
 
 
    <select id="listAll" resultType="com.dsh.account.model.vo.CoachSerchVO">
        select t1.*,t2.name accountName,t2.phone accountPhone,t3.name coachTypeName from t_coach t1
        left join t_city_manager t2 on t1.cityManagerId = t2.id
        left join t_coach_type t3 on t1.coachTypeId = t3.id
        <where>
            <if test="query.city!=null and query.city!= ''">
                and t1.city = #{query.city}
            </if>
            <if test="query.province!=null and query.province!= ''">
                and t1.province = #{query.province}
            </if>
            <if test="query.name!=null and query.name!= ''">
                AND t1.name LIKE concat('%',#{query.name},'%')
            </if>
            <if test="query.phone!=null and query.phone!= ''">
                and t1.phone LIKE concat('%',#{query.phone},'%')
            </if>
            <if test="query.id!=null and query.id!= ''">
                and t1.id = #{query.id}
            </if>
            <if test="query.operatorId!=null and query.operatorId!= ''">
                and t1.cityManagerId = #{query.operatorId}
            </if>
            and t1.state != 3
        </where>
    </select>
</mapper>