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
<?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.course.mapper.TOperatorMapper">
    <update id="changeState">
        update t_operator set
        state = #{state}
        <where>
            <if test="ids != null and ids.size()>0">
                AND t_operator.id IN
                <foreach collection="ids" separator="," item="id" open="(" close=")">
                    #{id}
                </foreach>
            </if>
        </where>
    </update>
 
    <select id="listAll" resultType="java.util.Map">
        select t1.id as id, t1.name as name,t1.type as `type`,t1.state as state,t1.status as status,t2.name as userName,t2.phone as phone
        from t_operator t1
        left join sys_user t2 on t1.userId = t2.id
        where 1=1
        <if test="userName != null and userName != ''">
            and t2.name like CONCAT('%',#{userName},'%')
        </if>
        <if test="phone != null and phone != ''">
            and t2.phone like CONCAT('%',#{phone},'%')
        </if>
        <if test="type != null and type != ''">
            and t1.type =  #{type}
        </if>
    </select>
    <select id="getBankList" resultType="com.dsh.guns.modular.system.model.Bank">
        select * from t_bank
    </select>
</mapper>