Administrator
2023-06-19 49588f5a462ae7425e7eb030438a35fd80c246fa
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
<?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.gk.firework.Mapper.HiddenDangerCheckContentMapper" >
  <resultMap id="BaseResultMap" type="com.gk.firework.Domain.HiddenDangerCheckContent" >
    <!--          -->
    <id column="id" property="id" jdbcType="BIGINT" />
    <result column="checkcontent" property="checkcontent" jdbcType="VARCHAR" />
    <result column="createtime" property="createtime" jdbcType="TIMESTAMP" />
    <result column="createby" property="createby" jdbcType="VARCHAR" />
    <result column="updatetime" property="updatetime" jdbcType="TIMESTAMP" />
    <result column="updateby" property="updateby" jdbcType="VARCHAR" />
    <result column="validflag" property="validflag" jdbcType="BIT" />
    <result column="belongid" property="belongid" jdbcType="BIGINT" />
    <result column="belongname" property="belongname" jdbcType="VARCHAR" />
    <collection property="criteriaList"
                ofType="com.gk.firework.Domain.HiddenDangerCheckCriteria" select="get-criteria"
                column="id">
 
    </collection>
  </resultMap>
 
  <resultMap id="criteria" type="com.gk.firework.Domain.HiddenDangerCheckCriteria" >
    <id column="id" property="id" jdbcType="BIGINT" />
    <result column="checkcriteria" property="checkcriteria" jdbcType="VARCHAR" />
    <result column="basis" property="basis" jdbcType="VARCHAR" />
    <result column="belongid" property="belongid" jdbcType="VARCHAR" />
    <result column="validflag" property="validflag" jdbcType="BIT" />
    <collection property="typeList"
                ofType="com.gk.firework.Domain.HiddenDangerCheckType" select="get-type"
                column="id">
 
    </collection>
  </resultMap>
 
  <resultMap id="type" type="com.gk.firework.Domain.HiddenDangerCheckType" >
    <id column="id" property="id" jdbcType="BIGINT" />
    <result column="checktype" property="checktype" jdbcType="VARCHAR" />
    <result column="belongid" property="belongid" jdbcType="VARCHAR" />
    <result column="validflag" property="validflag" jdbcType="BIT" />
    <collection property="checkResultList"
                ofType="com.gk.firework.Domain.HiddenDangerCheckResult" select="get-result"
                column="id">
    </collection>
  </resultMap>
 
 
  <select id="get-criteria"  resultMap="criteria">
    select
    id ,
    checkcriteria,
    basis,
    belongid
    from hiddendangercheckcriteria
    where belongid = #{id}
    and validflag = 1
  </select>
 
  <select id="get-type"  resultMap="type">
    select
    id ,
    checktype,
    belongid
    from hiddendangerchecktype
    where belongid = #{id}
    and validflag = 1
  </select>
 
  <select id="get-result"  resultType="com.gk.firework.Domain.HiddenDangerCheckResult">
    select
    id ,
    checkresult,
    isqualified,
    belongid
    from hiddendangercheckresult
    where belongid = #{id}
    and validflag = 1
  </select>
 
  <select id="selectContent" parameterType="java.util.Map" resultMap="BaseResultMap">
    select
    id,
    checkcontent,
    belongid
    from hiddendangercheckcontent
    where belongid= #{menu}
    and validflag = 1
  </select>
 
  <select id="selectRow" parameterType="java.util.Map" resultType="com.gk.firework.Domain.Vo.HiddenDangerTableRow">
    select
    hdcct.checkcontent checkcontent,
    hdcct.belongid parentmenuid,
    hdcca.checkcriteria ,
    hdct.id  checktypeid,
    hdct.checktype ,
    hdcca.basis ,
    hdcr1.checkresult checkresult1,
    hdcr2.checkresult checkresult0,
    hdcr1.id result1,
    hdcr2.id result0
    from hiddendangercheckcontent hdcct
    left join hiddendangercheckcriteria hdcca on hdcca.belongid = hdcct.id and hdcct.validflag = 1
    left join hiddendangerchecktype hdct on  hdct.belongid = hdcca.id and hdcca.validflag = 1
    left join hiddendangercheckresult hdcr1 on hdcr1.belongid =  hdct.id and hdcr1.isqualified = 1 and hdcr1.validflag = 1
    left join hiddendangercheckresult hdcr2 on hdcr2.belongid =  hdct.id and hdcr2.isqualified = 0 and hdcr2.validflag = 1
    <if test="level == 1 " >
    left join  hiddendangermenu hdm on hdm.id = hdcct.belongid
    </if>
    where hdcct.validflag = 1
    <if test="level != null and level != '' and menu != null and menu != ''">
      <if test="level == 2 ">
        and hdcct.belongid = #{menu}
      </if>
      <if test="level == 1">
        and hdm.parentid = #{menu}
      </if>
    </if>
 
  </select>
 
  <sql id="Base_Column_List" >
    <!--          -->
    id, checkcontent, createtime, createby, updatetime, updateby, validflag, belongid, 
    belongname
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
    <!--          -->
    select 
    <include refid="Base_Column_List" />
    from hiddendangercheckcontent
    where id = #{id,jdbcType=BIGINT}
  </select>
 
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
    <!--          -->
    delete from hiddendangercheckcontent
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.gk.firework.Domain.HiddenDangerCheckContent" >
    <!--          -->
    insert into hiddendangercheckcontent (id, checkcontent, createtime, 
      createby, updatetime, updateby, 
      validflag, belongid, belongname
      )
    values (#{id,jdbcType=BIGINT}, #{checkcontent,jdbcType=VARCHAR}, #{createtime,jdbcType=TIMESTAMP}, 
      #{createby,jdbcType=VARCHAR}, #{updatetime,jdbcType=TIMESTAMP}, #{updateby,jdbcType=VARCHAR}, 
      #{validflag,jdbcType=BIT}, #{belongid,jdbcType=BIGINT}, #{belongname,jdbcType=VARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.gk.firework.Domain.HiddenDangerCheckContent" >
    <!--          -->
    insert into hiddendangercheckcontent
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        id,
      </if>
      <if test="checkcontent != null" >
        checkcontent,
      </if>
      <if test="createtime != null" >
        createtime,
      </if>
      <if test="createby != null" >
        createby,
      </if>
      <if test="updatetime != null" >
        updatetime,
      </if>
      <if test="updateby != null" >
        updateby,
      </if>
      <if test="validflag != null" >
        validflag,
      </if>
      <if test="belongid != null" >
        belongid,
      </if>
      <if test="belongname != null" >
        belongname,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        #{id,jdbcType=BIGINT},
      </if>
      <if test="checkcontent != null" >
        #{checkcontent,jdbcType=VARCHAR},
      </if>
      <if test="createtime != null" >
        #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="createby != null" >
        #{createby,jdbcType=VARCHAR},
      </if>
      <if test="updatetime != null" >
        #{updatetime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateby != null" >
        #{updateby,jdbcType=VARCHAR},
      </if>
      <if test="validflag != null" >
        #{validflag,jdbcType=BIT},
      </if>
      <if test="belongid != null" >
        #{belongid,jdbcType=BIGINT},
      </if>
      <if test="belongname != null" >
        #{belongname,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.gk.firework.Domain.HiddenDangerCheckContent" >
    <!--          -->
    update hiddendangercheckcontent
    <set >
      <if test="checkcontent != null" >
        checkcontent = #{checkcontent,jdbcType=VARCHAR},
      </if>
      <if test="createtime != null" >
        createtime = #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="createby != null" >
        createby = #{createby,jdbcType=VARCHAR},
      </if>
      <if test="updatetime != null" >
        updatetime = #{updatetime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateby != null" >
        updateby = #{updateby,jdbcType=VARCHAR},
      </if>
      <if test="validflag != null" >
        validflag = #{validflag,jdbcType=BIT},
      </if>
      <if test="belongid != null" >
        belongid = #{belongid,jdbcType=BIGINT},
      </if>
      <if test="belongname != null" >
        belongname = #{belongname,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.gk.firework.Domain.HiddenDangerCheckContent" >
    <!--          -->
    update hiddendangercheckcontent
    set checkcontent = #{checkcontent,jdbcType=VARCHAR},
      createtime = #{createtime,jdbcType=TIMESTAMP},
      createby = #{createby,jdbcType=VARCHAR},
      updatetime = #{updatetime,jdbcType=TIMESTAMP},
      updateby = #{updateby,jdbcType=VARCHAR},
      validflag = #{validflag,jdbcType=BIT},
      belongid = #{belongid,jdbcType=BIGINT},
      belongname = #{belongname,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>