yangys
2024-04-18 b3cbbc1b1bf540359ac22f8733f6c322d845b38f
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
<?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.qianwen.smartman.modules.cps.mapper.WarehouseStationMapper">
 
    <select id="listPage" resultType="com.qianwen.smartman.modules.cps.entity.WarehouseStation">
        SELECT
        ws.id,
        ws.warehouse_code AS warehouseCode,
        ws.warehouse_name AS warehouseName,
        wa.name AS warehouseAreaName,
        wa.code AS warehouseAreaCode,
        ws.avatar,
        ws.remark
        FROM
        blade_warehouse_station ws
        LEFT JOIN blade_warehouse_area wa ON ws.area_id = wa.id
        WHERE
        ws.is_deleted = 0
        <if test="areaId != null">
            and wa.id = #{areaId}
        </if>
 
        <if test="keyWord !='' and keyWord !=null">
            AND ( ws.warehouse_code LIKE CONCAT(#{keyWord},'%') OR warehouse_name LIKE CONCAT(#{keyWord},'%') )
        </if>
        ORDER BY ws.create_time DESC,ws.id desc ;
 
    </select>
 
    <select id="getWarehouseStationList" resultType="com.qianwen.smartman.modules.cps.vo.WarehouseStationVO">
        select a.id,b.code warehouseAreaCode
        from blade_warehouse_station a
        join blade_warehouse_area b on b.id = a.area_id
        <where>
            and a.is_deleted=0
            and b.is_deleted=0
            <if test="ids != null and ids.size() > 0">
                AND a.id IN
                <foreach collection="ids" item="id" open="(" separator="," close=")">
                    #{id}
                </foreach>
            </if>
        </where>
    </select>
</mapper>