TacProvincePblmInfoDao.xml 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680
  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 where r.id=t.rgstr_id
  201. <include refid="jieduanSql"/>
  202. order by t.INTM, t.SN ASC
  203. </select>
  204. <select id="findExpertSubmitCount" resultType="java.lang.Integer">
  205. select count(t.id)
  206. from TAC_PROVINCE_PBLM_INFO t,TAC_PAWP_RGSTR r
  207. where r.id=t.rgstr_id
  208. and r.GROUP_ID = #{groupId} and r.OBJ_ID=#{objId} and t.PERS_ID = #{persId} and r.AD_CODE = #{adCode}
  209. </select>
  210. <select id="finalResults" resultType="cn.com.goldenwater.dcproj.model.TacProvincePblmInfoReDto">
  211. select
  212. t.*,
  213. r.name objName,
  214. r.location,
  215. r.ad_code adcodecounty
  216. from TAC_PROVINCE_PBLM_INFO t
  217. left join TAC_PAWP_RGSTR r on r.id = t.rgstr_id
  218. left join TAC_INSP_YEAR_BATCH_OBJ o on o.id = r.OBJ_ID
  219. where 1=1
  220. <if test="stepId != null and stepId != ''">and t.STEP_ID = #{stepId}</if>
  221. <if test="objName != null and objName != ''">and r.name like '%${objName}%'</if>
  222. <if test="year != null and year != ''">and o.YEAR = #{year}</if>
  223. <if test="pblmNm != null and pblmNm != ''">and t.PBLM_NM like '%${pblmNm}%' </if>
  224. <if test="listType != null and listType != ''">and t.LIST_TYPE = #{listType}</if>
  225. <if test="pblmPasi != null and pblmPasi != ''">and t.PBLM_PASI = #{pblmPasi}</if>
  226. <if test="adCode != null and adCode != ''">and r.AD_CODE like concat('%' , substr(#{adCode},1,4) , '%')</if>
  227. order by t.state desc, t.intm desc
  228. </select>
  229. <sql id="jieduanSql">
  230. <if test="rgstrId != null and rgstrId != ''">and t.RGSTR_ID like '${rgstrId}%'</if>
  231. <include refid="mySearch"/>
  232. </sql>
  233. <sql id="mySearch">
  234. <if test="listType != null and listType != ''">and t.LIST_TYPE = #{listType}</if>
  235. <if test="hasVedio != null and hasVedio != ''">and t.HAS_VEDIO = #{hasVedio}</if>
  236. <if test="pblmPasi != null and pblmPasi != ''">and t.PBLM_PASI = #{pblmPasi}</if>
  237. <if test="pblmQlttvCd != null and pblmQlttvCd != ''">and t.PBLM_QLTTV_CD = #{pblmQlttvCd}</if>
  238. <if test="pblmQlttvNm != null and pblmQlttvNm != ''">and t.PBLM_QLTTV_NM = #{pblmQlttvNm}</if>
  239. <if test="adCode != null and adCode != ''">and r.AD_CODE = #{adCode}</if>
  240. <if test="objId != null and objId != ''">and r.OBJ_ID = #{objId}</if>
  241. <if test="ifCasePblm != null and ifCasePblm != ''">and IF_CASE_PBLM = #{ifCasePblm}</if>
  242. <if test="subjectNames != null and subjectNames != ''">and subject_Names like '%${subjectNames}%'</if>
  243. <if test="groupId != null and groupId != ''">and r.GROUP_ID = #{groupId}</if>
  244. <if test="stepId != null and stepId != ''">and t.STEP_ID = #{stepId}</if>
  245. <if test="isJoinRec != null and isJoinRec != ''">
  246. <if test="isJoinRec =='0'.toString()">
  247. and t.id not in (select pblm_id from TAC_PROVINCE_PBLM_MEND_INFO WHERE pblm_id IS NOT NULL)
  248. </if>
  249. <if test="isJoinRec =='1'.toString()">
  250. and t.id in (select pblm_id from TAC_PROVINCE_PBLM_MEND_INFO WHERE pblm_id IS NOT NULL)
  251. </if>
  252. </if>
  253. <include refid="choseSql"/>
  254. <if test="pblmNm != null and pblmNm != ''">
  255. and PBLM_NM like '%${pblmNm}%'
  256. </if>
  257. <if test="pblmMendState != null and pblmMendState != ''"> AND T.PBLM_MEND_STATE = #{pblmMendState}</if>
  258. </sql>
  259. <sql id="choseSql" >
  260. <choose>
  261. <when test="province !=null and province !=''">
  262. and t.province=#{province}
  263. </when>
  264. <otherwise>
  265. and t.province is null
  266. </otherwise>
  267. </choose>
  268. </sql>
  269. <select id="findList" resultMap="tacProvincePblmInfoResultMap">
  270. select <include refid="table_columns" /> from TAC_PROVINCE_PBLM_INFO <include refid="page_where" />
  271. order by state desc,intm desc
  272. </select>
  273. <select id="selectCount" resultType="int" >
  274. select count(ID) from TAC_PROVINCE_PBLM_INFO <include refid="page_where" />
  275. </select>
  276. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.TacProvincePblmInfo">
  277. insert into TAC_PROVINCE_PBLM_INFO( <include refid="table_columns" /> )
  278. values ( <include refid="entity_properties" /> )
  279. </insert>
  280. <delete id="delete" parameterType="java.lang.String">
  281. delete from TAC_PROVINCE_PBLM_INFO where ID = #{id}
  282. </delete>
  283. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.TacProvincePblmInfo">
  284. delete from TAC_PROVINCE_PBLM_INFO <include refid="page_where" />
  285. </delete>
  286. <update id="deleteInFlag" parameterType="java.lang.String">
  287. update TAC_PROVINCE_PBLM_INFO set flag_valid = 0 where ID = #{id}
  288. </update>
  289. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.TacProvincePblmInfo">
  290. update TAC_PROVINCE_PBLM_INFO
  291. <trim prefix="set" suffixOverrides=",">
  292. <if test="objType != null and objType != ''">OBJ_TYPE = #{objType},</if>
  293. <if test="stepId != null and stepId != ''"> STEP_ID = #{stepId},</if>
  294. <if test="oldPblmId != null and oldPblmId != ''"> old_pblm_id = #{oldPblmId},</if>
  295. <if test="sn != null and sn != ''"> SN = #{sn},</if>
  296. <if test="objId != null and objId != ''">OBJ_ID = #{objId},</if>
  297. <if test="state != null and state != ''">STATE = #{state},</if>
  298. <if test="pblmNm != null and pblmNm != ''">PBLM_NM = #{pblmNm},</if>
  299. <if test="pblmPasi != null and pblmPasi != ''">PBLM_PASI = #{pblmPasi},</if>
  300. <if test="ifCasePblm != null and ifCasePblm != ''">IF_CASE_PBLM = #{ifCasePblm},</if>
  301. <if test="subjectIds != null and subjectIds != ''">SUBJECT_IDS = #{subjectIds},</if>
  302. <if test="subjectNames != null and subjectNames != ''">SUBJECT_NAMES = #{subjectNames},</if>
  303. <if test="pblmDesc != null and pblmDesc != ''">PBLM_DESC = #{pblmDesc},</if>
  304. <if test="pblmReason != null and pblmReason != ''">PBLM_REASON = #{pblmReason},</if>
  305. <if test="pblmSggtn != null and pblmSggtn != ''">PBLM_SGGTN = #{pblmSggtn},</if>
  306. <if test="pblmSn != null and pblmSn != ''">PBLM_SN = #{pblmSn},</if>
  307. <if test="pblmstdId != null and pblmstdId != ''">PBLMSTD_ID = #{pblmstdId},</if>
  308. <if test="rectId != null and rectId != ''">RECT_ID = #{rectId},</if>
  309. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID = #{rgstrId},</if>
  310. <if test="listType != null and listType != ''">LIST_TYPE = #{listType},</if>
  311. <if test="listId != null and listId != ''">LIST_ID = #{listId},</if>
  312. <if test="hasVedio != null and hasVedio != ''">HAS_VEDIO = #{hasVedio},</if>
  313. <if test="groupId != null and groupId != ''">GROUP_ID = #{groupId},</if>
  314. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  315. <if test="persNm != null and persNm != ''">PERS_NM = #{persNm},</if>
  316. <if test="intm != null">INTM = #{intm},</if>
  317. <if test="spclId != null and spclId != ''">SPCL_ID = #{spclId},</if>
  318. <if test="spclNm != null and spclNm != ''">SPCL_NM = #{spclNm},</if>
  319. <if test="spclRvwOptn != null and spclRvwOptn != ''">SPCL_RVW_OPTN = #{spclRvwOptn},</if>
  320. <if test="spclTm != null">SPCL_TM = #{spclTm},</if>
  321. <if test="uptm != null">UPTM = #{uptm},</if>
  322. <if test="note != null and note != ''">NOTE = #{note},</if>
  323. <if test="pblmQlttvCd != null and pblmQlttvCd != ''">PBLM_QLTTV_CD = #{pblmQlttvCd},</if>
  324. <if test="pblmQlttvNm != null and pblmQlttvNm != ''">PBLM_QLTTV_NM = #{pblmQlttvNm},</if>
  325. <if test="isCpQa != null and isCpQa != ''">IS_CP_QA = #{isCpQa},</if>
  326. <if test="pblmTypeDesc != null and pblmTypeDesc != ''">PBLM_TYPE_DESC = #{pblmTypeDesc},</if>
  327. <if test="taskId != null and taskId != ''">TASK_ID = #{taskId},</if>
  328. <if test="province != null and province != ''">PROVINCE = #{province},</if>
  329. <if test="pblmRevision != null and pblmRevision != ''">PBLM_REVISION = #{pblmRevision},</if>
  330. <if test="pblmRevisionProof != null and pblmRevisionProof != ''">PBLM_REVISION_PROOF = #{pblmRevisionProof},</if>
  331. <if test="pblmMendNote != null and pblmMendNote != ''">PBLM_MEND_NOTE = #{pblmMendNote},</if>
  332. <if test="pblmMendState != null and pblmMendState != ''">PBLM_MEND_STATE = #{pblmMendState},</if>
  333. <if test="pblmMendPersNm != null and pblmMendPersNm != ''">PBLM_MEND_PERS_NM = #{pblmMendPersNm},</if>
  334. <if test="pblmMendPersId != null and pblmMendPersId != ''">PBLM_MEND_PERS_ID = #{pblmMendPersId},</if>
  335. <if test="pblmMendTm != null and pblmMendTm != ''">PBLM_MEND_TM = #{pblmMendTm},</if>
  336. <if test="relativeLaw != null and relativeLaw != ''"> RELATIVE_LAW = #{relativeLaw} , </if>
  337. <if test="lawContent != null and lawContent != ''"> LAW_CONTENT = #{lawContent}, </if>
  338. </trim>
  339. <where>ID = #{id}</where>
  340. </update>
  341. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.TacProvincePblmInfo">
  342. update TAC_PROVINCE_PBLM_INFO
  343. <trim prefix="set" suffixOverrides=",">
  344. <if test="objType != null and objType != ''">OBJ_TYPE = #{objType},</if>
  345. <if test="objId != null and objId != ''">OBJ_ID = #{objId},</if>
  346. <if test="pblmNm != null and pblmNm != ''">PBLM_NM = #{pblmNm},</if>
  347. <if test="pblmPasi != null and pblmPasi != ''">PBLM_PASI = #{pblmPasi},</if>
  348. <if test="ifCasePblm != null and ifCasePblm != ''">IF_CASE_PBLM = #{ifCasePblm},</if>
  349. <if test="subjectIds != null and subjectIds != ''">SUBJECT_IDS = #{subjectIds},</if>
  350. <if test="subjectNames != null and subjectNames != ''">SUBJECT_NAMES = #{subjectNames},</if>
  351. <if test="pblmDesc != null and pblmDesc != ''">PBLM_DESC = #{pblmDesc},</if>
  352. <if test="pblmReason != null and pblmReason != ''">PBLM_REASON = #{pblmReason},</if>
  353. <if test="pblmSggtn != null and pblmSggtn != ''">PBLM_SGGTN = #{pblmSggtn},</if>
  354. <if test="pblmSn != null and pblmSn != ''">PBLM_SN = #{pblmSn},</if>
  355. <if test="pblmstdId != null and pblmstdId != ''">PBLMSTD_ID = #{pblmstdId},</if>
  356. <if test="rectId != null and rectId != ''">RECT_ID = #{rectId},</if>
  357. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID = #{rgstrId},</if>
  358. <if test="listType != null and listType != ''">LIST_TYPE = #{listType},</if>
  359. <if test="listId != null and listId != ''">LIST_ID = #{listId},</if>
  360. <if test="hasVedio != null and hasVedio != ''">HAS_VEDIO = #{hasVedio},</if>
  361. <if test="groupId != null and groupId != ''">GROUP_ID = #{groupId},</if>
  362. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  363. <if test="persNm != null and persNm != ''">PERS_NM = #{persNm},</if>
  364. <if test="intm != null">INTM = #{intm},</if>
  365. <if test="spclId != null and spclId != ''">SPCL_ID = #{spclId},</if>
  366. <if test="spclNm != null and spclNm != ''">SPCL_NM = #{spclNm},</if>
  367. <if test="spclRvwOptn != null and spclRvwOptn != ''">SPCL_RVW_OPTN = #{spclRvwOptn},</if>
  368. <if test="spclTm != null">SPCL_TM = #{spclTm},</if>
  369. <if test="uptm != null">UPTM = #{uptm},</if>
  370. <if test="note != null and note != ''">NOTE = #{note},</if>
  371. <if test="pblmQlttvCd != null and pblmQlttvCd != ''">PBLM_QLTTV_CD = #{pblmQlttvCd},</if>
  372. <if test="pblmQlttvNm != null and pblmQlttvNm != ''">PBLM_QLTTV_NM = #{pblmQlttvNm},</if>
  373. <if test="isCpQa != null and isCpQa != ''">IS_CP_QA = #{isCpQa},</if>
  374. <if test="pblmTypeDesc != null and pblmTypeDesc != ''">PBLM_TYPE_DESC = #{pblmTypeDesc},</if>
  375. <if test="taskId != null and taskId != ''">TASK_ID = #{taskId},</if>
  376. <if test="stepId != null and stepId != ''"> STEP_ID = #{stepId},</if>
  377. <if test="oldPblmId != null and oldPblmId != ''"> old_pblm_id = #{oldPblmId},</if>
  378. <if test="pblmRevision != null and pblmRevision != ''">PBLM_REVISION = #{pblmRevision},</if>
  379. <if test="pblmRevisionProof != null and pblmRevisionProof != ''">PBLM_REVISION_PROOF = #{pblmRevisionProof},</if>
  380. <if test="pblmMendNote != null and pblmMendNote != ''">PBLM_MEND_NOTE = #{pblmMendNote},</if>
  381. <if test="pblmMendState != null and pblmMendState != ''">PBLM_MEND_STATE = #{PBLM_MEND_STATE},</if>
  382. <if test="pblmMendPersNm != null and pblmMendPersNm != ''">PBLM_MEND_PERS_NM = #{PBLM_MEND_PERS_NM},</if>
  383. <if test="pblmMendPersId != null and pblmMendPersId != ''">PBLM_MEND_PERS_ID = #{pblmMendPersId},</if>
  384. <if test="pblmMendTm != null and pblmMendTm != ''">PBLM_MEND_TM = #{pblmMendTm},</if>
  385. <if test="relativeLaw != null "> RELATIVE_LAW = #{relativeLaw} , </if>
  386. <if test="lawContent != null "> LAW_CONTENT = #${lawContent}, </if>
  387. </trim>
  388. <include refid="page_where" />
  389. </update>
  390. <select id="countPblmInfoByStbJdNew" parameterType="cn.com.goldenwater.dcproj.param.TacPblmInfoParam" resultType="cn.com.goldenwater.dcproj.dto.TacCountDto">
  391. SELECT
  392. ( CASE WHEN count( * ) IS NULL THEN 0 ELSE count( * ) END ) AS count,
  393. (case when spfsnlType='质量实体' then '工程质量'
  394. when spfsnlType='质量行为' then '工程质量'
  395. when spfsnlType='安全管理' then '工程安全'
  396. else spfsnlType end ) AS name,
  397. pblmType,
  398. pblmPasi AS code
  399. FROM
  400. (
  401. SELECT
  402. (case when tb.SPFSNL_TYPE='计划管理' then '计划下达与执行' else tb.SPFSNL_TYPE end) AS spfsnlType,
  403. t.PBLM_PASI AS pblmPasi,
  404. tb.pblm_type AS pblmType,
  405. t.PBLM_NM
  406. FROM
  407. TAC_PROVINCE_PBLM_INFO t
  408. LEFT JOIN TAC_INSP_YEAR_BATCH_OBJ o ON o.id = t.obj_id
  409. LEFT JOIN TAC_OBJ_PBLMSTB tb ON tb.id = t.PBLMSTD_ID
  410. WHERE
  411. o.id IS NOT NULL
  412. AND t.pblm_pasi IS NOT NULL
  413. AND tb.id IS NOT NULL
  414. <include refid="choseSql"/>
  415. <if test="year != null">and o.year = #{year}
  416. </if>
  417. <if test="batch != null">and o.batch = #{batch}
  418. </if>
  419. <if test="type != null and type != ''">and r.type = #{type}
  420. </if>
  421. <if test="isPoverty != null and isPoverty != ''">and r.IS_POVERTY = #{isPoverty}
  422. </if>
  423. <if test="state != null and state != ''">
  424. and r.state = #{state}
  425. </if>
  426. <if test="searchStat != null and searchStat != ''">
  427. and t.RGSTR_ID like '%_${searchStat}'
  428. </if>
  429. <if test="objId != null and objId != ''">
  430. and t.obj_id = #{objId}
  431. </if>
  432. <if test="rgstrId != null and rgstrId !=''">
  433. and t.STEP_ID= #{rgstrId}
  434. </if>
  435. ) w
  436. WHERE
  437. w.spfsnlType NOT IN ( '质量管理—实体质量', '计划管理' )
  438. GROUP BY
  439. w.spfsnlType,
  440. w.pblmType,
  441. w.pblmPasi
  442. ORDER BY
  443. w.pblmType
  444. </select>
  445. <select id="countIfCasePblmJdNew" resultType="java.lang.Integer">
  446. SELECT
  447. count(*)
  448. FROM
  449. TAC_PROVINCE_PBLM_INFO t
  450. LEFT JOIN TAC_INSP_YEAR_BATCH_OBJ o ON o.id = t.obj_id
  451. LEFT JOIN TAC_OBJ_PBLMSTB tb ON tb.id = t.PBLMSTD_ID
  452. WHERE
  453. t.pblm_pasi IS NOT NULL
  454. AND tb.id IS NOT NULL
  455. <if test="year != null">and o.year = #{year}
  456. </if>
  457. <if test="batch != null">and o.batch = #{batch}
  458. </if>
  459. <if test="type != null and type != ''">and r.type = #{type}
  460. </if>
  461. <if test="isPoverty != null and isPoverty != ''">and r.IS_POVERTY = #{isPoverty}
  462. </if>
  463. <if test="state != null and state != ''">
  464. and r.state = #{state}
  465. </if>
  466. <if test="searchStat != null and searchStat != ''">
  467. and t.RGSTR_ID like '%_${searchStat}'
  468. </if>
  469. <if test="objId != null and objId != ''">
  470. and t.obj_id = #{objId}
  471. </if>
  472. <if test="rgstrId != null and rgstrId !=''">
  473. and t.STEP_ID= #{rgstrId}
  474. </if>
  475. <choose>
  476. <when test="ifCasePblm == 1">
  477. and t.IF_CASE_PBLM = 1
  478. </when>
  479. <otherwise>
  480. and (t.IF_CASE_PBLM = 0 or t.IF_CASE_PBLM is null)
  481. </otherwise>
  482. </choose>
  483. </select>
  484. <select id="countPblmInfoBySubJdNew" parameterType="cn.com.goldenwater.dcproj.param.TacPblmInfoParam" resultType="cn.com.goldenwater.dcproj.dto.TacCountDto">
  485. select t.SYS_TYPE as code,t.pblm_pasi as name, count(*) as count from (
  486. select distinct t.id,t.pblm_pasi,os.SYS_TYPE from TAC_PROVINCE_PBLM_INFO t left join
  487. 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
  488. left join TAC_PBLM_SUBJECT s on t.id = s.pblm_id left join tac_obj_subject os on s.sub_id = os.ID
  489. where t.pblm_pasi is not null and s.id is not null and s.sub_id is not null
  490. <include refid="choseSql"/>
  491. <if test="year != null">
  492. and o.year ='2020'
  493. </if>
  494. <if test="batch != null">
  495. and o.batch = #{batch}
  496. </if>
  497. <if test="type != null and type != ''">
  498. and r.type = #{type}
  499. </if>
  500. <if test="isPoverty != null and isPoverty != ''">
  501. and r.IS_POVERTY = #{isPoverty}
  502. </if>
  503. <if test="state != null and state != ''">
  504. and r.state = #{state}
  505. </if>
  506. <if test="searchStat != null and searchStat != ''">
  507. and t.RGSTR_ID like '%_${searchStat}'
  508. </if>
  509. <if test="rgstrId != null and rgstrId !=''">
  510. and t.STEP_ID= #{rgstrId}
  511. </if>
  512. ) t group by t.SYS_TYPE,t.pblm_pasi
  513. </select>
  514. <select id="countPblmInfoByAdCodeJdNew" parameterType="cn.com.goldenwater.dcproj.param.TacPblmInfoParam" resultType="cn.com.goldenwater.dcproj.dto.TacCountDto">
  515. select AD_Code as code, PBLM_PASI AS name, count(*) as count
  516. from (
  517. select t.*, a.ad_code, a.ad_name
  518. from TAC_PROVINCE_PBLM_INFO t
  519. left join TAC_PAWP_RGSTR r on t.obj_id = r.obj_id
  520. left join TAC_INSP_YEAR_BATCH_OBJ o on o.id = r.obj_id
  521. left join TAC_INSP_YEAR_BATCH_AREA a on a.GROUP_ID=o.GROUP_ID
  522. where r.id is not null
  523. and t.pblm_pasi is not null
  524. <include refid="choseSql"/>
  525. <if test="year != null">
  526. and o.year = #{year}
  527. </if>
  528. <if test="batch != null">
  529. and o.batch = #{batch}
  530. </if>
  531. <if test="type != null and type != ''">
  532. and r.type = #{type}
  533. </if>
  534. <if test="isPoverty != null and isPoverty != ''">
  535. and r.IS_POVERTY = #{isPoverty}
  536. </if>
  537. <if test="state != null and state != ''">
  538. and r.state = #{state}
  539. </if>
  540. <if test="searchStat != null and searchStat != ''">
  541. and t.RGSTR_ID like '%_${searchStat}'
  542. </if>
  543. <if test="rgstrId != null and rgstrId !=''">
  544. and t.STEP_ID= #{rgstrId}
  545. </if>
  546. )w group by w.AD_Code, w.AD_Name,w.PBLM_PASI order by w.COUNT desc
  547. </select>
  548. <select id="countPblmInfoByObjTypeJdNew" parameterType="cn.com.goldenwater.dcproj.param.TacPblmInfoParam" resultType="cn.com.goldenwater.dcproj.dto.TacCountDto">
  549. SELECT O.NAME, SUM(O.PBLM_SIZE) AS count FROM (
  550. SELECT B.TYPE AS NAME,
  551. COUNT(T.ID) PBLM_SIZE
  552. FROM TAC_INSP_YEAR_BATCH_OBJ O
  553. JOIN TAC_PAWP_RGSTR R ON O.ID = R.OBJ_ID
  554. LEFT JOIN TAC_ATT_PAWP_BASE B ON B.ID = O.OJB_ID
  555. LEFT JOIN TAC_PROVINCE_PBLM_INFO T ON T.RGSTR_ID = R.ID
  556. WHERE B.TYPE IS NOT NULL
  557. <include refid="choseSql"/>
  558. <if test="year != null">
  559. and O.year = #{year}
  560. </if>
  561. <if test="batch != null">
  562. and O.batch = #{batch}
  563. </if>
  564. <if test="rgstrId != null and rgstrId !=''">
  565. and t.STEP_ID= #{rgstrId}
  566. </if>
  567. GROUP BY B.TYPE
  568. ) O
  569. GROUP BY O.NAME
  570. ORDER BY O.NAME
  571. </select>
  572. <select id="countPblmInfoByQtJdNew" parameterType="cn.com.goldenwater.dcproj.param.TacPblmInfoParam" resultType="cn.com.goldenwater.dcproj.dto.TacCountDto">
  573. SELECT
  574. count( * ) AS count,
  575. a.showName,
  576. a.name
  577. FROM
  578. (
  579. SELECT
  580. t.LIST_TYPE as name,
  581. tp.PBLM_TYPE_DESC AS showName
  582. FROM
  583. TAC_PROVINCE_PBLM_INFO t
  584. LEFT JOIN TAC_OBJ_PBLMSTB tp ON t.PBLMSTD_ID = tp.id
  585. LEFT JOIN TAC_INSP_YEAR_BATCH_OBJ o ON o.id = t.obj_id
  586. WHERE
  587. t.PBLMSTD_ID IS NOT NULL
  588. AND tp.id IS NOT NULL
  589. and tp.PBLM_TYPE_DESC is not null
  590. and tp.PBLM_TYPE_DESC !='其他'
  591. <include refid="choseSql"/>
  592. <if test="year !=null">
  593. and o.year = #{year}
  594. </if>
  595. <if test="batch != null">
  596. and o.batch = #{batch}
  597. </if>
  598. <if test="stbClaName != null and stbClaName != ''">
  599. and t.LIST_TYPE = #{stbClaName}
  600. </if>
  601. <if test="rgstrId != null and rgstrId !=''">
  602. and t.STEP_ID= #{rgstrId}
  603. </if>
  604. ) A
  605. GROUP BY
  606. a.showName,
  607. a.name
  608. ORDER BY
  609. a.showName
  610. </select>
  611. <select id="countPblmInfoObjByQtJdNew" parameterType="cn.com.goldenwater.dcproj.param.TacPblmInfoParam" resultType="cn.com.goldenwater.dcproj.dto.TacCountDto">
  612. SELECT
  613. count( * ) AS count,
  614. a.showName,
  615. a.name
  616. FROM
  617. (
  618. SELECT
  619. DISTINCT
  620. t.PBLMSTD_ID,
  621. tp.PBLM_TYPE_DESC AS showName,
  622. t.LIST_TYPE as name
  623. FROM
  624. TAC_PROVINCE_PBLM_INFO t
  625. LEFT JOIN TAC_OBJ_PBLMSTB tp ON t.PBLMSTD_ID = tp.id
  626. LEFT JOIN TAC_INSP_YEAR_BATCH_OBJ o ON o.id = t.obj_id
  627. WHERE
  628. t.PBLMSTD_ID IS NOT NULL
  629. AND tp.id IS NOT NULL
  630. and tp.PBLM_TYPE_DESC is not null
  631. and tp.PBLM_TYPE_DESC !='其他'
  632. <include refid="choseSql"/>
  633. <if test="year !=null">
  634. and o.year = #{year}
  635. </if>
  636. <if test="batch != null">
  637. and o.batch = #{batch}
  638. </if>
  639. <if test="stbClaName != null and stbClaName != ''">
  640. and t.LIST_TYPE = #{stbClaName}
  641. </if>
  642. <if test="rgstrId != null and rgstrId !=''">
  643. and t.STEP_ID= #{rgstrId}
  644. </if>
  645. ) A
  646. GROUP BY
  647. a.name,a.showName
  648. ORDER BY
  649. a.showName
  650. </select>
  651. </mapper>