邱宇豪
2023-11-01 21db563b4f218e04cdf07ee442af76d929e8da3a
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
<?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.thhy.engineering.modules.biz.engineering.mapper.SysDictMapper">
  <resultMap id="BaseResultMap" type="com.thhy.engineering.modules.biz.engineering.entity.SysDict">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Mar 31 09:12:38 CST 2023.
    -->
    <id column="dict_id" jdbcType="VARCHAR" property="dictId" />
    <result column="dict_type" jdbcType="VARCHAR" property="dictType" />
    <result column="dict_type_name" jdbcType="VARCHAR" property="dictTypeName" />
    <result column="dict_name" jdbcType="VARCHAR" property="dictName" />
    <result column="dict_value" jdbcType="INTEGER" property="dictValue" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="is_use" jdbcType="INTEGER" property="isUse" />
  </resultMap>
  <insert id="dictInsert"  useGeneratedKeys="true" keyProperty="dict_id">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Mar 31 09:12:38 CST 2023.
    -->
    insert into sys_dict
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="dict_id != null">
        dict_id,
      </if>
      <if test="dictType != null">
        dict_type,
      </if>
      <if test="dictTypeName != null">
        dict_type_name,
      </if>
      <if test="dictName != null">
        dict_name,
      </if>
      <if test="dictValue != null">
        dict_value,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="isUse != null">
        is_use,
      </if>
      <if test="colors != null">
        colors,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="dict_id != null">
        #{dict_id,jdbcType=VARCHAR},
      </if>
      <if test="dictType != null">
        #{dictType,jdbcType=VARCHAR},
      </if>
      <if test="dictTypeName != null">
        #{dictTypeName,jdbcType=VARCHAR},
      </if>
      <if test="dictName != null">
        #{dictName,jdbcType=VARCHAR},
      </if>
      <if test="dictValue != null">
        #{dictValue,jdbcType=INTEGER},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="isUse != null">
        #{isUse,jdbcType=INTEGER},
      </if>
      <if test="colors != null">
        #{colors,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
 
  <select id="dictList" resultType="com.thhy.engineering.modules.biz.engineering.entity.SysDict">
        select
    sd.dict_id as dictId,
    sd.dict_type as dictType,
    sd.dict_name as dictName,
    sd.dict_value as dictValue,
    sd.colors as colors,
    sd.create_time as createTime,
    sdt.dict_type_name as dictTypeName
         from sys_dict sd
         left join sys_dict_type sdt on sd.dict_type=sdt.dict_type
         where
    sd.is_use=1
        <if test="dictType!=null and dictType!='' ">
          and  sd.dict_type=#{dictType}
        </if>
        order by create_time desc
  </select>
  <select id="dictInfo" parameterType="java.lang.String" resultMap="BaseResultMap">
    select * from sys_dict where dict_id=#{dictId}
  </select>
  <update id="dictDel" parameterType="java.lang.String">
    update sys_dict set
    is_use=2
    where dict_id=#{dictId}
  </update>
  <update id="dictUpdate" >
    update sys_dict
    <set>
      <if test="dictType != null">
        dict_type = #{dictType,jdbcType=VARCHAR},
      </if>
      <if test="dictTypeName != null">
        dict_type_name = #{dictTypeName,jdbcType=VARCHAR},
      </if>
      <if test="dictName != null">
        dict_name = #{dictName,jdbcType=VARCHAR},
      </if>
      <if test="dictValue != null">
        dict_value = #{dictValue,jdbcType=INTEGER},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="isUse != null">
        is_use = #{isUse,jdbcType=INTEGER},
      </if>
      <if test="colors != null">
        colors = #{colors,jdbcType=INTEGER},
      </if>
    </set>
    where dict_id = #{dictId,jdbcType=VARCHAR}
  </update>
  <select id="diceSelectNameByOne" resultType="java.lang.String">
    select dict_id from sys_dict where is_use=1 and dict_type=#{dictType} and dict_name=#{dictName}
  </select>
 
 
  <select id="queryCity" resultType="com.thhy.engineering.modules.biz.engineering.entity.CityPullDown">
    select id,name,parentid from sys_city where parentid = #{parentid}
  </select>
 
  <select id="dictTypePull" resultType="com.thhy.engineering.modules.biz.engineering.entity.ProSunDto.DictTypeDto">
        select
         dict_type as dictType,
         dict_type_name as dictTypeName
         from sys_dict_type
  </select>
  <select id="dictSelectByOne" parameterType="java.lang.String" resultType="com.thhy.engineering.modules.biz.engineering.entity.SysDict">
        select dict_id as dictId,
        dict_name as  dictName,
        dict_type as  dictType
        from sys_dict where is_use=1 and dict_id=#{dictId}
  </select>
  <select id="dictByAll" parameterType="java.lang.String" resultType="java.lang.String">
    select id from sys_pro_sizes where sizes=#{dictId}
  </select>
  <select id="dictByHasAll" parameterType="java.lang.String" resultType="java.lang.String">
    select id from sys_pro_has where has_steel=#{dictId}
  </select>
  <select id="dictByTurnAll" parameterType="java.lang.String" resultType="java.lang.String">
    select id from sys_pro_turn where turn=#{dictId}
  </select>
  <select id="dictByGroutingAll" parameterType="java.lang.String" resultType="java.lang.String">
    select id from sys_pro_grouting where grouting_holes=#{dictId}
  </select>
  <select id="dictByBlokAll" parameterType="java.lang.String" resultType="java.lang.String">
    select id from sys_pro_blok where block_num=#{dictId}
  </select>
</mapper>