TacProvincePblmInfoDao.xml 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674
  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="cn.com.goldenwater.dcproj.dao.TacProvincePblmInfoDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.TacProvincePblmInfo" id="tacProvincePblmInfoResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="objType" column="OBJ_TYPE"/>
  7. <result property="objId" column="OBJ_ID"/>
  8. <result property="pblmNm" column="PBLM_NM"/>
  9. <result property="pblmPasi" column="PBLM_PASI"/>
  10. <result property="ifCasePblm" column="IF_CASE_PBLM"/>
  11. <result property="subjectIds" column="SUBJECT_IDS"/>
  12. <result property="subjectNames" column="SUBJECT_NAMES"/>
  13. <result property="pblmDesc" column="PBLM_DESC" />
  14. <result property="pblmReason" column="PBLM_REASON"/>
  15. <result property="pblmSggtn" column="PBLM_SGGTN"/>
  16. <result property="pblmSn" column="PBLM_SN"/>
  17. <result property="pblmstdId" column="PBLMSTD_ID"/>
  18. <result property="rectId" column="RECT_ID"/>
  19. <result property="rgstrId" column="RGSTR_ID"/>
  20. <result property="listType" column="LIST_TYPE"/>
  21. <result property="listId" column="LIST_ID"/>
  22. <result property="hasVedio" column="HAS_VEDIO"/>
  23. <result property="groupId" column="GROUP_ID"/>
  24. <result property="persId" column="PERS_ID"/>
  25. <result property="persNm" column="PERS_NM"/>
  26. <result property="intm" column="INTM"/>
  27. <result property="spclId" column="SPCL_ID"/>
  28. <result property="spclNm" column="SPCL_NM"/>
  29. <result property="spclRvwOptn" column="SPCL_RVW_OPTN"/>
  30. <result property="spclTm" column="SPCL_TM"/>
  31. <result property="uptm" column="UPTM"/>
  32. <result property="note" column="NOTE"/>
  33. <result property="pblmQlttvCd" column="PBLM_QLTTV_CD"/>
  34. <result property="pblmQlttvNm" column="PBLM_QLTTV_NM"/>
  35. <result property="isCpQa" column="IS_CP_QA"/>
  36. <result property="pblmTypeDesc" column="PBLM_TYPE_DESC"/>
  37. <result property="taskId" column="TASK_ID"/>
  38. <result property="stepId" column="STEP_ID"/>
  39. <result property="oldPblmId" column="old_pblm_id"/>
  40. <result property="state" column="STATE"/>
  41. <result property="province" column="PROVINCE"/>
  42. <result property="sn" column="SN"/>
  43. <result property="pblmRevision" column="PBLM_REVISION"/>
  44. <result property="pblmRevisionProof" column="PBLM_REVISION_PROOF"/>
  45. <result property="pblmMendNote" column="PBLM_MEND_NOTE"/>
  46. <result property="pblmMendState" column="PBLM_MEND_STATE"/>
  47. <result property="pblmMendPersNm" column="PBLM_MEND_PERS_NM"/>
  48. <result property="pblmMendPersId" column="PBLM_MEND_PERS_ID"/>
  49. <result property="pblmMendTm" column="PBLM_MEND_TM"/>
  50. <result property="isPoverty" column="IS_POVERTY"/>
  51. <result property="relativeLaw" column="RELATIVE_LAW"/>
  52. <result property="lawContent" column="LAW_CONTENT"/>
  53. </resultMap>
  54. <sql id="table_columns">
  55. ID,STEP_ID,old_pblm_id,STATE,PROVINCE,SN,
  56. OBJ_TYPE,
  57. OBJ_ID,
  58. PBLM_NM,
  59. PBLM_PASI,
  60. IF_CASE_PBLM,
  61. SUBJECT_IDS,
  62. SUBJECT_NAMES,
  63. PBLM_DESC,
  64. PBLM_REASON,
  65. PBLM_SGGTN,
  66. PBLM_SN,
  67. PBLMSTD_ID,
  68. RECT_ID,
  69. RGSTR_ID,
  70. LIST_TYPE,
  71. LIST_ID,
  72. HAS_VEDIO,
  73. GROUP_ID,
  74. PERS_ID,
  75. PERS_NM,
  76. INTM,
  77. SPCL_ID,
  78. SPCL_NM,
  79. SPCL_RVW_OPTN,
  80. SPCL_TM,
  81. UPTM,
  82. NOTE,
  83. PBLM_QLTTV_CD,
  84. PBLM_QLTTV_NM,
  85. IS_CP_QA,
  86. PBLM_TYPE_DESC,
  87. TASK_ID,
  88. PBLM_REVISION,
  89. PBLM_REVISION_PROOF,
  90. PBLM_MEND_NOTE,
  91. PBLM_MEND_STATE,
  92. PBLM_MEND_PERS_NM,
  93. PBLM_MEND_PERS_ID,
  94. PBLM_MEND_TM,
  95. RELATIVE_LAW,
  96. LAW_CONTENT
  97. </sql>
  98. <sql id="entity_properties">
  99. #{id},#{stepId},#{oldPblmId},#{state},#{province},#{sn},
  100. #{objType},
  101. #{objId},
  102. #{pblmNm},
  103. #{pblmPasi},
  104. #{ifCasePblm},
  105. #{subjectIds},
  106. #{subjectNames},
  107. #{pblmDesc},
  108. #{pblmReason},
  109. #{pblmSggtn},
  110. #{pblmSn},
  111. #{pblmstdId},
  112. #{rectId},
  113. #{rgstrId},
  114. #{listType},
  115. #{listId},
  116. #{hasVedio},
  117. #{groupId},
  118. #{persId},
  119. #{persNm},
  120. #{intm},
  121. #{spclId},
  122. #{spclNm},
  123. #{spclRvwOptn},
  124. #{spclTm},
  125. #{uptm},
  126. #{note},
  127. #{pblmQlttvCd},
  128. #{pblmQlttvNm},
  129. #{isCpQa},
  130. #{pblmTypeDesc},
  131. #{taskId},
  132. #{pblmRevision},
  133. #{pblmRevisionProof},
  134. #{pblmMendNote},
  135. #{pblmMendState},
  136. #{pblmMendPersNm},
  137. #{pblmMendPersId},
  138. #{pblmMendTm},
  139. #{relativeLaw},
  140. #{lawContent}
  141. </sql>
  142. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  143. <sql id="page_where">
  144. <trim prefix="where" prefixOverrides="and | or ">
  145. <if test="objType != null and objType != ''">and OBJ_TYPE = #{objType}</if>
  146. <if test="objId != null and objId != ''">and OBJ_ID = #{objId}</if>
  147. <if test="stepId != null and stepId != ''">and STEP_ID = #{stepId}</if>
  148. <if test="pblmNm != null and pblmNm != ''">and PBLM_NM like '%${pblmNm}%'</if>
  149. <if test="pblmPasi != null and pblmPasi != ''">and PBLM_PASI = #{pblmPasi}</if>
  150. <if test="ifCasePblm != null and ifCasePblm != ''">and IF_CASE_PBLM = #{ifCasePblm}</if>
  151. <if test="subjectIds != null and subjectIds != ''">and SUBJECT_IDS = #{subjectIds}</if>
  152. <if test="subjectNames != null and subjectNames != ''">and SUBJECT_NAMES = #{subjectNames}</if>
  153. <if test="pblmDesc != null and pblmDesc != ''">and PBLM_DESC = #{pblmDesc}</if>
  154. <if test="pblmReason != null and pblmReason != ''">and PBLM_REASON = #{pblmReason}</if>
  155. <if test="pblmSggtn != null and pblmSggtn != ''">and PBLM_SGGTN = #{pblmSggtn}</if>
  156. <if test="pblmSn != null and pblmSn != ''">and PBLM_SN = #{pblmSn}</if>
  157. <if test="pblmstdId != null and pblmstdId != ''">and PBLMSTD_ID = #{pblmstdId}</if>
  158. <if test="rectId != null and rectId != ''">and RECT_ID = #{rectId}</if>
  159. <if test="rgstrId != null and rgstrId != ''">and RGSTR_ID = #{rgstrId}</if>
  160. <if test="listType != null and listType != ''">and LIST_TYPE = #{listType}</if>
  161. <if test="listId != null and listId != ''">and LIST_ID = #{listId}</if>
  162. <if test="hasVedio != null and hasVedio != ''">and HAS_VEDIO = #{hasVedio}</if>
  163. <if test="groupId != null and groupId != ''">and GROUP_ID = #{groupId}</if>
  164. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  165. <if test="persNm != null and persNm != ''">and PERS_NM = #{persNm}</if>
  166. <if test="intm != null">and INTM = #{intm}</if>
  167. <if test="spclId != null and spclId != ''">and SPCL_ID = #{spclId}</if>
  168. <if test="spclNm != null and spclNm != ''">and SPCL_NM = #{spclNm}</if>
  169. <if test="spclRvwOptn != null and spclRvwOptn != ''">and SPCL_RVW_OPTN = #{spclRvwOptn}</if>
  170. <if test="spclTm != null">and SPCL_TM = #{spclTm}</if>
  171. <if test="uptm != null">and UPTM = #{uptm}</if>
  172. <if test="note != null and note != ''">and NOTE = #{note}</if>
  173. <if test="pblmQlttvCd != null and pblmQlttvCd != ''">and PBLM_QLTTV_CD = #{pblmQlttvCd}</if>
  174. <if test="pblmQlttvNm != null and pblmQlttvNm != ''">and PBLM_QLTTV_NM = #{pblmQlttvNm}</if>
  175. <if test="isCpQa != null and isCpQa != ''">and IS_CP_QA = #{isCpQa}</if>
  176. <if test="pblmTypeDesc != null and pblmTypeDesc != ''">and PBLM_TYPE_DESC = #{pblmTypeDesc}</if>
  177. <if test="taskId != null and taskId != ''">and TASK_ID = #{taskId}</if>
  178. <if test="pblmRevision != null and pblmRevision != ''">and PBLM_REVISION = #{pblmRevision}</if>
  179. <if test="pblmRevisionProof != null and pblmRevisionProof != ''">and PBLM_REVISION_PROOF = #{pblmRevisionProof}</if>
  180. <if test="pblmMendNote != null and pblmMendNote != ''">and PBLM_MEND_NOTE = #{pblmMendNote}</if>
  181. <if test="pblmMendState != null and pblmMendState != ''">and PBLM_MEND_STATE = #{pblmMendState}</if>
  182. <if test="pblmMendPersNm != null and pblmMendPersNm != ''">and PBLM_MEND_PERS_NM = #{pblmMendPersNm}</if>
  183. <if test="pblmMendPersId != null and pblmMendPersId != ''">and PBLM_MEND_PERS_ID = #{pblmMendPersId}</if>
  184. <if test="pblmMendTm != null and pblmMendTm != ''">and PBLM_MEND_TM = #{pblmMendTm}</if>
  185. <if test="relativeLaw != null and relativeLaw != ''">and RELATIVE_LAW like '%${relativeLaw}%'</if>
  186. <if test="lawContent != null and lawContent != ''">and LAW_CONTENT like '%${lawContent}%' </if>
  187. </trim>
  188. </sql>
  189. <select id="get" resultMap="tacProvincePblmInfoResultMap" parameterType="String" >
  190. select <include refid="table_columns" /> from TAC_PROVINCE_PBLM_INFO where ID = #{id}
  191. </select>
  192. <select id="getBy" resultMap="tacProvincePblmInfoResultMap">
  193. select <include refid="table_columns" /> from TAC_PROVINCE_PBLM_INFO <include refid="page_where" />
  194. </select>
  195. <select id="findAll" resultMap="tacProvincePblmInfoResultMap">
  196. select <include refid="table_columns" /> from TAC_PROVINCE_PBLM_INFO
  197. </select>
  198. <select id="findPageJieduanInfo" resultMap="tacProvincePblmInfoResultMap">
  199. select t.*,r.location,r.name,r.ad_code,r.IS_POVERTY
  200. from TAC_PROVINCE_PBLM_INFO t,TAC_PAWP_RGSTR r ,TAC_INSP_YEAR_BATCH_OBJ o
  201. where r.id=t.rgstr_id and o.id = t.obj_id
  202. <include refid="jieduanSql"/>
  203. order by t.rgstr_id, t.list_type asc, t.pblm_pasi desc, t.SN ASC
  204. </select>
  205. <select id="finalResults" resultType="cn.com.goldenwater.dcproj.model.TacProvincePblmInfoReDto">
  206. select
  207. t.*,
  208. r.name objName,
  209. r.location,
  210. r.ad_code adcodecounty
  211. from TAC_PBLM_INFO t
  212. left join TAC_PAWP_RGSTR r on r.id = t.rgstr_id
  213. left join TAC_INSP_YEAR_BATCH_OBJ o on o.id = r.OBJ_ID
  214. where 1=1
  215. <!--<if test="stepId != null and stepId != ''">and t.STEP_ID = #{stepId}</if>-->
  216. <if test="objName != null and objName != ''">and r.name like '%${objName}%'</if>
  217. <if test="year != null and year != ''">and o.YEAR = #{year}</if>
  218. <if test="pblmNm != null and pblmNm != ''">and t.PBLM_NM like '%${pblmNm}%' </if>
  219. <if test="listType != null and listType != ''">and t.LIST_TYPE = #{listType}</if>
  220. <if test="pblmPasi != null and pblmPasi != ''">and t.PBLM_PASI = #{pblmPasi}</if>
  221. <if test="adCode != null and adCode != ''">and r.AD_CODE like '${adCode}%' </if>
  222. order by t.intm desc
  223. </select>
  224. <sql id="jieduanSql">
  225. <if test="rgstrId != null and rgstrId != ''">and t.RGSTR_ID like '${rgstrId}%'</if>
  226. <include refid="mySearch"/>
  227. </sql>
  228. <sql id="mySearch">
  229. <if test="year != null and year != ''">and o.YEAR = #{year}</if>
  230. <if test="batch != null and batch != ''">and o.BATCH = #{batch}</if>
  231. <if test="listType != null and listType != ''">and t.LIST_TYPE = #{listType}</if>
  232. <if test="hasVedio != null and hasVedio != ''">and t.HAS_VEDIO = #{hasVedio}</if>
  233. <if test="pblmPasi != null and pblmPasi != ''">and t.PBLM_PASI = #{pblmPasi}</if>
  234. <if test="pblmQlttvCd != null and pblmQlttvCd != ''">and t.PBLM_QLTTV_CD = #{pblmQlttvCd}</if>
  235. <if test="pblmQlttvNm != null and pblmQlttvNm != ''">and t.PBLM_QLTTV_NM = #{pblmQlttvNm}</if>
  236. <if test="adCode != null and adCode != ''">and r.AD_CODE = #{adCode}</if>
  237. <if test="objId != null and objId != ''">and r.OBJ_ID = #{objId}</if>
  238. <if test="ifCasePblm != null and ifCasePblm != ''">and t.IF_CASE_PBLM = #{ifCasePblm}</if>
  239. <if test="subjectNames != null and subjectNames != ''">and t.subject_Names like '%${subjectNames}%'</if>
  240. <if test="groupId != null and groupId != ''">and r.GROUP_ID = #{groupId}</if>
  241. <if test="stepId != null and stepId != ''">and t.STEP_ID = #{stepId}</if>
  242. <if test="isJoinRec != null and isJoinRec != ''">
  243. <if test="isJoinRec =='0'.toString()">
  244. and t.id not in (select pblm_id from TAC_PROVINCE_PBLM_MEND_INFO WHERE pblm_id IS NOT NULL)
  245. </if>
  246. <if test="isJoinRec =='1'.toString()">
  247. and t.id in (select pblm_id from TAC_PROVINCE_PBLM_MEND_INFO WHERE pblm_id IS NOT NULL)
  248. </if>
  249. </if>
  250. <include refid="choseSql"/>
  251. <if test="pblmNm != null and pblmNm != ''">
  252. and t.PBLM_NM like '%${pblmNm}%'
  253. </if>
  254. <if test="pblmMendState != null and pblmMendState != ''"> AND T.PBLM_MEND_STATE = #{pblmMendState}</if>
  255. and o.YEAR is not null
  256. </sql>
  257. <sql id="choseSql" >
  258. <choose>
  259. <when test="province !=null and province !=''">
  260. and t.province=#{province}
  261. </when>
  262. <otherwise>
  263. and t.province is null
  264. </otherwise>
  265. </choose>
  266. </sql>
  267. <select id="findList" resultMap="tacProvincePblmInfoResultMap">
  268. select <include refid="table_columns" /> from TAC_PROVINCE_PBLM_INFO <include refid="page_where" />
  269. order by state desc,intm desc
  270. </select>
  271. <select id="selectCount" resultType="int" >
  272. select count(ID) from TAC_PROVINCE_PBLM_INFO <include refid="page_where" />
  273. </select>
  274. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.TacProvincePblmInfo">
  275. insert into TAC_PROVINCE_PBLM_INFO( <include refid="table_columns" /> )
  276. values ( <include refid="entity_properties" /> )
  277. </insert>
  278. <delete id="delete" parameterType="java.lang.String">
  279. delete from TAC_PROVINCE_PBLM_INFO where ID = #{id}
  280. </delete>
  281. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.TacProvincePblmInfo">
  282. delete from TAC_PROVINCE_PBLM_INFO <include refid="page_where" />
  283. </delete>
  284. <update id="deleteInFlag" parameterType="java.lang.String">
  285. update TAC_PROVINCE_PBLM_INFO set flag_valid = 0 where ID = #{id}
  286. </update>
  287. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.TacProvincePblmInfo">
  288. update TAC_PROVINCE_PBLM_INFO
  289. <trim prefix="set" suffixOverrides=",">
  290. <if test="objType != null and objType != ''">OBJ_TYPE = #{objType},</if>
  291. <if test="stepId != null and stepId != ''"> STEP_ID = #{stepId},</if>
  292. <if test="oldPblmId != null and oldPblmId != ''"> old_pblm_id = #{oldPblmId},</if>
  293. <if test="sn != null and sn != ''"> SN = #{sn},</if>
  294. <if test="objId != null and objId != ''">OBJ_ID = #{objId},</if>
  295. <if test="state != null and state != ''">STATE = #{state},</if>
  296. <if test="pblmNm != null and pblmNm != ''">PBLM_NM = #{pblmNm},</if>
  297. <if test="pblmPasi != null and pblmPasi != ''">PBLM_PASI = #{pblmPasi},</if>
  298. <if test="ifCasePblm != null and ifCasePblm != ''">IF_CASE_PBLM = #{ifCasePblm},</if>
  299. <if test="subjectIds != null and subjectIds != ''">SUBJECT_IDS = #{subjectIds},</if>
  300. <if test="subjectNames != null and subjectNames != ''">SUBJECT_NAMES = #{subjectNames},</if>
  301. <if test="pblmDesc != null and pblmDesc != ''">PBLM_DESC = #{pblmDesc},</if>
  302. <if test="pblmReason != null and pblmReason != ''">PBLM_REASON = #{pblmReason},</if>
  303. <if test="pblmSggtn != null and pblmSggtn != ''">PBLM_SGGTN = #{pblmSggtn},</if>
  304. <if test="pblmSn != null and pblmSn != ''">PBLM_SN = #{pblmSn},</if>
  305. <if test="pblmstdId != null and pblmstdId != ''">PBLMSTD_ID = #{pblmstdId},</if>
  306. <if test="rectId != null and rectId != ''">RECT_ID = #{rectId},</if>
  307. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID = #{rgstrId},</if>
  308. <if test="listType != null and listType != ''">LIST_TYPE = #{listType},</if>
  309. <if test="listId != null and listId != ''">LIST_ID = #{listId},</if>
  310. <if test="hasVedio != null and hasVedio != ''">HAS_VEDIO = #{hasVedio},</if>
  311. <if test="groupId != null and groupId != ''">GROUP_ID = #{groupId},</if>
  312. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  313. <if test="persNm != null and persNm != ''">PERS_NM = #{persNm},</if>
  314. <if test="intm != null">INTM = #{intm},</if>
  315. <if test="spclId != null and spclId != ''">SPCL_ID = #{spclId},</if>
  316. <if test="spclNm != null and spclNm != ''">SPCL_NM = #{spclNm},</if>
  317. <if test="spclRvwOptn != null and spclRvwOptn != ''">SPCL_RVW_OPTN = #{spclRvwOptn},</if>
  318. <if test="spclTm != null">SPCL_TM = #{spclTm},</if>
  319. <if test="uptm != null">UPTM = #{uptm},</if>
  320. <if test="note != null and note != ''">NOTE = #{note},</if>
  321. <if test="pblmQlttvCd != null and pblmQlttvCd != ''">PBLM_QLTTV_CD = #{pblmQlttvCd},</if>
  322. <if test="pblmQlttvNm != null and pblmQlttvNm != ''">PBLM_QLTTV_NM = #{pblmQlttvNm},</if>
  323. <if test="isCpQa != null and isCpQa != ''">IS_CP_QA = #{isCpQa},</if>
  324. <if test="pblmTypeDesc != null and pblmTypeDesc != ''">PBLM_TYPE_DESC = #{pblmTypeDesc},</if>
  325. <if test="taskId != null and taskId != ''">TASK_ID = #{taskId},</if>
  326. <if test="province != null and province != ''">PROVINCE = #{province},</if>
  327. <if test="pblmRevision != null and pblmRevision != ''">PBLM_REVISION = #{pblmRevision},</if>
  328. <if test="pblmRevisionProof != null and pblmRevisionProof != ''">PBLM_REVISION_PROOF = #{pblmRevisionProof},</if>
  329. <if test="pblmMendNote != null and pblmMendNote != ''">PBLM_MEND_NOTE = #{pblmMendNote},</if>
  330. <if test="pblmMendState != null and pblmMendState != ''">PBLM_MEND_STATE = #{pblmMendState},</if>
  331. <if test="pblmMendPersNm != null and pblmMendPersNm != ''">PBLM_MEND_PERS_NM = #{pblmMendPersNm},</if>
  332. <if test="pblmMendPersId != null and pblmMendPersId != ''">PBLM_MEND_PERS_ID = #{pblmMendPersId},</if>
  333. <if test="pblmMendTm != null and pblmMendTm != ''">PBLM_MEND_TM = #{pblmMendTm},</if>
  334. <if test="relativeLaw != null and relativeLaw != ''"> RELATIVE_LAW = #{relativeLaw} , </if>
  335. <if test="lawContent != null and lawContent != ''"> LAW_CONTENT = #{lawContent}, </if>
  336. </trim>
  337. <where>ID = #{id}</where>
  338. </update>
  339. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.TacProvincePblmInfo">
  340. update TAC_PROVINCE_PBLM_INFO
  341. <trim prefix="set" suffixOverrides=",">
  342. <if test="objType != null and objType != ''">OBJ_TYPE = #{objType},</if>
  343. <if test="objId != null and objId != ''">OBJ_ID = #{objId},</if>
  344. <if test="pblmNm != null and pblmNm != ''">PBLM_NM = #{pblmNm},</if>
  345. <if test="pblmPasi != null and pblmPasi != ''">PBLM_PASI = #{pblmPasi},</if>
  346. <if test="ifCasePblm != null and ifCasePblm != ''">IF_CASE_PBLM = #{ifCasePblm},</if>
  347. <if test="subjectIds != null and subjectIds != ''">SUBJECT_IDS = #{subjectIds},</if>
  348. <if test="subjectNames != null and subjectNames != ''">SUBJECT_NAMES = #{subjectNames},</if>
  349. <if test="pblmDesc != null and pblmDesc != ''">PBLM_DESC = #{pblmDesc},</if>
  350. <if test="pblmReason != null and pblmReason != ''">PBLM_REASON = #{pblmReason},</if>
  351. <if test="pblmSggtn != null and pblmSggtn != ''">PBLM_SGGTN = #{pblmSggtn},</if>
  352. <if test="pblmSn != null and pblmSn != ''">PBLM_SN = #{pblmSn},</if>
  353. <if test="pblmstdId != null and pblmstdId != ''">PBLMSTD_ID = #{pblmstdId},</if>
  354. <if test="rectId != null and rectId != ''">RECT_ID = #{rectId},</if>
  355. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID = #{rgstrId},</if>
  356. <if test="listType != null and listType != ''">LIST_TYPE = #{listType},</if>
  357. <if test="listId != null and listId != ''">LIST_ID = #{listId},</if>
  358. <if test="hasVedio != null and hasVedio != ''">HAS_VEDIO = #{hasVedio},</if>
  359. <if test="groupId != null and groupId != ''">GROUP_ID = #{groupId},</if>
  360. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  361. <if test="persNm != null and persNm != ''">PERS_NM = #{persNm},</if>
  362. <if test="intm != null">INTM = #{intm},</if>
  363. <if test="spclId != null and spclId != ''">SPCL_ID = #{spclId},</if>
  364. <if test="spclNm != null and spclNm != ''">SPCL_NM = #{spclNm},</if>
  365. <if test="spclRvwOptn != null and spclRvwOptn != ''">SPCL_RVW_OPTN = #{spclRvwOptn},</if>
  366. <if test="spclTm != null">SPCL_TM = #{spclTm},</if>
  367. <if test="uptm != null">UPTM = #{uptm},</if>
  368. <if test="note != null and note != ''">NOTE = #{note},</if>
  369. <if test="pblmQlttvCd != null and pblmQlttvCd != ''">PBLM_QLTTV_CD = #{pblmQlttvCd},</if>
  370. <if test="pblmQlttvNm != null and pblmQlttvNm != ''">PBLM_QLTTV_NM = #{pblmQlttvNm},</if>
  371. <if test="isCpQa != null and isCpQa != ''">IS_CP_QA = #{isCpQa},</if>
  372. <if test="pblmTypeDesc != null and pblmTypeDesc != ''">PBLM_TYPE_DESC = #{pblmTypeDesc},</if>
  373. <if test="taskId != null and taskId != ''">TASK_ID = #{taskId},</if>
  374. <if test="stepId != null and stepId != ''"> STEP_ID = #{stepId},</if>
  375. <if test="oldPblmId != null and oldPblmId != ''"> old_pblm_id = #{oldPblmId},</if>
  376. <if test="pblmRevision != null and pblmRevision != ''">PBLM_REVISION = #{pblmRevision},</if>
  377. <if test="pblmRevisionProof != null and pblmRevisionProof != ''">PBLM_REVISION_PROOF = #{pblmRevisionProof},</if>
  378. <if test="pblmMendNote != null and pblmMendNote != ''">PBLM_MEND_NOTE = #{pblmMendNote},</if>
  379. <if test="pblmMendState != null and pblmMendState != ''">PBLM_MEND_STATE = #{PBLM_MEND_STATE},</if>
  380. <if test="pblmMendPersNm != null and pblmMendPersNm != ''">PBLM_MEND_PERS_NM = #{PBLM_MEND_PERS_NM},</if>
  381. <if test="pblmMendPersId != null and pblmMendPersId != ''">PBLM_MEND_PERS_ID = #{pblmMendPersId},</if>
  382. <if test="pblmMendTm != null and pblmMendTm != ''">PBLM_MEND_TM = #{pblmMendTm},</if>
  383. <if test="relativeLaw != null "> RELATIVE_LAW = #{relativeLaw} , </if>
  384. <if test="lawContent != null "> LAW_CONTENT = #${lawContent}, </if>
  385. </trim>
  386. <include refid="page_where" />
  387. </update>
  388. <select id="countPblmInfoByStbJdNew" parameterType="cn.com.goldenwater.dcproj.param.TacPblmInfoParam" resultType="cn.com.goldenwater.dcproj.dto.TacCountDto">
  389. SELECT
  390. ( CASE WHEN count( * ) IS NULL THEN 0 ELSE count( * ) END ) AS count,
  391. DECODE( spfsnlType, '质量实体', '工程质量', '质量行为', '工程质量', '安全管理', '工程安全', spfsnlType ) AS name,
  392. pblmType,
  393. pblmPasi AS code
  394. FROM
  395. (
  396. SELECT
  397. (case when tb.SPFSNL_TYPE='计划管理' then '计划下达与执行' else tb.SPFSNL_TYPE end) AS spfsnlType,
  398. t.PBLM_PASI AS pblmPasi,
  399. tb.pblm_type AS pblmType,
  400. t.PBLM_NM
  401. FROM
  402. TAC_PROVINCE_PBLM_INFO t
  403. LEFT JOIN TAC_INSP_YEAR_BATCH_OBJ o ON o.id = t.obj_id
  404. LEFT JOIN TAC_OBJ_PBLMSTB tb ON tb.id = t.PBLMSTD_ID
  405. WHERE
  406. o.id IS NOT NULL
  407. AND t.pblm_pasi IS NOT NULL
  408. AND tb.id IS NOT NULL
  409. <include refid="choseSql"/>
  410. <if test="year != null">and o.year = #{year}
  411. </if>
  412. <if test="batch != null">and o.batch = #{batch}
  413. </if>
  414. <if test="type != null and type != ''">and r.type = #{type}
  415. </if>
  416. <if test="isPoverty != null and isPoverty != ''">and r.IS_POVERTY = #{isPoverty}
  417. </if>
  418. <if test="state != null and state != ''">
  419. and r.state = #{state}
  420. </if>
  421. <if test="searchStat != null and searchStat != ''">
  422. and t.RGSTR_ID like '%_${searchStat}'
  423. </if>
  424. <if test="objId != null and objId != ''">
  425. and t.obj_id = #{objId}
  426. </if>
  427. <if test="rgstrId != null and rgstrId !=''">
  428. and t.STEP_ID= #{rgstrId}
  429. </if>
  430. )
  431. WHERE
  432. spfsnlType NOT IN ( '质量管理—实体质量', '计划管理' )
  433. GROUP BY
  434. spfsnlType,
  435. pblmType,
  436. pblmPasi
  437. ORDER BY
  438. pblmType
  439. </select>
  440. <select id="countIfCasePblmJdNew" resultType="java.lang.Integer">
  441. SELECT
  442. count(*)
  443. FROM
  444. TAC_PROVINCE_PBLM_INFO t
  445. LEFT JOIN TAC_INSP_YEAR_BATCH_OBJ o ON o.id = t.obj_id
  446. LEFT JOIN TAC_OBJ_PBLMSTB tb ON tb.id = t.PBLMSTD_ID
  447. WHERE
  448. t.pblm_pasi IS NOT NULL
  449. AND tb.id IS NOT NULL
  450. <if test="year != null">and o.year = #{year}
  451. </if>
  452. <if test="batch != null">and o.batch = #{batch}
  453. </if>
  454. <if test="type != null and type != ''">and r.type = #{type}
  455. </if>
  456. <if test="isPoverty != null and isPoverty != ''">and r.IS_POVERTY = #{isPoverty}
  457. </if>
  458. <if test="state != null and state != ''">
  459. and r.state = #{state}
  460. </if>
  461. <if test="searchStat != null and searchStat != ''">
  462. and t.RGSTR_ID like '%_${searchStat}'
  463. </if>
  464. <if test="objId != null and objId != ''">
  465. and t.obj_id = #{objId}
  466. </if>
  467. <if test="rgstrId != null and rgstrId !=''">
  468. and t.STEP_ID= #{rgstrId}
  469. </if>
  470. <choose>
  471. <when test="ifCasePblm == 1">
  472. and t.IF_CASE_PBLM = 1
  473. </when>
  474. <otherwise>
  475. and (t.IF_CASE_PBLM = 0 or t.IF_CASE_PBLM is null)
  476. </otherwise>
  477. </choose>
  478. </select>
  479. <select id="countPblmInfoBySubJdNew" parameterType="cn.com.goldenwater.dcproj.param.TacPblmInfoParam" resultType="cn.com.goldenwater.dcproj.dto.TacCountDto">
  480. select t.SYS_TYPE as code,t.pblm_pasi as name, count(*) as count from (
  481. select distinct t.id,t.pblm_pasi,os.SYS_TYPE from TAC_PROVINCE_PBLM_INFO t left join
  482. TAC_PAWP_RGSTR r on t.obj_id = r.obj_id left join TAC_INSP_YEAR_BATCH_OBJ o on o.id = r.obj_id
  483. left join TAC_PBLM_SUBJECT s on t.id = s.pblm_id left join tac_obj_subject os on s.sub_id = os.ID
  484. where t.pblm_pasi is not null and s.id is not null and s.sub_id is not null
  485. <include refid="choseSql"/>
  486. <if test="year != null">
  487. and o.year ='2020'
  488. </if>
  489. <if test="batch != null">
  490. and o.batch = #{batch}
  491. </if>
  492. <if test="type != null and type != ''">
  493. and r.type = #{type}
  494. </if>
  495. <if test="isPoverty != null and isPoverty != ''">
  496. and r.IS_POVERTY = #{isPoverty}
  497. </if>
  498. <if test="state != null and state != ''">
  499. and r.state = #{state}
  500. </if>
  501. <if test="searchStat != null and searchStat != ''">
  502. and t.RGSTR_ID like '%_${searchStat}'
  503. </if>
  504. <if test="rgstrId != null and rgstrId !=''">
  505. and t.STEP_ID= #{rgstrId}
  506. </if>
  507. ) t group by t.SYS_TYPE,t.pblm_pasi
  508. </select>
  509. <select id="countPblmInfoByAdCodeJdNew" parameterType="cn.com.goldenwater.dcproj.param.TacPblmInfoParam" resultType="cn.com.goldenwater.dcproj.dto.TacCountDto">
  510. select AD_Code as code, PBLM_PASI AS name, count(*) as count
  511. from (
  512. select t.*, a.ad_code, a.ad_name
  513. from TAC_PROVINCE_PBLM_INFO t
  514. left join TAC_PAWP_RGSTR r on t.obj_id = r.obj_id
  515. left join TAC_INSP_YEAR_BATCH_OBJ o on o.id = r.obj_id
  516. left join TAC_INSP_YEAR_BATCH_AREA a on a.GROUP_ID=o.GROUP_ID
  517. where r.id is not null
  518. and t.pblm_pasi is not null
  519. <include refid="choseSql"/>
  520. <if test="year != null">
  521. and o.year = #{year}
  522. </if>
  523. <if test="batch != null">
  524. and o.batch = #{batch}
  525. </if>
  526. <if test="type != null and type != ''">
  527. and r.type = #{type}
  528. </if>
  529. <if test="isPoverty != null and isPoverty != ''">
  530. and r.IS_POVERTY = #{isPoverty}
  531. </if>
  532. <if test="state != null and state != ''">
  533. and r.state = #{state}
  534. </if>
  535. <if test="searchStat != null and searchStat != ''">
  536. and t.RGSTR_ID like '%_${searchStat}'
  537. </if>
  538. <if test="rgstrId != null and rgstrId !=''">
  539. and t.STEP_ID= #{rgstrId}
  540. </if>
  541. ) group by AD_Code, AD_Name,PBLM_PASI order by COUNT desc
  542. </select>
  543. <select id="countPblmInfoByObjTypeJdNew" parameterType="cn.com.goldenwater.dcproj.param.TacPblmInfoParam" resultType="cn.com.goldenwater.dcproj.dto.TacCountDto">
  544. WITH O AS (
  545. SELECT B.TYPE AS NAME,
  546. COUNT(T.ID) PBLM_SIZE
  547. FROM TAC_INSP_YEAR_BATCH_OBJ O
  548. JOIN TAC_PAWP_RGSTR R ON O.ID = R.OBJ_ID
  549. LEFT JOIN TAC_ATT_PAWP_BASE B ON B.ID = O.OJB_ID
  550. LEFT JOIN TAC_PROVINCE_PBLM_INFO T ON T.RGSTR_ID = R.ID
  551. WHERE B.TYPE IS NOT NULL
  552. <include refid="choseSql"/>
  553. <if test="year != null">
  554. and O.year = #{year}
  555. </if>
  556. <if test="batch != null">
  557. and O.batch = #{batch}
  558. </if>
  559. <if test="rgstrId != null and rgstrId !=''">
  560. and t.STEP_ID= #{rgstrId}
  561. </if>
  562. GROUP BY B.TYPE
  563. )
  564. SELECT name, SUM(PBLM_SIZE) AS count FROM O
  565. GROUP BY name
  566. ORDER BY name
  567. </select>
  568. <select id="countPblmInfoByQtJdNew" parameterType="cn.com.goldenwater.dcproj.param.TacPblmInfoParam" resultType="cn.com.goldenwater.dcproj.dto.TacCountDto">
  569. SELECT
  570. count( * ) AS count,
  571. a.showName,
  572. a.name
  573. FROM
  574. (
  575. SELECT
  576. t.LIST_TYPE as name,
  577. tp.PBLM_TYPE_DESC AS showName
  578. FROM
  579. TAC_PROVINCE_PBLM_INFO t
  580. LEFT JOIN TAC_OBJ_PBLMSTB tp ON t.PBLMSTD_ID = tp.id
  581. LEFT JOIN TAC_INSP_YEAR_BATCH_OBJ o ON o.id = t.obj_id
  582. WHERE
  583. t.PBLMSTD_ID IS NOT NULL
  584. AND tp.id IS NOT NULL
  585. and tp.PBLM_TYPE_DESC is not null
  586. and tp.PBLM_TYPE_DESC !='其他'
  587. <include refid="choseSql"/>
  588. <if test="year !=null">
  589. and o.year = #{year}
  590. </if>
  591. <if test="batch != null">
  592. and o.batch = #{batch}
  593. </if>
  594. <if test="stbClaName != null and stbClaName != ''">
  595. and t.LIST_TYPE = #{stbClaName}
  596. </if>
  597. <if test="rgstrId != null and rgstrId !=''">
  598. and t.STEP_ID= #{rgstrId}
  599. </if>
  600. ) A
  601. GROUP BY
  602. a.showName,
  603. a.name
  604. ORDER BY
  605. a.showName
  606. </select>
  607. <select id="countPblmInfoObjByQtJdNew" parameterType="cn.com.goldenwater.dcproj.param.TacPblmInfoParam" resultType="cn.com.goldenwater.dcproj.dto.TacCountDto">
  608. SELECT
  609. count( * ) AS count,
  610. a.showName,
  611. a.name
  612. FROM
  613. (
  614. SELECT
  615. DISTINCT
  616. t.PBLMSTD_ID,
  617. tp.PBLM_TYPE_DESC AS showName,
  618. t.LIST_TYPE as name
  619. FROM
  620. TAC_PROVINCE_PBLM_INFO t
  621. LEFT JOIN TAC_OBJ_PBLMSTB tp ON t.PBLMSTD_ID = tp.id
  622. LEFT JOIN TAC_INSP_YEAR_BATCH_OBJ o ON o.id = t.obj_id
  623. WHERE
  624. t.PBLMSTD_ID IS NOT NULL
  625. AND tp.id IS NOT NULL
  626. and tp.PBLM_TYPE_DESC is not null
  627. and tp.PBLM_TYPE_DESC !='其他'
  628. <include refid="choseSql"/>
  629. <if test="year !=null">
  630. and o.year = #{year}
  631. </if>
  632. <if test="batch != null">
  633. and o.batch = #{batch}
  634. </if>
  635. <if test="stbClaName != null and stbClaName != ''">
  636. and t.LIST_TYPE = #{stbClaName}
  637. </if>
  638. <if test="rgstrId != null and rgstrId !=''">
  639. and t.STEP_ID= #{rgstrId}
  640. </if>
  641. ) A
  642. GROUP BY
  643. a.name,a.showName
  644. ORDER BY
  645. a.showName
  646. </select>
  647. </mapper>