#
vincentlu
2025-05-13 ebd2f4397a92c6a5096de1b86d59154363344720
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
50
51
52
53
54
55
56
57
58
59
60
<?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.zy.acs.manager.manager.mapper.CodeMapper">
 
    <!-- 关联查询sql -->
    <sql id="selectSql">
        SELECT a.*
        FROM man_code a
        <where>
            AND a.deleted = 0
            <if test="param.id != null">
                AND a.id = #{param.id}
            </if>
            <if test="param.data != null">
                AND a.data = #{param.data}
            </if>
            <if test="param.status != null">
                AND a.status = #{param.status}
            </if>
            <if test="param.keywords != null">
                AND (
                a.memo LIKE CONCAT('%', #{param.keywords}, '%')
                OR a.memo LIKE CONCAT('%', #{param.keywords}, '%')
                )
            </if>
        </where>
    </sql>
 
    <select id="selectMinAndMaxByPoint" resultType="java.util.Map">
        SELECT
        ROUND(MIN(X),1) AS min_x,
        ROUND(MAX(X),1) AS max_x,
        ROUND(MIN(Y),1) AS min_y,
        ROUND(MAX(Y),1) AS max_y
        FROM man_code where deleted = 0
    </select>
 
    <select id="selectDistinctCountFromX" resultType="java.lang.Integer">
        SELECT
        COUNT(DISTINCT X)
        FROM man_code
        WHERE 1=1
        AND status = 1
        AND deleted = 0
    </select>
 
    <select id="selectDistinctCountFromY" resultType="java.lang.Integer">
        SELECT
        COUNT(DISTINCT Y)
        FROM man_code
        WHERE 1=1
        AND status = 1
        AND deleted = 0
    </select>
 
    <select id="selectAllLocCode" resultType="java.lang.Long">
        select distinct code from man_loc where 1=1 and code is not null
    </select>
 
</mapper>