ObjInspPblmsDao.xml 23 KB

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