EntDangerMapper.xml 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="com.zhyc.xps.aqpt.mapper.EntDangerMapper">
  4. <resultMap id="DangerDtoResultMap" type="com.zhyc.xps.aqpt.dto.EntDangerDto">
  5. <result column="oc_id" property="ocId" jdbcType="BIGINT" /><!--单位ID-->
  6. <result column="danger_id" property="dangerId" jdbcType="BIGINT" /><!--隐患ID-->
  7. <result column="danger_source" property="dangerSource" jdbcType="BIGINT" /><!--隐患来源-->
  8. <result column="danger_code" property="dangerCode" jdbcType="VARCHAR" /><!--编码-->
  9. <result column="danger_title" property="dangerTitle" jdbcType="VARCHAR" /><!--标题-->
  10. <result column="danger_desc" property="dangerDesc" jdbcType="VARCHAR" /><!--说明-->
  11. <result column="danger_cat_id" property="dangerCatId" jdbcType="BIGINT" /><!--类别ID-->
  12. <result column="danger_cat_title" property="dangerCatTitle" jdbcType="VARCHAR" />
  13. <result column="danger_level" property="dangerLevel" jdbcType="BIGINT" /><!--隐患级别-->
  14. <result column="danger_deadline" property="dangerDeadLine" jdbcType="DATE" /><!--整改限期-->
  15. <result column="finish_time" property="finishTime" jdbcType="DATE" /><!--最终完成时间-->
  16. <result column="risk_point_id" property="riskPointId" jdbcType="BIGINT" /><!--风险点-->
  17. <result column="risk_point_title" property="riskPointTitle" jdbcType="VARCHAR" />
  18. <result column="hazard_id" property="hazardId" jdbcType="BIGINT" /><!--危险源-->
  19. <result column="hazard_title" property="hazardTitle" jdbcType="VARCHAR" /><!--危险源名称-->
  20. <result column="risk_id" property="riskId" jdbcType="BIGINT" /><!--风险ID-->
  21. <result column="risk_title" property="riskTitle" jdbcType="VARCHAR" /><!--危险源名称-->
  22. <result column="measure_id" property="measureId" jdbcType="BIGINT" /><!--措施ID-->
  23. <result column="submit_group_id" property="submitGroupId" jdbcType="BIGINT" /><!--提交人部门-->
  24. <result column="submit_position_id" property="submitPositionId" jdbcType="BIGINT" /><!--提交人岗位-->
  25. <result column="submit_account_id" property="submitAccountId" jdbcType="BIGINT" /><!--提交人ID-->
  26. <result column="submit_group_name" property="submitGroupName" jdbcType="VARCHAR" /><!--提交人部门名称-->
  27. <result column="submit_position_name" property="submitPositionName" jdbcType="VARCHAR" /><!--提交人岗位名称-->
  28. <result column="submit_account_name" property="submitAccountName" jdbcType="VARCHAR" /><!--提交人名称-->
  29. <result column="submit_time" property="submitTime" jdbcType="DATE" /><!--提交时间-->
  30. <result column="submit_remark" property="submitRemark" jdbcType="VARCHAR" /><!--提交说明-->
  31. <result column="review_group_id" property="reviewGroupId" jdbcType="BIGINT" /><!--Review部门-->
  32. <result column="review_position_id" property="reviewPositionId" jdbcType="BIGINT" /><!--Review岗位-->
  33. <result column="review_account_id" property="reviewAccountId" jdbcType="BIGINT" /><!--ReviewID-->
  34. <result column="review_group_name" property="reviewGroupName" jdbcType="VARCHAR" /><!--Review部门名称-->
  35. <result column="review_position_name" property="reviewPositionName" jdbcType="VARCHAR" /><!--Review岗位名称-->
  36. <result column="review_account_name" property="reviewAccountName" jdbcType="VARCHAR" /><!--Review名称-->
  37. <result column="review_time" property="reviewTime" jdbcType="DATE" /><!--Review时间-->
  38. <result column="review_remark" property="reviewRemark" jdbcType="VARCHAR" /><!--Review意见-->
  39. <result column="rectify_group_id" property="rectifyGroupId" jdbcType="BIGINT" /><!--整改人部门-->
  40. <result column="rectify_position_id" property="rectifyPositionId" jdbcType="BIGINT" /><!--整改人岗位-->
  41. <result column="rectify_account_id" property="rectifyAccountId" jdbcType="BIGINT" /><!--整改人ID-->
  42. <result column="rectify_group_name" property="rectifyGroupName" jdbcType="VARCHAR" /><!--整改人部门名称-->
  43. <result column="rectify_position_name" property="rectifyPositionName" jdbcType="VARCHAR" /><!--整改人岗位名称-->
  44. <result column="rectify_account_name" property="rectifyAccountName" jdbcType="VARCHAR" /><!--整改人名称-->
  45. <result column="rectify_time" property="rectifyTime" jdbcType="DATE" /><!--整改时间-->
  46. <result column="danger_reason" property="dangerReason" jdbcType="VARCHAR" /><!--原因分析-->
  47. <result column="rectify_cat" property="rectifyCat" jdbcType="BIGINT" /><!--整改类别-->
  48. <result column="rectify_measure" property="rectifyMeasure" jdbcType="VARCHAR" /><!--整改措施-->
  49. <result column="rectify_remark" property="rectifyRemark" jdbcType="VARCHAR" /><!--整改说明-->
  50. <result column="accept_group_id" property="acceptGroupId" jdbcType="BIGINT" /><!--验收人部门-->
  51. <result column="accept_position_id" property="acceptPositionId" jdbcType="BIGINT" /><!--验收人岗位-->
  52. <result column="accept_account_id" property="acceptAccountId" jdbcType="BIGINT" /><!--验收人ID-->
  53. <result column="accept_group_name" property="acceptGroupName" jdbcType="VARCHAR" /><!--验收人部门名称-->
  54. <result column="accept_position_name" property="acceptPositionName" jdbcType="VARCHAR" /><!--验收人岗位名称-->
  55. <result column="accept_account_name" property="acceptAccountName" jdbcType="VARCHAR" /><!--验收人名称-->
  56. <result column="accept_time" property="acceptTime" jdbcType="DATE" /><!--验收时间-->
  57. <result column="scene_photo" property="scenePhoto" jdbcType="VARCHAR" /><!--第1个现场照片-->
  58. <result column="scene_icon" property="sceneIcon" jdbcType="VARCHAR" /><!--第1个现场照片缩略图-->
  59. <result column="status" property="status" jdbcType="BIGINT" /><!--状态-->
  60. <result column="accept_remark" property="acceptRemark" jdbcType="VARCHAR" /><!--验收意见-->
  61. <result column="wf_def_id" property="wfDefId" jdbcType="BIGINT" />
  62. <result column="wf_ins_id" property="wfInsId" jdbcType="BIGINT" />
  63. <result column="cur_activity_ins_id" property="curActivityInsId" jdbcType="BIGINT" />
  64. <result column="cur_activity_code" property="curActivityCode" jdbcType="VARCHAR" />
  65. <result column="cur_activity_title" property="curActivityTitle" jdbcType="VARCHAR" />
  66. <result column="cur_activity_begin_time" property="curActivityBeginTime" jdbcType="TIMESTAMP"/>
  67. <result column="cur_form_code" property="curFormCode" jdbcType="VARCHAR" />
  68. <result column="cur_group_id" property="curGroupId" jdbcType="BIGINT" />
  69. <result column="cur_position_id" property="curPositionId" jdbcType="BIGINT" />
  70. <result column="cur_account_id" property="curAccountId" jdbcType="BIGINT" />
  71. <result column="cur_group_name" property="curGroupName" jdbcType="VARCHAR" />
  72. <result column="cur_position_name" property="curPositionName" jdbcType="VARCHAR" />
  73. <result column="cur_account_name" property="curAccountName" jdbcType="VARCHAR" />
  74. </resultMap>
  75. <sql id="DangerDto_Cols">
  76. A.oc_id,
  77. A.danger_id,
  78. A.danger_code,
  79. A.danger_title,
  80. A.danger_cat_id,
  81. B.danger_cat_title,
  82. A.danger_level,
  83. A.danger_deadline,
  84. A.finish_time,
  85. A.danger_source,
  86. A.danger_desc,
  87. A.scene_photo,
  88. A.scene_icon,
  89. A.risk_point_id,
  90. C.risk_point_title,
  91. A.hazard_id,
  92. A.hazard_title,
  93. A.risk_id,
  94. A.risk_title,
  95. A.measure_id,
  96. A.submit_group_id,
  97. A.submit_position_id,
  98. A.submit_account_id,
  99. A.submit_group_name,
  100. A.submit_position_name,
  101. A.submit_account_name,
  102. A.submit_time,
  103. A.submit_remark,
  104. A.review_group_id,
  105. A.review_position_id,
  106. A.review_account_id,
  107. A.review_group_name,
  108. A.review_position_name,
  109. A.review_account_name,
  110. A.review_time,
  111. A.review_remark,
  112. A.rectify_group_id,
  113. A.rectify_position_id,
  114. A.rectify_account_id,
  115. A.rectify_group_name,
  116. A.rectify_position_name,
  117. A.rectify_account_name,
  118. A.rectify_time,
  119. A.danger_reason,
  120. A.rectify_cat,
  121. A.rectify_measure,
  122. A.rectify_remark,
  123. A.status,
  124. A.accept_group_id,
  125. A.accept_position_id,
  126. A.accept_account_id,
  127. A.accept_group_name,
  128. A.accept_position_name,
  129. A.accept_account_name,
  130. A.accept_time,
  131. A.accept_remark,
  132. W.wf_def_id,
  133. W.wf_ins_id,
  134. W.cur_activity_title,
  135. W.cur_activity_code,
  136. W.cur_form_code,
  137. W.cur_activity_ins_id,
  138. W.cur_group_id,
  139. W.cur_activity_begin_time,
  140. W.cur_group_id,
  141. W.cur_group_name,
  142. W.cur_position_id,
  143. W.cur_position_name,
  144. W.cur_account_id,
  145. W.cur_account_name
  146. </sql>
  147. <!--基于ID查询-->
  148. <select id="getById" resultMap="DangerDtoResultMap">
  149. SELECT
  150. <include refid="DangerDto_Cols"/>
  151. FROM ent_danger AS A
  152. LEFT JOIN ent_danger_cat AS B ON (A.oc_id = B.oc_id AND A.danger_cat_id = B.danger_cat_id )
  153. LEFT JOIN ent_risk_point AS C ON (A.oc_id = C.oc_id AND A.risk_point_id = C.risk_point_id )
  154. LEFT JOIN wf_ins AS W ON (A.oc_id = W.oc_id AND A.danger_id = W.wf_ins_id )
  155. WHERE A.deleted_flag = 0 AND A.oc_id = #{ocId ,jdbcType=BIGINT}
  156. <if test="dangerId != null">
  157. AND A.danger_id = #{dangerId ,jdbcType=BIGINT}
  158. </if>
  159. </select>
  160. <!--分页查询-->
  161. <select id="getByPage" parameterType="java.util.Map" resultMap="DangerDtoResultMap">
  162. SELECT
  163. <include refid="DangerDto_Cols"/>
  164. FROM ent_danger AS A
  165. LEFT JOIN ent_danger_cat AS B ON (A.oc_id = B.oc_id AND A.danger_cat_id = B.danger_cat_id )
  166. LEFT JOIN ent_risk_point AS C ON (A.oc_id = C.oc_id AND A.risk_point_id = C.risk_point_id )
  167. LEFT JOIN s_group AS E ON (A.oc_id = E.oc_id AND A.submit_group_id = E.group_id )
  168. LEFT JOIN s_group AS F ON (A.oc_id = F.oc_id AND A.review_group_id = F.group_id )
  169. LEFT JOIN s_group AS G ON (A.oc_id = G.oc_id AND A.rectify_group_id = G.group_id )
  170. LEFT JOIN s_group AS H ON (A.oc_id = H.oc_id AND A.accept_group_id = H.group_id )
  171. LEFT JOIN wf_ins AS W ON (A.oc_id = W.oc_id AND A.danger_id = W.wf_ins_id )
  172. LEFT JOIN s_group AS X ON (W.oc_id = X.oc_id AND W.cur_group_id = X.group_id )
  173. WHERE A.deleted_flag = 0 AND A.oc_id = #{ocId ,jdbcType=BIGINT}
  174. <if test="dangerId != null">
  175. AND A.danger_id = #{dangerId ,jdbcType=BIGINT}
  176. </if>
  177. <if test="dangerCatId != null">
  178. AND A.danger_cat_id = #{dangerCatId ,jdbcType=BIGINT}
  179. </if>
  180. <if test="keywords != null and keywords != ''">
  181. AND A.danger_title like "%"#{keywords}"%"
  182. </if>
  183. <if test="submitAccountId != null">
  184. AND A.submit_account_id = #{submitAccountId ,jdbcType=BIGINT}
  185. </if>
  186. <if test="curAccountId != null">
  187. AND W.cur_account_id = #{curAccountId ,jdbcType=BIGINT}
  188. </if>
  189. <if test="status != null">
  190. AND A.status = #{status ,jdbcType=BIGINT}
  191. </if>
  192. <if test="curGroupNodeLeft != null and curGroupNodeRight != null">
  193. <![CDATA[
  194. AND X.node_left >= #{curGroupNodeLeft, jdbcType=BIGINT}
  195. AND X.node_right <= #{curGroupNodeRight, jdbcType=BIGINT}
  196. ]]>
  197. </if>
  198. <if test="submitGroupNodeLeft != null and submitGroupNodeRight != null">
  199. <![CDATA[
  200. AND E.node_left >= #{submitGroupNodeLeft, jdbcType=BIGINT}
  201. AND E.node_right <= #{submitGroupNodeRight, jdbcType=BIGINT}
  202. ]]>
  203. </if>
  204. <if test="reviewGroupNodeLeft != null and reviewGroupNodeRight != null">
  205. <![CDATA[
  206. AND F.node_left >= #{reviewGroupNodeLeft, jdbcType=BIGINT}
  207. AND F.node_right <= #{reviewGroupNodeRight, jdbcType=BIGINT}
  208. ]]>
  209. </if>
  210. <if test="rectifyGroupNodeLeft != null and rectifyGroupNodeRight != null">
  211. <![CDATA[
  212. AND G.node_left >= #{rectifyGroupNodeLeft, jdbcType=BIGINT}
  213. AND G.node_right <= #{rectifyGroupNodeRight, jdbcType=BIGINT}
  214. ]]>
  215. </if>
  216. <if test="acceptGroupNodeLeft != null and acceptGroupNodeRight != null">
  217. <![CDATA[
  218. AND H.node_left >= #{acceptGroupNodeLeft, jdbcType=BIGINT}
  219. AND H.node_right <= #{acceptGroupNodeRight, jdbcType=BIGINT}
  220. ]]>
  221. </if>
  222. <if test="handleAccountId != null">
  223. AND (
  224. A.review_account_id = #{handleAccountId ,jdbcType=BIGINT}
  225. OR
  226. A.rectify_account_id = #{handleAccountId ,jdbcType=BIGINT}
  227. OR
  228. A.accept_account_id = #{handleAccountId ,jdbcType=BIGINT}
  229. )
  230. </if>
  231. <if test="startSubmitTime != null and endSubmitTime != null">
  232. <![CDATA[
  233. AND A.submit_time >= #{startSubmitTime, jdbcType=TIMESTAMP}
  234. AND A.submit_time <= #{endSubmitTime, jdbcType=TIMESTAMP}
  235. ]]>
  236. </if>
  237. ORDER BY A.submit_time DESC
  238. </select>
  239. <!--列表查询-->
  240. <select id="getByList" parameterType="java.util.Map" resultMap="DangerDtoResultMap">
  241. SELECT
  242. <include refid="DangerDto_Cols"/>
  243. FROM ent_danger AS A
  244. LEFT JOIN ent_danger_cat AS B ON (A.oc_id = B.oc_id AND A.danger_cat_id = B.danger_cat_id )
  245. LEFT JOIN ent_risk_point AS C ON (A.oc_id = C.oc_id AND A.risk_point_id = C.risk_point_id )
  246. LEFT JOIN s_group AS E ON (A.oc_id = E.oc_id AND A.submit_group_id = E.group_id )
  247. LEFT JOIN s_group AS F ON (A.oc_id = F.oc_id AND A.review_group_id = F.group_id )
  248. LEFT JOIN s_group AS G ON (A.oc_id = G.oc_id AND A.rectify_group_id = G.group_id )
  249. LEFT JOIN s_group AS H ON (A.oc_id = H.oc_id AND A.accept_group_id = H.group_id )
  250. LEFT JOIN wf_ins AS W ON (A.oc_id = W.oc_id AND A.danger_id = W.wf_ins_id )
  251. LEFT JOIN s_group AS X ON (W.oc_id = X.oc_id AND W.cur_group_id = X.group_id )
  252. WHERE A.deleted_flag = 0
  253. AND A.oc_id = #{ocId ,jdbcType=BIGINT}
  254. <if test="dangerId != null">
  255. AND A.danger_id = #{dangerId ,jdbcType=BIGINT}
  256. </if>
  257. <if test="dangerCatId != null">
  258. AND A.danger_cat_id = #{dangerCatId ,jdbcType=BIGINT}
  259. </if>
  260. <if test="keywords != null and keywords != ''">
  261. AND A.danger_title like "%"#{keyword}"%"
  262. </if>
  263. <if test="submitAccountId != null">
  264. AND A.submit_account_id = #{submitAccountId ,jdbcType=BIGINT}
  265. </if>
  266. <if test="status != null">
  267. AND A.status = #{status ,jdbcType=BIGINT}
  268. </if>
  269. <if test="curAccountId != null">
  270. AND W.cur_account_id = #{curAccountId ,jdbcType=BIGINT}
  271. </if>
  272. <if test="curGroupNodeLeft != null and curGroupNodeRight != null">
  273. <![CDATA[
  274. AND X.node_left >= #{curGroupNodeLeft, jdbcType=BIGINT}
  275. AND X.node_right <= #{curGroupNodeRight, jdbcType=BIGINT}
  276. ]]>
  277. </if>
  278. <if test="submitGroupNodeLeft != null and submitGroupNodeRight != null">
  279. <![CDATA[
  280. AND E.node_left >= #{submitGroupNodeLeft, jdbcType=BIGINT}
  281. AND E.node_right <= #{submitGroupNodeRight, jdbcType=BIGINT}
  282. ]]>
  283. </if>
  284. <if test="reviewGroupNodeLeft != null and reviewGroupNodeRight != null">
  285. <![CDATA[
  286. AND F.node_left >= #{reviewGroupNodeLeft, jdbcType=BIGINT}
  287. AND F.node_right <= #{reviewGroupNodeRight, jdbcType=BIGINT}
  288. ]]>
  289. </if>
  290. <if test="rectifyGroupNodeLeft != null and rectifyGroupNodeRight != null">
  291. <![CDATA[
  292. AND G.node_left >= #{rectifyGroupNodeLeft, jdbcType=BIGINT}
  293. AND G.node_right <= #{rectifyGroupNodeRight, jdbcType=BIGINT}
  294. ]]>
  295. </if>
  296. <if test="acceptGroupNodeLeft != null and acceptGroupNodeRight != null">
  297. <![CDATA[
  298. AND H.node_left >= #{acceptGroupNodeLeft, jdbcType=BIGINT}
  299. AND H.node_right <= #{acceptGroupNodeRight, jdbcType=BIGINT}
  300. ]]>
  301. </if>
  302. <if test="startSubmitTime != null and endSubmitTime != null">
  303. <![CDATA[
  304. AND A.submit_time >= #{startSubmitTime, jdbcType=TIMESTAMP}
  305. AND A.submit_time <= #{endSubmitTime, jdbcType=TIMESTAMP}
  306. ]]>
  307. </if>
  308. <if test="handleAccountId != null">
  309. AND (
  310. A.review_account_id = #{handleAccountId ,jdbcType=BIGINT}
  311. OR
  312. A.rectify_account_id = #{handleAccountId ,jdbcType=BIGINT}
  313. OR
  314. A.accept_account_id = #{handleAccountId ,jdbcType=BIGINT}
  315. )
  316. </if>
  317. ORDER BY A.submit_time DESC
  318. </select>
  319. <!--新增-->
  320. <insert id="create" parameterType="com.zhyc.xps.aqpt.entity.EntDanger">
  321. INSERT INTO ent_danger
  322. <trim prefix="(" suffix=")" suffixOverrides=",">
  323. <if test="ocId != null">
  324. oc_id,
  325. </if>
  326. <if test="groupId != null">
  327. group_id,
  328. </if>
  329. <if test="dangerId != null">
  330. danger_id,
  331. </if>
  332. <if test="dangerCode != null and dangerCode != ''">
  333. danger_code,
  334. </if>
  335. <if test="dangerTitle != null and dangerTitle != ''">
  336. danger_title,
  337. </if>
  338. <if test="dangerDesc != null and dangerDesc != ''">
  339. danger_desc,
  340. </if>
  341. <if test="dangerCatId != null">
  342. danger_cat_id,
  343. </if>
  344. <if test="dangerLevel!= null">
  345. danger_level,
  346. </if>
  347. <if test="status != null">
  348. status,
  349. </if>
  350. <if test="dangerDeadLine != null">
  351. danger_deadline,
  352. </if>
  353. <if test="submitGroupId != null">
  354. submit_group_id,
  355. </if>
  356. <if test="submitPositionId != null">
  357. submit_position_id,
  358. </if>
  359. <if test="submitAccountId != null">
  360. submit_account_id,
  361. </if>
  362. <if test="submitGroupName != null">
  363. submit_group_name,
  364. </if>
  365. <if test="submitPositionName != null">
  366. submit_position_name,
  367. </if>
  368. <if test="submitAccountName != null">
  369. submit_account_name,
  370. </if>
  371. <if test="submitTime != null">
  372. submit_time,
  373. </if>
  374. <if test="submitRemark != null and submitRemark != ''">
  375. submit_remark,
  376. </if>
  377. <if test="dangerSource != null">
  378. danger_source,
  379. </if>
  380. <if test="riskPointId != null">
  381. risk_point_id,
  382. </if>
  383. <if test="hazardId != null">
  384. hazard_id,
  385. </if>
  386. <if test="hazardTitle != null and hazardTitle != ''">
  387. hazard_title,
  388. </if>
  389. <if test="riskId != null">
  390. risk_id,
  391. </if>
  392. <if test="riskTitle != null and riskTitle != ''">
  393. risk_title,
  394. </if>
  395. <if test="measureId != null">
  396. measure_id,
  397. </if>
  398. <if test="measureContent != null and measureContent!=''">
  399. measure_content,
  400. </if>
  401. <if test="scenePhoto != null and scenePhoto!=''">
  402. scene_photo,
  403. </if>
  404. <if test="sceneIcon != null and sceneIcon!=''">
  405. scene_icon,
  406. </if>
  407. <if test="createdBy != null">
  408. created_by,
  409. </if>
  410. <if test="createdAt != null">
  411. created_at,
  412. </if>
  413. </trim>
  414. <trim prefix="values (" suffix=")" suffixOverrides=",">
  415. <if test="ocId != null">
  416. #{ocId ,jdbcType=BIGINT},
  417. </if>
  418. <if test="groupId != null">
  419. #{groupId ,jdbcType=BIGINT},
  420. </if>
  421. <if test="dangerId != null">
  422. #{dangerId ,jdbcType=BIGINT},
  423. </if>
  424. <if test="dangerCode != null and dangerCode != ''">
  425. #{dangerCode ,jdbcType=VARCHAR},
  426. </if>
  427. <if test="dangerTitle != null and dangerTitle != ''">
  428. #{dangerTitle ,jdbcType=VARCHAR},
  429. </if>
  430. <if test="dangerDesc != null and dangerDesc != ''">
  431. #{dangerDesc ,jdbcType=VARCHAR},
  432. </if>
  433. <if test="dangerCatId != null">
  434. #{dangerCatId ,jdbcType=BIGINT},
  435. </if>
  436. <if test="dangerLevel!= null">
  437. #{dangerLevel ,jdbcType=BIGINT},
  438. </if>
  439. <if test="status != null">
  440. #{status ,jdbcType=BIGINT},
  441. </if>
  442. <if test="dangerDeadLine != null">
  443. #{dangerDeadLine ,jdbcType=DATE},
  444. </if>
  445. <if test="submitGroupId != null">
  446. #{submitGroupId ,jdbcType=BIGINT},
  447. </if>
  448. <if test="submitPositionId != null">
  449. #{submitPositionId ,jdbcType=BIGINT},
  450. </if>
  451. <if test="submitAccountId != null">
  452. #{submitAccountId ,jdbcType=BIGINT},
  453. </if>
  454. <if test="submitGroupName != null">
  455. #{submitGroupName ,jdbcType=VARCHAR},
  456. </if>
  457. <if test="submitPositionName != null">
  458. #{submitPositionName ,jdbcType=VARCHAR},
  459. </if>
  460. <if test="submitAccountName != null">
  461. #{submitAccountName ,jdbcType=VARCHAR},
  462. </if>
  463. <if test="submitTime != null">
  464. #{submitTime ,jdbcType=DATE},
  465. </if>
  466. <if test="submitRemark != null and submitRemark != ''">
  467. #{submitRemark ,jdbcType=VARCHAR},
  468. </if>
  469. <if test="dangerSource != null">
  470. #{dangerSource ,jdbcType=BIGINT},
  471. </if>
  472. <if test="riskPointId != null">
  473. #{riskPointId ,jdbcType=BIGINT},
  474. </if>
  475. <if test="hazardId != null">
  476. #{hazardId ,jdbcType=BIGINT},
  477. </if>
  478. <if test="hazardTitle != null and hazardTitle != ''">
  479. #{hazardTitle ,jdbcType=VARCHAR},
  480. </if>
  481. <if test="riskId != null">
  482. #{riskId ,jdbcType=BIGINT},
  483. </if>
  484. <if test="riskTitle != null and riskTitle != ''">
  485. #{riskTitle ,jdbcType=VARCHAR},
  486. </if>
  487. <if test="measureId != null">
  488. #{measureId ,jdbcType=BIGINT},
  489. </if>
  490. <if test="measureContent != null and measureContent!=''">
  491. #{measureContent ,jdbcType=VARCHAR},
  492. </if>
  493. <if test="scenePhoto != null and scenePhoto!=''">
  494. #{scenePhoto ,jdbcType=VARCHAR},
  495. </if>
  496. <if test="sceneIcon != null and sceneIcon!=''">
  497. #{sceneIcon ,jdbcType=VARCHAR},
  498. </if>
  499. <if test="createdBy != null">
  500. #{createdBy ,jdbcType=BIGINT},
  501. </if>
  502. <if test="createdAt != null">
  503. #{createdAt ,jdbcType=TIMESTAMP},
  504. </if>
  505. </trim>
  506. </insert>
  507. <!--Update-->
  508. <update id="update" parameterType="com.zhyc.xps.aqpt.entity.EntDanger">
  509. UPDATE ent_danger
  510. <trim suffixOverrides=",">
  511. <set>
  512. <if test="groupId != null">
  513. group_id = #{groupId ,jdbcType=BIGINT},
  514. </if>
  515. <if test="dangerCode != null and dangerCode != ''">
  516. danger_code = #{dangerCode ,jdbcType=VARCHAR},
  517. </if>
  518. <if test="dangerTitle != null and dangerTitle != ''">
  519. danger_title = #{dangerTitle, jdbcType=VARCHAR},
  520. </if>
  521. <if test="dangerDesc != null and dangerDesc != ''">
  522. danger_desc = #{dangerDesc, jdbcType=VARCHAR},
  523. </if>
  524. <if test="dangerCatId != null">
  525. danger_cat_id = #{dangerCatId ,jdbcType=BIGINT},
  526. </if>
  527. <if test="dangerLevel!= null">
  528. danger_level = #{dangerLevel ,jdbcType=BIGINT},
  529. </if>
  530. <if test="status != null">
  531. status = #{status ,jdbcType=BIGINT},
  532. </if>
  533. <if test="dangerDeadLine != null">
  534. danger_deadline = #{dangerDeadLine ,jdbcType=DATE},
  535. </if>
  536. <if test="submitGroupId != null">
  537. submit_group_id = #{submitGroupId ,jdbcType=BIGINT},
  538. </if>
  539. <if test="submitPositionId != null">
  540. submit_position_id = #{submitPositionId ,jdbcType=BIGINT},
  541. </if>
  542. <if test="submitAccountId != null">
  543. submit_account_id = #{submitAccountId ,jdbcType=BIGINT},
  544. </if>
  545. <if test="submitGroupName != null and submitGroupName !=''">
  546. submit_group_name = #{submitGroupName ,jdbcType=VARCHAR},
  547. </if>
  548. <if test="submitPositionName != null and submitPositionName != ''">
  549. submit_position_name = #{submitPositionName ,jdbcType=VARCHAR},
  550. </if>
  551. <if test="submitAccountName != null and submitAccountName != ''">
  552. submit_account_name = #{submitAccountName ,jdbcType=VARCHAR},
  553. </if>
  554. <if test="submitTime != null">
  555. submit_time = #{submitTime ,jdbcType=DATE},
  556. </if>
  557. <if test="submitRemark != null and submitRemark != ''">
  558. submit_remark = #{submitRemark ,jdbcType=VARCHAR},
  559. </if>
  560. <if test="reviewGroupId != null">
  561. review_group_id = #{reviewGroupId ,jdbcType=BIGINT},
  562. </if>
  563. <if test="reviewPositionId != null">
  564. review_position_id = #{reviewPositionId ,jdbcType=BIGINT},
  565. </if>
  566. <if test="reviewAccountId != null">
  567. review_account_id = #{reviewAccountId ,jdbcType=BIGINT},
  568. </if>
  569. <if test="reviewGroupName != null and reviewGroupName != ''">
  570. review_group_name = #{reviewGroupName ,jdbcType=VARCHAR},
  571. </if>
  572. <if test="reviewPositionName != null and reviewPositionName !=''">
  573. review_position_name = #{reviewPositionName ,jdbcType=VARCHAR},
  574. </if>
  575. <if test="reviewAccountName != null and reviewAccountName !=''">
  576. review_account_name = #{reviewAccountName ,jdbcType=VARCHAR},
  577. </if>
  578. <if test="reviewTime != null">
  579. review_time = #{reviewTime ,jdbcType=DATE},
  580. </if>
  581. <if test="reviewRemark != null and reviewRemark != ''">
  582. review_remark = #{reviewRemark ,jdbcType=VARCHAR},
  583. </if>
  584. <if test="rectifyGroupId != null">
  585. rectify_group_id = #{rectifyGroupId ,jdbcType=BIGINT},
  586. </if>
  587. <if test="rectifyPositionId != null">
  588. rectify_position_id = #{rectifyPositionId ,jdbcType=BIGINT},
  589. </if>
  590. <if test="rectifyAccountId != null">
  591. rectify_account_id = #{rectifyAccountId ,jdbcType=BIGINT},
  592. </if>
  593. <if test="rectifyGroupName != null and rectifyGroupName !=''">
  594. rectify_group_name = #{rectifyGroupName ,jdbcType=VARCHAR},
  595. </if>
  596. <if test="rectifyPositionName != null and rectifyPositionName !=''">
  597. rectify_position_name = #{rectifyPositionName ,jdbcType=VARCHAR},
  598. </if>
  599. <if test="rectifyAccountName != null and rectifyAccountName !=''">
  600. rectify_account_name = #{rectifyAccountName ,jdbcType=VARCHAR},
  601. </if>
  602. <if test="dangerReason != null and dangerReason != ''">
  603. danger_reason = #{dangerReason, jdbcType=VARCHAR},
  604. </if>
  605. <if test="rectifyCat != null and rectifyCat != ''">
  606. rectify_cat = #{rectifyCat ,jdbcType=BIGINT},
  607. </if>
  608. <if test="rectifyMeasure != null and rectifyMeasure != ''">
  609. rectify_measure = #{rectifyMeasure, jdbcType=VARCHAR},
  610. </if>
  611. <if test="rectifyTime != null">
  612. rectify_time = #{rectifyTime ,jdbcType=DATE},
  613. </if>
  614. <if test="rectifyRemark != null and rectifyRemark != ''">
  615. rectify_remark = #{rectifyRemark, jdbcType=VARCHAR},
  616. </if>
  617. <if test="acceptGroupId != null">
  618. accept_group_id = #{acceptGroupId ,jdbcType=BIGINT},
  619. </if>
  620. <if test="acceptPositionId != null">
  621. accept_position_id = #{acceptPositionId ,jdbcType=BIGINT},
  622. </if>
  623. <if test="acceptAccountId != null">
  624. accept_account_id = #{acceptAccountId ,jdbcType=BIGINT},
  625. </if>
  626. <if test="acceptGroupName != null and acceptGroupName !=''">
  627. accept_group_name = #{acceptGroupName ,jdbcType=VARCHAR},
  628. </if>
  629. <if test="acceptPositionName != null and acceptPositionName !=''">
  630. accept_position_name = #{acceptPositionName ,jdbcType=VARCHAR},
  631. </if>
  632. <if test="acceptAccountName != null and acceptAccountName !=''">
  633. accept_account_name = #{acceptAccountName ,jdbcType=VARCHAR},
  634. </if>
  635. <if test="acceptTime != null">
  636. accept_time = #{acceptTime ,jdbcType=DATE},
  637. </if>
  638. <if test="acceptRemark != null and acceptRemark != ''">
  639. accept_remark = #{acceptRemark ,jdbcType=VARCHAR},
  640. </if>
  641. <if test="scenePhoto != null and scenePhoto!=''">
  642. scene_phone = #{scenePhoto ,jdbcType=VARCHAR},
  643. </if>
  644. <if test="sceneIcon != null and sceneIcon!=''">
  645. scene_icon = #{sceneIcon ,jdbcType=VARCHAR},
  646. </if>
  647. <if test="updatedBy != null ">
  648. updated_by = #{updatedBy ,jdbcType=BIGINT},
  649. </if>
  650. <if test="updatedAt != null">
  651. updated_at = #{updatedAt ,jdbcType=TIMESTAMP},
  652. </if>
  653. </set>
  654. </trim>
  655. WHERE oc_id = #{ocId ,jdbcType=BIGINT}
  656. AND danger_id = #{dangerId ,jdbcType=BIGINT}
  657. </update>
  658. <!--删除-->
  659. <update id="delete" parameterType="java.util.Map">
  660. UPDATE ent_danger
  661. <trim suffixOverrides=",">
  662. <set>
  663. <if test="deletedFlag != null">
  664. deleted_flag = #{deletedFlag ,jdbcType=BIGINT},
  665. </if>
  666. <if test="deletedTime != null">
  667. deleted_time = #{deletedTime ,jdbcType=VARCHAR},
  668. </if>
  669. <if test="deletedBy != null">
  670. deleted_by = #{deletedBy ,jdbcType=BIGINT},
  671. </if>
  672. </set>
  673. </trim>
  674. WHERE oc_id = #{ocId ,jdbcType=BIGINT}
  675. <if test="dangerCatId != null">
  676. AND danger_cat_id = #{dangerCatId ,jdbcType=BIGINT}
  677. </if>
  678. <if test="dangerId != null">
  679. AND danger_id = #{dangerId ,jdbcType=BIGINT}
  680. </if>
  681. </update>
  682. </mapper>