ChkSafeStatListDao.xml 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="cn.com.goldenwater.dcproj.dao.ChkSafeStatListDao">
  6. <resultMap type="cn.com.goldenwater.dcproj.model.ChkSafeStatList" id="chkSafeStatListResultMap">
  7. <result property="id" column="ID" />
  8. <result property="chkIndustry" column="CHK_INDUSTRY" />
  9. <result property="orgId" column="ORG_ID" />
  10. <result property="adCode" column="AD_CODE" />
  11. <result property="chkGroupNum" column="CHK_GROUP_NUM" />
  12. <result property="chkGroupNumUndercover" column="CHK_GROUP_NUM_UNDERCOVER" />
  13. <result property="chkPointNum" column="CHK_POINT_NUM" />
  14. <result property="inspGeneralChk" column="INSP_GENERAL_CHK" />
  15. <result property="inspGeneralRepair" column="INSP_GENERAL_REPAIR" />
  16. <result property="inspMajorChk" column="INSP_MAJOR_CHK" />
  17. <result property="inspMajorRepair" column="INSP_MAJOR_REPAIR" />
  18. <result property="dangerRectFund" column="DANGER_RECT_FUND" />
  19. <result property="crackDownIllegalAction" column="CRACK_DOWN_ILLEGAL_ACTION" />
  20. <result property="repairViolateRuleAction" column="REPAIR_VIOLATE_RULE_ACTION" />
  21. <result property="stopProdRect" column="STOP_PROD_RECT" />
  22. <result property="suspendLicense" column="SUSPEND_LICENSE" />
  23. <result property="shutClampDown" column="SHUT_CLAMP_DOWN" />
  24. <result property="penaltyFine" column="PENALTY_FINE" />
  25. <result property="actbExpsUnit" column="ACTB_EXPS_UNIT" />
  26. <result property="joinPunishTrustBreakEntp" column="JOIN_PUNISH_TRUST_BREAK_ENTP" />
  27. <result property="chkSubmitDttm" column="CHK_SUBMIT_DTTM" />
  28. <result property="chkSubmitDept" column="CHK_SUBMIT_DEPT" />
  29. <result property="auditApprovalPers" column="AUDIT_APPROVAL_PERS" />
  30. <result property="chkSubmitPers" column="CHK_SUBMIT_PERS" />
  31. <result property="contactPers" column="CONTACT_PERS" />
  32. <result property="fillRepoStat" column="FILL_REPO_STAT" />
  33. <result property="note" column="NOTE" />
  34. <result property="persId" column="PERS_ID" />
  35. <result property="intm" column="INTM" />
  36. <result property="uptm" column="UPTM" />
  37. <result property="dataStat" column="DATA_STAT" />
  38. <association property="adName" javaType="java.lang.String" column="{code = AD_CODE}" select="cn.com.goldenwater.dcproj.dao.AttAdBaseDao.getNameByAdCode"></association>
  39. </resultMap>
  40. <!-- 数据库表字段列表 table_columns -->
  41. <sql id="table_columns">
  42. ID,
  43. CHK_INDUSTRY,
  44. ORG_ID,
  45. AD_CODE,
  46. CHK_GROUP_NUM,
  47. CHK_GROUP_NUM_UNDERCOVER,
  48. CHK_POINT_NUM,
  49. INSP_GENERAL_CHK,
  50. INSP_GENERAL_REPAIR,
  51. INSP_MAJOR_CHK,
  52. INSP_MAJOR_REPAIR,
  53. DANGER_RECT_FUND,
  54. CRACK_DOWN_ILLEGAL_ACTION,
  55. REPAIR_VIOLATE_RULE_ACTION,
  56. STOP_PROD_RECT,
  57. SUSPEND_LICENSE,
  58. SHUT_CLAMP_DOWN,
  59. PENALTY_FINE,
  60. ACTB_EXPS_UNIT,
  61. JOIN_PUNISH_TRUST_BREAK_ENTP,
  62. CHK_SUBMIT_DTTM,
  63. CHK_SUBMIT_DEPT,
  64. AUDIT_APPROVAL_PERS,
  65. CHK_SUBMIT_PERS,
  66. CONTACT_PERS,
  67. FILL_REPO_STAT,
  68. NOTE,
  69. PERS_ID,
  70. INTM,
  71. UPTM,
  72. DATA_STAT
  73. </sql>
  74. <!-- 实体类属性 列表 entity_properties -->
  75. <sql id="entity_properties">
  76. #{id},
  77. #{chkIndustry},
  78. #{orgId},
  79. #{adCode},
  80. #{chkGroupNum},
  81. #{chkGroupNumUndercover},
  82. #{chkPointNum},
  83. #{inspGeneralChk},
  84. #{inspGeneralRepair},
  85. #{inspMajorChk},
  86. #{inspMajorRepair},
  87. #{dangerRectFund},
  88. #{crackDownIllegalAction},
  89. #{repairViolateRuleAction},
  90. #{stopProdRect},
  91. #{suspendLicense},
  92. #{shutClampDown},
  93. #{penaltyFine},
  94. #{actbExpsUnit},
  95. #{joinPunishTrustBreakEntp},
  96. #{chkSubmitDttm},
  97. #{chkSubmitDept},
  98. #{auditApprovalPers},
  99. #{chkSubmitPers},
  100. #{contactPers},
  101. #{fillRepoStat},
  102. #{note},
  103. #{persId},
  104. #{intm},
  105. #{uptm},
  106. #{dataStat}
  107. </sql>
  108. <!-- 实体类属性 列表 entity_properties_item for循环使用 -->
  109. <sql id="entity_properties_item">
  110. #{item.id},
  111. #{item.chkIndustry},
  112. #{item.orgId},
  113. #{item.adCode},
  114. #{item.chkGroupNum},
  115. #{item.chkGroupNumUndercover},
  116. #{item.chkPointNum},
  117. #{item.inspGeneralChk},
  118. #{item.inspGeneralRepair},
  119. #{item.inspMajorChk},
  120. #{item.inspMajorRepair},
  121. #{item.dangerRectFund},
  122. #{item.crackDownIllegalAction},
  123. #{item.repairViolateRuleAction},
  124. #{item.stopProdRect},
  125. #{item.suspendLicense},
  126. #{item.shutClampDown},
  127. #{item.penaltyFine},
  128. #{item.actbExpsUnit},
  129. #{item.joinPunishTrustBreakEntp},
  130. #{item.chkSubmitDttm},
  131. #{item.chkSubmitDept},
  132. #{item.auditApprovalPers},
  133. #{item.chkSubmitPers},
  134. #{item.contactPers},
  135. #{item.fillRepoStat},
  136. #{item.note},
  137. #{item.persId},
  138. #{item.intm},
  139. #{item.uptm},
  140. #{item.dataStat}
  141. </sql>
  142. <!-- 查询条件 -->
  143. <sql id="page_where">
  144. <trim prefix="where" prefixOverrides="and | or ">
  145. <if test='chkIndustry != null and chkIndustry != ""'> and CHK_INDUSTRY = #{chkIndustry}</if>
  146. <if test='orgId != null and orgId != ""'> and ORG_ID = #{orgId}</if>
  147. <if test='adCode != null and adCode != ""'> and AD_CODE like '${adCode}%'</if>
  148. <if test='chkGroupNum != null '> and CHK_GROUP_NUM = #{chkGroupNum}</if>
  149. <if test='chkGroupNumUndercover != null '> and CHK_GROUP_NUM_UNDERCOVER = #{chkGroupNumUndercover}</if>
  150. <if test='chkPointNum != null '> and CHK_POINT_NUM = #{chkPointNum}</if>
  151. <if test='inspGeneralChk != null '> and INSP_GENERAL_CHK = #{inspGeneralChk}</if>
  152. <if test='inspGeneralRepair != null '> and INSP_GENERAL_REPAIR = #{inspGeneralRepair}</if>
  153. <if test='inspMajorChk != null '> and INSP_MAJOR_CHK = #{inspMajorChk}</if>
  154. <if test='inspMajorRepair != null '> and INSP_MAJOR_REPAIR = #{inspMajorRepair}</if>
  155. <if test='dangerRectFund != null and dangerRectFund != ""'> and DANGER_RECT_FUND = #{dangerRectFund}</if>
  156. <if test='crackDownIllegalAction != null '> and CRACK_DOWN_ILLEGAL_ACTION = #{crackDownIllegalAction}</if>
  157. <if test='repairViolateRuleAction != null '> and REPAIR_VIOLATE_RULE_ACTION = #{repairViolateRuleAction}</if>
  158. <if test='stopProdRect != null '> and STOP_PROD_RECT = #{stopProdRect}</if>
  159. <if test='suspendLicense != null '> and SUSPEND_LICENSE = #{suspendLicense}</if>
  160. <if test='shutClampDown != null '> and SHUT_CLAMP_DOWN = #{shutClampDown}</if>
  161. <if test='penaltyFine != null and penaltyFine != ""'> and PENALTY_FINE = #{penaltyFine}</if>
  162. <if test='actbExpsUnit != null '> and ACTB_EXPS_UNIT = #{actbExpsUnit}</if>
  163. <if test='joinPunishTrustBreakEntp != null '> and JOIN_PUNISH_TRUST_BREAK_ENTP = #{joinPunishTrustBreakEntp}</if>
  164. <if test='chkSubmitDttm != null '>and DATE_FORMAT(CHK_SUBMIT_DTTM,'%Y-%m-%d') = DATE_FORMAT(#{chkSubmitDttm},'%Y-%m-%d')</if>
  165. <if test='chkSubmitDept != null and chkSubmitDept != ""'> and CHK_SUBMIT_DEPT LIKE '%${chkSubmitDept}%'</if>
  166. <if test='auditApprovalPers != null and auditApprovalPers != ""'> and AUDIT_APPROVAL_PERS = #{auditApprovalPers}</if>
  167. <if test='chkSubmitPers != null and chkSubmitPers != ""'> and CHK_SUBMIT_PERS = #{chkSubmitPers}</if>
  168. <if test='contactPers != null and contactPers != ""'> and CONTACT_PERS = #{contactPers}</if>
  169. <if test='fillRepoStat != null and fillRepoStat != ""'> and FILL_REPO_STAT = #{fillRepoStat}</if>
  170. <if test='note != null and note != ""'> and NOTE = #{note}</if>
  171. <if test='persId != null and persId != ""'> and PERS_ID = #{persId}</if>
  172. <if test='intm != null '> and DATE_FORMAT(INTM,'%Y-%m-%d') = DATE_FORMAT(#{intm},'%Y-%m-%d') </if>
  173. <if test='uptm != null '> and DATE_FORMAT(UPTM,'%Y-%m-%d') = DATE_FORMAT(#{uptm},'%Y-%m-%d') </if>
  174. and DATA_STAT = '0'
  175. </trim>
  176. </sql>
  177. <!-- 根据Id查询 -->
  178. <select id="get" resultMap="chkSafeStatListResultMap" parameterType="String">
  179. select
  180. <include refid="table_columns"/>
  181. from CHK_SAFE_STAT_LIST where ID = #{id}
  182. </select>
  183. <!-- 根据条件筛选查询 -->
  184. <select id="getBy" resultMap="chkSafeStatListResultMap" parameterType="cn.com.goldenwater.dcproj.param.ChkSafeStatListParam">
  185. select
  186. <include refid="table_columns"/>
  187. from CHK_SAFE_STAT_LIST
  188. <include refid="page_where"/>
  189. </select>
  190. <!-- 查询所有 -->
  191. <select id="findAll" resultMap="chkSafeStatListResultMap">
  192. select
  193. <include refid="table_columns"/>
  194. from CHK_SAFE_STAT_LIST
  195. </select>
  196. <!-- 根据条件筛选 查询所有 -->
  197. <select id="findList" resultMap="chkSafeStatListResultMap" parameterType="cn.com.goldenwater.dcproj.param.ChkSafeStatListParam">
  198. select
  199. <include refid="table_columns"/>
  200. from CHK_SAFE_STAT_LIST
  201. <include refid="page_where"/>
  202. </select>
  203. <!-- 根据条件筛选 统计记录数 -->
  204. <select id="selectCount" resultType="int" parameterType="cn.com.goldenwater.dcproj.param.ChkSafeStatListParam">
  205. select count( ID ) from CHK_SAFE_STAT_LIST
  206. <include refid="page_where"/>
  207. </select>
  208. <!-- 添加 -->
  209. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.ChkSafeStatList" >
  210. insert into CHK_SAFE_STAT_LIST(
  211. <include refid="table_columns"/>
  212. )
  213. values (
  214. <include refid="entity_properties"/>
  215. )
  216. </insert>
  217. <!-- 批量添加 -->
  218. <insert id="insertBatchFile" parameterType="java.util.List" useGeneratedKeys="false">
  219. insert into CHK_SAFE_STAT_LIST
  220. (<include refid="table_columns"/>) values
  221. <foreach item="item" index="index" collection="list" separator=",">
  222. (<include refid="entity_properties_item"/>)
  223. </foreach>
  224. </insert>
  225. <!-- 主键删除 -->
  226. <delete id="delete" parameterType="java.lang.String">
  227. update CHK_SAFE_STAT_LIST set DATA_STAT='9' where ID = #{id}
  228. </delete>
  229. <!-- 条件删除 -->
  230. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.ChkSafeStatList">
  231. update CHK_SAFE_STAT_LIST set DATA_STAT='9'
  232. <include refid="page_where"/>
  233. </delete>
  234. <!-- 逻辑删除 -->
  235. <update id="deleteInFlag" parameterType="java.lang.String">
  236. update CHK_SAFE_STAT_LIST set DATA_STAT = '9' where ID = #{id}
  237. </update>
  238. <!-- 主键更新 -->
  239. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.ChkSafeStatList">
  240. update CHK_SAFE_STAT_LIST
  241. <trim prefix="SET" suffixOverrides=",">
  242. <if test='chkIndustry != null'>CHK_INDUSTRY = #{chkIndustry},</if>
  243. <if test='orgId != null'>ORG_ID = #{orgId},</if>
  244. <if test='adCode != null'>AD_CODE = #{adCode},</if>
  245. <if test='chkGroupNum != null'>CHK_GROUP_NUM = #{chkGroupNum},</if>
  246. <if test='chkGroupNumUndercover != null'>CHK_GROUP_NUM_UNDERCOVER = #{chkGroupNumUndercover},</if>
  247. <if test='chkPointNum != null'>CHK_POINT_NUM = #{chkPointNum},</if>
  248. <if test='inspGeneralChk != null'>INSP_GENERAL_CHK = #{inspGeneralChk},</if>
  249. <if test='inspGeneralRepair != null'>INSP_GENERAL_REPAIR = #{inspGeneralRepair},</if>
  250. <if test='inspMajorChk != null'>INSP_MAJOR_CHK = #{inspMajorChk},</if>
  251. <if test='inspMajorRepair != null'>INSP_MAJOR_REPAIR = #{inspMajorRepair},</if>
  252. <if test='dangerRectFund != null'>DANGER_RECT_FUND = #{dangerRectFund},</if>
  253. <if test='crackDownIllegalAction != null'>CRACK_DOWN_ILLEGAL_ACTION = #{crackDownIllegalAction},</if>
  254. <if test='repairViolateRuleAction != null'>REPAIR_VIOLATE_RULE_ACTION = #{repairViolateRuleAction},</if>
  255. <if test='stopProdRect != null'>STOP_PROD_RECT = #{stopProdRect},</if>
  256. <if test='suspendLicense != null'>SUSPEND_LICENSE = #{suspendLicense},</if>
  257. <if test='shutClampDown != null'>SHUT_CLAMP_DOWN = #{shutClampDown},</if>
  258. <if test='penaltyFine != null'>PENALTY_FINE = #{penaltyFine},</if>
  259. <if test='actbExpsUnit != null'>ACTB_EXPS_UNIT = #{actbExpsUnit},</if>
  260. <if test='joinPunishTrustBreakEntp != null'>JOIN_PUNISH_TRUST_BREAK_ENTP = #{joinPunishTrustBreakEntp},</if>
  261. <if test='chkSubmitDttm != null'>CHK_SUBMIT_DTTM = #{chkSubmitDttm},</if>
  262. <if test='chkSubmitDept != null'>CHK_SUBMIT_DEPT = #{chkSubmitDept},</if>
  263. <if test='auditApprovalPers != null'>AUDIT_APPROVAL_PERS = #{auditApprovalPers},</if>
  264. <if test='chkSubmitPers != null'>CHK_SUBMIT_PERS = #{chkSubmitPers},</if>
  265. <if test='contactPers != null'>CONTACT_PERS = #{contactPers},</if>
  266. <if test='note != null'>NOTE = #{note},</if>
  267. <if test='uptm != null'>UPTM = #{uptm},</if>
  268. <if test='dataStat != null'>DATA_STAT = #{dataStat},</if>
  269. </trim>
  270. where ID = #{id}
  271. </update>
  272. <!-- 条件更新 -->
  273. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.ChkSafeStatList">
  274. update CHK_SAFE_STAT_LIST
  275. <trim prefix="SET" suffixOverrides=",">
  276. <if test='chkIndustry != null'>CHK_INDUSTRY = #{chkIndustry},</if>
  277. <if test='orgId != null'>ORG_ID = #{orgId},</if>
  278. <if test='adCode != null'>AD_CODE = #{adCode},</if>
  279. <if test='chkGroupNum != null'>CHK_GROUP_NUM = #{chkGroupNum},</if>
  280. <if test='chkGroupNumUndercover != null'>CHK_GROUP_NUM_UNDERCOVER = #{chkGroupNumUndercover},</if>
  281. <if test='chkPointNum != null'>CHK_POINT_NUM = #{chkPointNum},</if>
  282. <if test='inspGeneralChk != null'>INSP_GENERAL_CHK = #{inspGeneralChk},</if>
  283. <if test='inspGeneralRepair != null'>INSP_GENERAL_REPAIR = #{inspGeneralRepair},</if>
  284. <if test='inspMajorChk != null'>INSP_MAJOR_CHK = #{inspMajorChk},</if>
  285. <if test='inspMajorRepair != null'>INSP_MAJOR_REPAIR = #{inspMajorRepair},</if>
  286. <if test='dangerRectFund != null'>DANGER_RECT_FUND = #{dangerRectFund},</if>
  287. <if test='crackDownIllegalAction != null'>CRACK_DOWN_ILLEGAL_ACTION = #{crackDownIllegalAction},</if>
  288. <if test='repairViolateRuleAction != null'>REPAIR_VIOLATE_RULE_ACTION = #{repairViolateRuleAction},</if>
  289. <if test='stopProdRect != null'>STOP_PROD_RECT = #{stopProdRect},</if>
  290. <if test='suspendLicense != null'>SUSPEND_LICENSE = #{suspendLicense},</if>
  291. <if test='shutClampDown != null'>SHUT_CLAMP_DOWN = #{shutClampDown},</if>
  292. <if test='penaltyFine != null'>PENALTY_FINE = #{penaltyFine},</if>
  293. <if test='actbExpsUnit != null'>ACTB_EXPS_UNIT = #{actbExpsUnit},</if>
  294. <if test='joinPunishTrustBreakEntp != null'>JOIN_PUNISH_TRUST_BREAK_ENTP = #{joinPunishTrustBreakEntp},</if>
  295. <if test='chkSubmitDttm != null'>CHK_SUBMIT_DTTM = #{chkSubmitDttm},</if>
  296. <if test='chkSubmitDept != null'>CHK_SUBMIT_DEPT = #{chkSubmitDept},</if>
  297. <if test='auditApprovalPers != null'>AUDIT_APPROVAL_PERS = #{auditApprovalPers},</if>
  298. <if test='chkSubmitPers != null'>CHK_SUBMIT_PERS = #{chkSubmitPers},</if>
  299. <if test='contactPers != null'>CONTACT_PERS = #{contactPers},</if>
  300. <if test='note != null'>NOTE = #{note},</if>
  301. <if test='uptm != null'>UPTM = #{uptm},</if>
  302. <if test='dataStat != null'>DATA_STAT = #{dataStat},</if>
  303. </trim>
  304. <include refid="page_where"/>
  305. </update>
  306. <!-- 其他自定义SQL -->
  307. <!-- 批量上报 -->
  308. <update id="batchReportByIds" >
  309. update CHK_SAFE_STAT_LIST
  310. set FILL_REPO_STAT = '2', UPTM = #{uptm}
  311. where FILL_REPO_STAT = '1' and ID in
  312. <foreach item="id" collection="ids" open="(" separator="," close=")">
  313. #{id}
  314. </foreach>
  315. </update>
  316. <resultMap type="cn.com.goldenwater.dcproj.model.ChkSafeStatList" id="countTotalMap">
  317. <result property="chkIndustry" column="CHK_INDUSTRY" />
  318. <result property="orgId" column="ORG_ID" />
  319. <result property="adCode" column="AD_CODE" />
  320. <result property="chkGroupNum" column="CHK_GROUP_NUM" />
  321. <result property="chkGroupNumUndercover" column="CHK_GROUP_NUM_UNDERCOVER" />
  322. <result property="chkPointNum" column="CHK_POINT_NUM" />
  323. <result property="inspGeneralChk" column="INSP_GENERAL_CHK" />
  324. <result property="inspGeneralRepair" column="INSP_GENERAL_REPAIR" />
  325. <result property="inspMajorChk" column="INSP_MAJOR_CHK" />
  326. <result property="inspMajorRepair" column="INSP_MAJOR_REPAIR" />
  327. <result property="dangerRectFund" column="DANGER_RECT_FUND" />
  328. <result property="crackDownIllegalAction" column="CRACK_DOWN_ILLEGAL_ACTION" />
  329. <result property="repairViolateRuleAction" column="REPAIR_VIOLATE_RULE_ACTION" />
  330. <result property="stopProdRect" column="STOP_PROD_RECT" />
  331. <result property="suspendLicense" column="SUSPEND_LICENSE" />
  332. <result property="shutClampDown" column="SHUT_CLAMP_DOWN" />
  333. <result property="penaltyFine" column="PENALTY_FINE" />
  334. <result property="actbExpsUnit" column="ACTB_EXPS_UNIT" />
  335. <result property="joinPunishTrustBreakEntp" column="JOIN_PUNISH_TRUST_BREAK_ENTP" />
  336. <result property="chkSubmitDttm" column="CHK_SUBMIT_DTTM" />
  337. <result property="chkSubmitDept" column="CHK_SUBMIT_DEPT" />
  338. <result property="auditApprovalPers" column="AUDIT_APPROVAL_PERS" />
  339. <result property="chkSubmitPers" column="CHK_SUBMIT_PERS" />
  340. <result property="contactPers" column="CONTACT_PERS" />
  341. <result property="fillRepoStat" column="FILL_REPO_STAT" />
  342. </resultMap>
  343. <!-- 按行业(领域) 进行分类统计 -->
  344. <select id="countTotalByIndustry" resultMap="countTotalMap" parameterType="cn.com.goldenwater.dcproj.param.ChkSafeStatListParam">
  345. select cssli.id as CHK_INDUSTRY ,
  346. IFNULL(cssl.CHK_GROUP_NUM , 0) as CHK_GROUP_NUM,
  347. IFNULL(cssl.CHK_GROUP_NUM_UNDERCOVER, 0) as CHK_GROUP_NUM_UNDERCOVER,
  348. IFNULL(cssl.CHK_POINT_NUM , 0) as CHK_POINT_NUM,
  349. IFNULL(cssl.INSP_GENERAL_CHK , 0) as INSP_GENERAL_CHK,
  350. IFNULL(cssl.INSP_GENERAL_REPAIR , 0) as INSP_GENERAL_REPAIR,
  351. IFNULL(cssl.INSP_MAJOR_CHK , 0) as INSP_MAJOR_CHK,
  352. IFNULL(cssl.INSP_MAJOR_REPAIR , 0) as INSP_MAJOR_REPAIR,
  353. IFNULL(cssl.DANGER_RECT_FUND , 0) as DANGER_RECT_FUND,
  354. IFNULL(cssl.CRACK_DOWN_ILLEGAL_ACTION , 0) as CRACK_DOWN_ILLEGAL_ACTION,
  355. IFNULL(cssl.REPAIR_VIOLATE_RULE_ACTION , 0) as REPAIR_VIOLATE_RULE_ACTION,
  356. IFNULL(cssl.STOP_PROD_RECT , 0) as STOP_PROD_RECT,
  357. IFNULL(cssl.SUSPEND_LICENSE , 0) as SUSPEND_LICENSE,
  358. IFNULL(cssl.SHUT_CLAMP_DOWN , 0) as SHUT_CLAMP_DOWN,
  359. IFNULL(cssl.PENALTY_FINE , 0) as PENALTY_FINE,
  360. IFNULL(cssl.ACTB_EXPS_UNIT , 0) as ACTB_EXPS_UNIT,
  361. IFNULL(cssl.JOIN_PUNISH_TRUST_BREAK_ENTP , 0) as JOIN_PUNISH_TRUST_BREAK_ENTP
  362. from chk_safe_stat_list_industry cssli
  363. left join (
  364. select CHK_INDUSTRY ,
  365. sum(CHK_GROUP_NUM) as CHK_GROUP_NUM,
  366. sum(CHK_GROUP_NUM_UNDERCOVER ) as CHK_GROUP_NUM_UNDERCOVER,
  367. sum(CHK_POINT_NUM) as CHK_POINT_NUM,
  368. sum(INSP_GENERAL_CHK) as INSP_GENERAL_CHK,
  369. sum(INSP_GENERAL_REPAIR) as INSP_GENERAL_REPAIR,
  370. sum(INSP_MAJOR_CHK) as INSP_MAJOR_CHK,
  371. sum(INSP_MAJOR_REPAIR) as INSP_MAJOR_REPAIR,
  372. SUM(IF('' = DANGER_RECT_FUND , 0, CAST(DANGER_RECT_FUND AS DECIMAL(11,4) ) ) ) as DANGER_RECT_FUND,
  373. sum(CRACK_DOWN_ILLEGAL_ACTION) as CRACK_DOWN_ILLEGAL_ACTION,
  374. sum(REPAIR_VIOLATE_RULE_ACTION) as REPAIR_VIOLATE_RULE_ACTION,
  375. sum(STOP_PROD_RECT) as STOP_PROD_RECT,
  376. sum(SUSPEND_LICENSE) as SUSPEND_LICENSE,
  377. sum(SHUT_CLAMP_DOWN) as SHUT_CLAMP_DOWN,
  378. SUM(IF('' = PENALTY_FINE , 0, CAST(PENALTY_FINE AS DECIMAL(11,4) ) ) ) as PENALTY_FINE,
  379. sum(ACTB_EXPS_UNIT) as ACTB_EXPS_UNIT,
  380. sum(JOIN_PUNISH_TRUST_BREAK_ENTP) as JOIN_PUNISH_TRUST_BREAK_ENTP
  381. from chk_safe_stat_list
  382. <include refid="page_where"/>
  383. group by CHK_INDUSTRY ) cssl on cssl.CHK_INDUSTRY = cssli.ID
  384. order by cssli.ORDR
  385. </select>
  386. </mapper>