whyclxw
2025-03-25 a7fef2846505b08e0711345b17902e7381612d23
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
<?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.whyc.mapper.LockBlMapper">
 
    <select id="getLockBl" resultType="com.whyc.pojo.db_area.LockBl">
        select tb_lock_bl.*,
               tb_lock_inf.lock_name,
               tb_area_inf.area_name,
               tb_area_inf.area_path
        from db_area.tb_lock_inf,db_area.tb_lock_bl,db_area.tb_area_inf
        <where>
            tb_lock_inf.area_id=tb_area_inf.id
            and tb_lock_inf.lock_id=tb_lock_bl.lock_id
            <if test="lockName!=null">
                and tb_lock_inf.lock_name  LIKE CONCAT('%',#{lockName},'%')
            </if>
            <if test="type!=null">
                and tb_lock_bl.type=#{type}
            </if>
            <if test="areaList!=null">
                and area_id in
                <foreach collection="areaList" item="id" open="(" separator="," close=")">
                    #{id}
                </foreach>
            </if>
        </where>
        order by tb_lock_bl.start_time desc
    </select>
</mapper>