jiazx0107@163.com
2023-11-04 43ce77a85d8297a53dc25430fff10ead57296167
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<?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.ld.igds.common.mapper.DicDataMapper">
 
    <!-- 更新 -->
    <delete id="batchDelPos" parameterType="com.ld.igds.common.dto.PosDto">
        delete from d_dic_location
        <where>
            <if test="dto.companyId != null"> AND COMPANY_ID_ =
                #{dto.companyId}
            </if>
            <if test="dto.selfTag != null"> AND SELF_TAG_ = #{dto.selfTag}
            </if>
            <if test="dto.bizTag != null"> AND BIZ_TAG_ = #{dto.bizTag}</if>
            <if test="dto.depotId != null"> AND DEPOT_ID_ = #{dto.depotId}
            </if>
        </where>
    </delete>
 
    <!-- 单个数据删除 -->
    <delete id="delPosByBizId" parameterType="com.ld.igds.common.dto.PosDto">
        delete from d_dic_location
        <where>
            <if test="dto.companyId != null"> AND COMPANY_ID_ = #{dto.companyId}</if>
            <if test="dto.bizId != null"> AND BIZ_ID_ = #{dto.bizId}</if>
        </where>
    </delete>
 
 
    <!-- 获取坐标信息-->
    <select id="getPosByBizTag" resultType="com.ld.igds.common.dto.PosDto">
        select
        id_ as id,
        company_id_ as companyId,
        BIZ_TAG_ as bizTag,
        biz_id_ as bizId,
        self_tag_ as selfTag,
        pos_x_ as posX,
        pos_y_ as posY,
        pos_z_ as posZ
        from d_dic_location
        <where>
            COMPANY_ID_ = #{companyId}
            AND BIZ_TAG_ = #{bizTag}
        </where>
 
    </select>
 
 
    <!-- 新增 -->
    <insert id="addPos" parameterType="com.ld.igds.common.dto.PosDto">
        insert into
        d_dic_location(id_,company_id_,depot_id_,biz_tag_,biz_id_,self_tag_,pos_x_,pos_y_,pos_z_)
        values(
        #{dto.id},
        #{dto.companyId},
        #{dto.depotId},
        #{dto.bizTag},
        #{dto.bizId},
        #{dto.selfTag},
        #{dto.posX},
        #{dto.posY},
        #{dto.posZ}
        )
    </insert>
 
    <!-- 查询标语 -->
    <select id="getDicSlogan" resultType="com.ld.igds.models.DicSlogan"
            parameterType="java.util.Map">
        select
        *
        from D_DIC_SLOGAN g
        <where>
            <if test="param.companyId != null">AND g.COMPANY_ID_ =
                #{param.companyId}</if>
            <if test="param.status != null">AND g.STATUS_ = #{param.status}
            </if>
            order by g.PUSH_TIME_ DESC
 
            limit 1
        </where>
    </select>
 
    <!-- 获取区域列表 -->
    <select id="listDicArea" resultType="com.ld.igds.models.DicArea"
            parameterType="com.ld.igds.data.BaseParam">
        select
        CODE_ as code,
        NAME_ as name,
        TYPE_ as type,
        SIMPLE_ as simple
        from D_DIC_AREA
        <where>
            <if test="param.key != null">AND (NAME_ like "%"#{param.key}"%" OR SIMPLE_ like "%"#{param.key}"%" )</if>
        </where>
        order by CODE_
    </select>
 
</mapper>