ObjInspPblmsDao.xml 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502
  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.ObjInspPblmsDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.ObjInspPblms" id="objInspPblmsResultMap">
  5. <result property="type" column="TYPE"/>
  6. <result property="objInspPblms" column="OBJ_INSP_PBLMS"/>
  7. <result property="guid" column="GUID"/>
  8. <result property="pguid" column="PGUID"/>
  9. <result property="sn" column="SN"/>
  10. <result property="inspPblmsName" column="INSP_PBLMS_NAME"/>
  11. <result property="inspObjType" column="INSP_OBJ_TYPE"/>
  12. <result property="sort1" column="SORT1"/>
  13. <result property="sort2" column="SORT2"/>
  14. <result property="relBasis" column="REL_BASIS"/>
  15. <result property="checkPoint" column="CHECK_POINT"/>
  16. <result property="inspPblmCate" column="INSP_PBLM_CATE"/>
  17. <result property="pblmDesc" column="PBLM_DESC"/>
  18. <result property="dataStat" column="DATA_STAT"/>
  19. <result property="collTime" column="COLL_TIME"/>
  20. <result property="recPers" column="REC_PERS"/>
  21. <result property="note" column="NOTE"/>
  22. <result property="attach" column="ATTACH"/>
  23. <result property="snClass" column="SN_CLASS"/>
  24. <result property="snNum" column="SN_NUM"/>
  25. <result property="orgId" column="ORG_ID"/>
  26. <result property="score" column="SCORE"/>
  27. </resultMap>
  28. <sql id="table_columns">
  29. SN_CLASS,
  30. ATTACH,
  31. TYPE ,
  32. OBJ_INSP_PBLMS ,
  33. GUID ,
  34. PGUID ,
  35. SN ,
  36. INSP_PBLMS_NAME ,
  37. INSP_OBJ_TYPE ,
  38. SORT1 ,
  39. SORT2 ,
  40. REL_BASIS ,
  41. CHECK_POINT ,
  42. PBLM_DESC ,
  43. INSP_PBLM_CATE ,
  44. DATA_STAT ,
  45. COLL_TIME ,
  46. REC_PERS ,
  47. NOTE,ORG_ID,SCORE
  48. </sql>
  49. <sql id="table_columns2">
  50. SN_CLASS,
  51. ATTACH,
  52. TYPE ,
  53. OBJ_INSP_PBLMS ,
  54. GUID ,
  55. PGUID ,
  56. SN ,
  57. INSP_PBLMS_NAME ,
  58. INSP_OBJ_TYPE ,
  59. SORT1 ,
  60. SORT2 ,
  61. REL_BASIS ,
  62. CHECK_POINT ,
  63. PBLM_DESC ,
  64. INSP_PBLM_CATE ,
  65. DATA_STAT ,
  66. COLL_TIME ,
  67. REC_PERS ,
  68. NOTE,ORG_ID,SCORE
  69. </sql>
  70. <sql id="entity_properties">
  71. #{snClass},
  72. #{attach},
  73. #{type},
  74. #{objInspPblms},
  75. #{guid},
  76. #{pguid},
  77. #{sn},
  78. #{inspPblmsName},
  79. #{inspObjType},
  80. #{sort1},
  81. #{sort2},
  82. #{relBasis},
  83. #{checkPoint},
  84. #{pblmDesc},
  85. #{inspPblmCate},
  86. #{dataStat},
  87. #{collTime},
  88. #{recPers},
  89. #{note},#{orgId},#{score}
  90. </sql>
  91. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  92. <sql id="page_where">
  93. <trim prefix="where" prefixOverrides="and | or ">
  94. <if test="type != null and type != ''">and TYPE = #{type}</if>
  95. <if test="objInspPblms != null and objInspPblms != ''">and OBJ_INSP_PBLMS = #{objInspPblms}</if>
  96. <if test="guid != null and guid != ''">and GUID = #{guid}</if>
  97. <if test="pguid != null and pguid != ''">and PGUID = #{pguid}</if>
  98. <if test="sn != null and sn != ''">and SN = #{sn}</if>
  99. <if test="inspPblmsName != null and inspPblmsName != ''">and INSP_PBLMS_NAME = #{inspPblmsName}</if>
  100. <if test="inspObjType != null and inspObjType != ''">and INSP_OBJ_TYPE = #{inspObjType}</if>
  101. <if test="sort1 != null and sort1 != ''">and SORT1 = #{sort1}</if>
  102. <if test="sort2 != null and sort2 != ''">and SORT2 = #{sort2}</if>
  103. <if test="relBasis != null and relBasis != ''">and REL_BASIS = #{relBasis}</if>
  104. <if test="checkPoint != null and checkPoint != ''">and CHECK_POINT like '%${checkPoint}%'</if>
  105. <if test="pblmDesc != null and pblmDesc != ''">and PBLM_DESC = #{pblmDesc}</if>
  106. <if test="inspPblmCate != null and inspPblmCate != ''">and INSP_PBLM_CATE = #{inspPblmCate}</if>
  107. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  108. <if test="collTime != null and collTime != ''">and COLL_TIME = #{collTime}</if>
  109. <if test="recPers != null and recPers != ''">and REC_PERS = #{recPers}</if>
  110. <if test="note != null and note != ''">and NOTE = #{note}</if>
  111. <if test="attach != null and attach != ''">and ATTACH = #{attach}</if>
  112. <if test="snClass != null and snClass != ''">and SN_CLASS = #{snClass}</if>
  113. <if test="snNum != null and snNum != ''">and SN_NUM = #{snNum}</if>
  114. <if test="sheet != null and sheet != ''">AND sheet = #{sheet}</if>
  115. </trim>
  116. </sql>
  117. <select id="findLastVersion" resultType="cn.com.goldenwater.dcproj.dto.DictDto" parameterType="String">
  118. select * from GW_SYS_DICT t where 1=1
  119. <if test="name !=null and name !=''">
  120. AND t.name=#{name}
  121. </if>
  122. </select>
  123. <select id="get" resultMap="objInspPblmsResultMap" parameterType="String">
  124. select
  125. <include refid="table_columns"/>
  126. from OBJ_INSP_PBLMS where GUID = #{id}
  127. </select>
  128. <select id="getBy" resultMap="objInspPblmsResultMap">
  129. select
  130. <include refid="table_columns"/>
  131. from OBJ_INSP_PBLMS
  132. <include refid="page_where"/>
  133. </select>
  134. <select id="findAll" resultMap="objInspPblmsResultMap">
  135. select
  136. <include refid="table_columns"/>
  137. from OBJ_INSP_PBLMS
  138. </select>
  139. <select id="findList" resultMap="objInspPblmsResultMap">
  140. select
  141. <include refid="table_columns"/>
  142. from OBJ_INSP_PBLMS
  143. <where>
  144. <if test="type != null and type != ''">and TYPE = #{type}</if>
  145. <if test="objInspPblms != null and objInspPblms != ''">and OBJ_INSP_PBLMS = #{objInspPblms}</if>
  146. <if test="guid != null and guid != ''">and GUID = #{guid}</if>
  147. <if test="pguid != null and pguid != ''">and PGUID = #{pguid}</if>
  148. <if test="sn != null and sn != ''">and SN = #{sn}</if>
  149. <if test="inspPblmsName != null and inspPblmsName != ''">and INSP_PBLMS_NAME = #{inspPblmsName}</if>
  150. <if test="inspObjType != null and inspObjType != ''">and INSP_OBJ_TYPE = #{inspObjType}</if>
  151. <if test="sort1 != null and sort1 != ''">and SORT1 = #{sort1}</if>
  152. <if test="sort2 != null and sort2 != ''">and SORT2 = #{sort2}</if>
  153. <if test="relBasis != null and relBasis != ''">and REL_BASIS = #{relBasis}</if>
  154. <if test="checkPoint != null and checkPoint != ''">and CHECK_POINT like '%${checkPoint}%'</if>
  155. <if test="pblmDesc != null and pblmDesc != ''">and PBLM_DESC = #{pblmDesc}</if>
  156. <if test="inspPblmCate != null and inspPblmCate != ''">and INSP_PBLM_CATE = #{inspPblmCate}</if>
  157. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  158. <if test="collTime != null and collTime != ''">and COLL_TIME = #{collTime}</if>
  159. <if test="recPers != null and recPers != ''">and REC_PERS = #{recPers}</if>
  160. <if test="note != null and note != ''">and NOTE = #{note}</if>
  161. <if test="attach != null and attach != ''">and ATTACH = #{attach}</if>
  162. <if test="snClass != null and snClass != ''">and SN_CLASS = #{snClass}</if>
  163. <if test="snNum != null and snNum != ''">and SN_NUM = #{snNum}</if>
  164. <if test="sheet != null and sheet != ''">AND sheet = #{sheet}</if>
  165. <choose>
  166. <when test="orgId!=null and orgId !=''">
  167. AND ORG_ID = #{orgId}
  168. </when>
  169. <otherwise>
  170. AND ORG_ID IS NULL
  171. </otherwise>
  172. </choose>
  173. </where>
  174. </select>
  175. <select id="selectCount" resultType="int">
  176. select count(GUID) from OBJ_INSP_PBLMS
  177. <include refid="page_where"/>
  178. </select>
  179. <select id="findPblmsDTO" resultType="cn.com.goldenwater.dcproj.dto.ObjInspPblmsDto">
  180. select s.guid,s.insp_pblms_name,s.check_point,s.insp_pblm_cate,s.pblm_desc,s.sn_num from obj_insp_pblms s where
  181. s.type=#{type} and s.data_stat ='1'
  182. <choose>
  183. <when test="orgId!=null and orgId !=''">
  184. and s.org_id=#{orgId}
  185. </when>
  186. <otherwise>
  187. and s.org_id is null
  188. </otherwise>
  189. </choose>
  190. <if test="pblmsName != null and pblmsName != ''">
  191. and s.pblm_desc like concat('%',concat(#{pblmsName},'%'))
  192. </if>
  193. order by s.attach asc,s.sn_num asc
  194. </select>
  195. <select id="findPblmsDtoName" resultType="cn.com.goldenwater.dcproj.dto.ObjInspPblmsDto">
  196. select w.insp_pblms_name from (
  197. select distinct insp_pblms_name,s.attach,s.sort1 from obj_insp_pblms s
  198. where type=#{type} and s.data_stat ='1'
  199. <choose>
  200. <when test="orgId!=null and orgId !=''">
  201. and s.org_id=#{orgId}
  202. </when>
  203. <otherwise>
  204. and s.org_id is null
  205. </otherwise>
  206. </choose>
  207. <if test="pblmsName != null and pblmsName != ''">
  208. and s.pblm_desc like concat('%',concat(#{pblmsName},'%'))
  209. </if>
  210. and sort1 is not null order by s.attach asc,sort1 asc
  211. ) w
  212. </select>
  213. <select id="findPblmsName" resultType="java.lang.String">
  214. select w.insp_pblms_name from (
  215. select distinct insp_pblms_name,s.attach from obj_insp_pblms s where type=1 and sort1 is not null order by s.attach asc
  216. ) w
  217. </select>
  218. <select id="getPblmNames" resultType="java.lang.String"
  219. parameterType="cn.com.goldenwater.dcproj.param.ObjInspPblmsParam">
  220. SELECT DISTINCT INSP_PBLMS_NAME FROM OBJ_INSP_PBLMS WHERE 1 = 1
  221. <if test="type != null and type != ''">and type = #{type}</if>
  222. <choose>
  223. <when test="orgId != null and orgId != ''">
  224. AND org_id = #{orgId}
  225. </when>
  226. <otherwise>
  227. AND org_id is null
  228. </otherwise>
  229. </choose>
  230. </select>
  231. <select id="findWagaPblm" resultMap="objInspPblmsResultMap" parameterType="java.lang.String">
  232. select * from obj_insp_pblms s where s.attach=#{attach} and type=6
  233. and s.sn in (${sn}) and s.data_stat ='1'
  234. </select>
  235. <select id="findPblmsCheckPoints" resultType="java.lang.String"
  236. parameterType="cn.com.goldenwater.dcproj.param.ObjInspPblmsParam">
  237. select distinct check_point from obj_insp_pblms s where s.type=#{type}
  238. <if test="inspPblmsName != null and inspPblmsName != ''">
  239. and s.insp_pblms_name=#{inspPblmsName}
  240. </if>
  241. <choose>
  242. <when test="orgId != null and orgId != ''">
  243. AND org_id = #{orgId}
  244. </when>
  245. <otherwise>
  246. AND org_id is null
  247. </otherwise>
  248. </choose>
  249. and
  250. s.attach in ('1','2') and s.data_stat ='1'
  251. </select>
  252. <select id="findPblmsDesc" resultType="java.lang.String" parameterType="java.util.Map">
  253. select pblm_desc from obj_insp_pblms s where s.check_point=#{checkPoint} and s.type=#{type}
  254. <if test="inspPblmsName != null and inspPblmsName != ''">
  255. and s.insp_pblms_name=#{inspPblmsName}
  256. </if>
  257. <choose>
  258. <when test="orgId != null and orgId != ''">
  259. AND org_id = #{orgId}
  260. </when>
  261. <otherwise>
  262. AND org_id is null
  263. </otherwise>
  264. </choose>
  265. and s.data_stat ='1' and s.attach in ('1','2') order by sort2 asc
  266. </select>
  267. <select id="getByPblms" resultMap="objInspPblmsResultMap" parameterType="java.util.Map">
  268. select * from obj_insp_pblms s where s.insp_pblms_name=#{inspPblmsName} and s.type=#{type} and
  269. s.check_point=#{checkPoint}
  270. <choose>
  271. <when test="orgId != null and orgId != ''">
  272. AND org_id = #{orgId}
  273. </when>
  274. <otherwise>
  275. AND org_id is null
  276. </otherwise>
  277. </choose>
  278. and s.pblm_desc like '${pblmDesc}' and s.attach in ('1','2')
  279. order by sort2 asc
  280. </select>
  281. <select id="getPblmsByType" resultMap="objInspPblmsResultMap"
  282. parameterType="cn.com.goldenwater.dcproj.param.ObjInspPblmsParam">
  283. select * from obj_insp_pblms s where s.type=#{type}
  284. <if test="inspPblmsName != null and inspPblmsName != ''">
  285. and s.insp_pblms_name=#{inspPblmsName}
  286. </if>
  287. and
  288. s.check_point=#{checkPoint} and s.data_stat ='1'
  289. <choose>
  290. <when test="orgId != null and orgId != ''">
  291. AND org_id = #{orgId}
  292. </when>
  293. <otherwise>
  294. AND org_id is null
  295. </otherwise>
  296. </choose>
  297. <if test="pblmDesc !=null and pblmDesc !=''">
  298. and s.pblm_desc like concat('%',concat(#{pblmDesc},'%'))
  299. </if>
  300. and s.attach in ('1','2')
  301. order by sort2 asc
  302. </select>
  303. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.ObjInspPblms">
  304. insert into OBJ_INSP_PBLMS(
  305. <include refid="table_columns2"/>
  306. )
  307. values (
  308. <include refid="entity_properties"/>
  309. )
  310. </insert>
  311. <delete id="delete" parameterType="java.lang.String">
  312. delete from OBJ_INSP_PBLMS where GUID = #{id}
  313. </delete>
  314. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.ObjInspPblms">
  315. delete from OBJ_INSP_PBLMS
  316. <include refid="page_where"/>
  317. </delete>
  318. <update id="deleteInFlag" parameterType="java.lang.String">
  319. update OBJ_INSP_PBLMS set flag_valid = 0 where GUID = #{id}
  320. </update>
  321. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.ObjInspPblms">
  322. update OBJ_INSP_PBLMS
  323. <trim prefix="set" suffixOverrides=",">
  324. <if test="type != null and type != ''">TYPE = #{type},</if>
  325. <if test="objInspPblms != null and objInspPblms != ''">OBJ_INSP_PBLMS = #{objInspPblms},</if>
  326. <if test="guid != null and guid != ''">GUID = #{guid},</if>
  327. <if test="pguid != null and pguid != ''">PGUID = #{pguid},</if>
  328. <if test="sn != null and sn != ''">SN = #{sn},</if>
  329. <if test="inspPblmsName != null and inspPblmsName != ''">INSP_PBLMS_NAME = #{inspPblmsName},</if>
  330. <if test="inspObjType != null and inspObjType != ''">INSP_OBJ_TYPE = #{inspObjType},</if>
  331. <if test="sort1 != null and sort1 != ''">SORT1 = #{sort1},</if>
  332. <if test="sort2 != null and sort2 != ''">SORT2 = #{sort2},</if>
  333. <if test="relBasis != null and relBasis != ''">REL_BASIS = #{relBasis},</if>
  334. <if test="checkPoint != null and checkPoint != ''">CHECK_POINT = #{checkPoint},</if>
  335. <if test="pblmDesc != null and pblmDesc != ''">PBLM_DESC = #{pblmDesc},</if>
  336. <if test="inspPblmCate != null and inspPblmCate != ''">INSP_PBLM_CATE = #{inspPblmCate},</if>
  337. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  338. <if test="collTime != null and collTime != ''">COLL_TIME = #{collTime},</if>
  339. <if test="recPers != null and recPers != ''">REC_PERS = #{recPers},</if>
  340. <if test="note != null and note != ''">NOTE = #{note},</if>
  341. <if test="attach != null and attach != ''">ATTACH = #{attach},</if>
  342. <if test="snClass != null and snClass != ''">SN_CLASS = #{snClass},</if>
  343. </trim>
  344. <where>GUID = #{guid}</where>
  345. </update>
  346. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.ObjInspPblms">
  347. update OBJ_INSP_PBLMS
  348. <trim prefix="set" suffixOverrides=",">
  349. <if test="type != null and type != ''">TYPE = #{type},</if>
  350. <if test="objInspPblms != null and objInspPblms != ''">OBJ_INSP_PBLMS = #{objInspPblms},</if>
  351. <if test="guid != null and guid != ''">GUID = #{guid},</if>
  352. <if test="pguid != null and pguid != ''">PGUID = #{pguid},</if>
  353. <if test="sn != null and sn != ''">SN = #{sn},</if>
  354. <if test="inspPblmsName != null and inspPblmsName != ''">INSP_PBLMS_NAME = #{inspPblmsName},</if>
  355. <if test="inspObjType != null and inspObjType != ''">INSP_OBJ_TYPE = #{inspObjType},</if>
  356. <if test="sort1 != null and sort1 != ''">SORT1 = #{sort1},</if>
  357. <if test="sort2 != null and sort2 != ''">SORT2 = #{sort2},</if>
  358. <if test="relBasis != null and relBasis != ''">REL_BASIS = #{relBasis},</if>
  359. <if test="checkPoint != null and checkPoint != ''">CHECK_POINT = #{checkPoint},</if>
  360. <if test="pblmDesc != null and pblmDesc != ''">PBLM_DESC = #{pblmDesc},</if>
  361. <if test="inspPblmCate != null and inspPblmCate != ''">INSP_PBLM_CATE = #{inspPblmCate},</if>
  362. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  363. <if test="collTime != null and collTime != ''">COLL_TIME = #{collTime},</if>
  364. <if test="recPers != null and recPers != ''">REC_PERS = #{recPers},</if>
  365. <if test="note != null and note != ''">NOTE = #{note},</if>
  366. <if test="attach != null and attach != ''">ATTACH = #{attach},</if>
  367. <if test="snClass != null and snClass != ''">SN_CLASS = #{snClass},</if>
  368. </trim>
  369. <include refid="page_where"/>
  370. </update>
  371. <!-- 其他自定义SQL -->
  372. <select id="getPblmsTypeBySnAttType" resultType="java.util.Map" parameterType="java.util.Map">
  373. select distinct ATTACH,SHEET,SORT1,INSP_PBLMS_NAME from OBJ_INSP_PBLMS WHERE 1=1
  374. <if test="type != null and type != ''">AND TYPE = #{type}</if>
  375. <if test="fileNum != null and fileNum != ''">AND attach = #{fileNum}</if>
  376. <choose>
  377. <when test="orgId != null and orgId != ''">
  378. AND org_id = #{orgId}
  379. </when>
  380. <otherwise>
  381. AND org_id is null
  382. </otherwise>
  383. </choose>
  384. <if test="sheetNum != null and sheetNum != ''">AND sheet = #{sheetNum}</if>
  385. <if test="snList != null and snList.size > 0">
  386. and sn_num in
  387. <foreach collection="snList" index="index" item="item" open="(" separator="," close=")">
  388. ${item}
  389. </foreach>
  390. </if>
  391. order by attach,sheet,sort1
  392. </select>
  393. <select id="getPblmsCheckBySnAttType" resultType="java.util.Map" parameterType="java.util.Map">
  394. select distinct ATTACH,SHEET,SORT1,SORT2,CHECK_POINT from OBJ_INSP_PBLMS WHERE data_stat ='1'
  395. <if test="type != null and type != ''">AND TYPE = #{type}</if>
  396. <if test="fileNum != null and fileNum != ''">AND attach = #{fileNum}</if>
  397. <if test="sort1 != null and sort1 != ''">AND sort1 = #{sort1}</if>
  398. <choose>
  399. <when test="orgId != null and orgId != ''">
  400. AND org_id = #{orgId}
  401. </when>
  402. <otherwise>
  403. AND org_id is null
  404. </otherwise>
  405. </choose>
  406. <if test="snList != null and snList.size > 0">
  407. and sn_num in
  408. <foreach collection="snList" index="index" item="item" open="(" separator="," close=")">
  409. ${item}
  410. </foreach>
  411. </if>
  412. order by attach,sheet,sort1,sort2
  413. </select>
  414. <select id="getPblmsBySnAttTypeSort" resultType="cn.com.goldenwater.dcproj.model.ObjInspPblms"
  415. parameterType="java.util.Map">
  416. select * from OBJ_INSP_PBLMS WHERE data_stat ='1'
  417. <if test="type != null and type != ''">AND TYPE = #{type}</if>
  418. <if test="fileNum != null and fileNum != ''">AND attach = #{fileNum}</if>
  419. <if test="sort1 != null and sort1 != ''">AND sort1 = #{sort1}</if>
  420. <if test="orgId != null and orgId != ''">AND org_id = #{orgId}</if>
  421. <choose>
  422. <when test="orgId != null and orgId != ''">
  423. AND org_id = #{orgId}
  424. </when>
  425. <otherwise>
  426. AND org_id is null
  427. </otherwise>
  428. </choose>
  429. <if test="sort2 != null and sort2 != ''">AND sort2 = #{sort2}</if>
  430. <if test="snList != null and snList.size > 0">
  431. and sn_num in
  432. <foreach collection="snList" index="index" item="item" open="(" separator="," close=")">
  433. ${item}
  434. </foreach>
  435. </if>
  436. order by sn_num
  437. </select>
  438. <select id="getPblmIdsList" resultType="java.lang.String" parameterType="java.util.HashMap">
  439. select GUID from OBJ_INSP_PBLMS WHERE data_stat ='1'
  440. <if test="type != null and type != ''">AND TYPE = #{type}</if>
  441. <if test="fileNum != null and fileNum != ''">AND attach = #{fileNum}</if>
  442. <if test="sort1 != null and sort1 != ''">AND sort1 = #{sort1}</if>
  443. <choose>
  444. <when test="orgId != null and orgId != ''">
  445. AND ORG_ID = #{orgId}
  446. </when>
  447. <otherwise>
  448. AND ORG_ID is null
  449. </otherwise>
  450. </choose>
  451. <if test="snList != null and snList.size > 0">
  452. and sn_num in
  453. <foreach collection="snList" index="index" item="item" open="(" separator="," close=")">
  454. ${item}
  455. </foreach>
  456. </if>
  457. </select>
  458. <select id="selectIndexList" resultMap="objInspPblmsResultMap">
  459. select GUID , TYPE , INSP_PBLMS_NAME ,SORT1 , SORT2 , CHECK_POINT , PBLM_DESC , INSP_PBLM_CATE ,SN_NUM
  460. from OBJ_INSP_PBLMS
  461. where TYPE in
  462. <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
  463. #{item}
  464. </foreach>
  465. order by cast(SN_NUM as unsigned )
  466. </select>
  467. </mapper>