BisInspStndRgstrDao.xml 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431
  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.BisInspStndRgstrDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspStndRgstr" id="bisInspStndRgstrResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="objId" column="OBJ_ID"/>
  7. <result property="rsCode" column="RS_CODE"/>
  8. <result property="rsvrNm" column="RSVR_NM"/>
  9. <result property="adCode" column="AD_CODE"/>
  10. <result property="resCreateTime" column="RES_CREATE_TIME"/>
  11. <result property="engScal" column="ENG_SCAL"/>
  12. <result property="totCap" column="TOT_CAP"/>
  13. <result property="hystSite" column="HYST_SITE"/>
  14. <result property="hasDamRegCode" column="HAS_DAM_REG_CODE"/>
  15. <result property="damRegCode" column="DAM_REG_CODE"/>
  16. <result property="damType" column="DAM_TYPE"/>
  17. <result property="resCreateTimeNote" column="RES_CREATE_TIME_NOTE"/>
  18. <result property="engScalNote" column="ENG_SCAL_NOTE"/>
  19. <result property="groupId" column="GROUP_ID"/>
  20. <result property="groupLeader" column="GROUP_LEADER"/>
  21. <result property="groupLeaderTel" column="GROUP_LEADER_TEL"/>
  22. <result property="recPersId" column="REC_PERS_ID"/>
  23. <result property="recPers" column="REC_PERS"/>
  24. <result property="recPersTel" column="REC_PERS_TEL"/>
  25. <result property="state" column="STATE"/>
  26. <result property="dtyminState" column="DTYMIN_STATE"/>
  27. <result property="mgamtState" column="MGAMT_STATE"/>
  28. <result property="plrdState" column="PLRD_STATE"/>
  29. <result property="persId" column="PERS_ID"/>
  30. <result property="note" column="NOTE"/>
  31. <result property="intm" column="INTM"/>
  32. <result property="uptm" column="UPTM"/>
  33. <result property="dataStat" column="DATA_STAT"/>
  34. <result property="jxDuty" column="JX_DUTY"/>
  35. <result property="jxDutyPhone" column="JX_DUTY_PHONE"/>
  36. <result property="jxRsvrType" column="JX_RSVR_TYPE"/>
  37. <result property="jxRsvrStndLev" column="JX_RSVR_STND_LEV"/>
  38. <result property="rsAdmName" column="RS_ADM_NAME"/>
  39. <result property="rsAdmCode" column="RS_ADM_CODE"/>
  40. <result property="adNm" column="AD_NM"/>
  41. <result property="damSizeHig" column="DAM_SIZE_HIG"/>
  42. <result property="centerX" column="CENTER_X"/>
  43. <result property="centerY" column="CENTER_Y"/>
  44. <result property="centerXGd" column="CENTER_X_GD"/>
  45. <result property="centerYGd" column="CENTER_Y_GD"/>
  46. </resultMap>
  47. <sql id="table_columns">
  48. ID,
  49. OBJ_ID,
  50. RS_CODE,
  51. RSVR_NM,
  52. AD_CODE,
  53. RES_CREATE_TIME,
  54. ENG_SCAL,
  55. TOT_CAP,
  56. HYST_SITE,
  57. HAS_DAM_REG_CODE,
  58. DAM_REG_CODE,
  59. DAM_TYPE,
  60. RES_CREATE_TIME_NOTE,
  61. ENG_SCAL_NOTE,
  62. GROUP_ID,
  63. GROUP_LEADER,
  64. GROUP_LEADER_TEL,
  65. REC_PERS_ID,
  66. REC_PERS,
  67. REC_PERS_TEL,
  68. STATE,
  69. DTYMIN_STATE,
  70. MGAMT_STATE,
  71. PLRD_STATE,
  72. PERS_ID,
  73. NOTE,
  74. INTM,
  75. UPTM,
  76. DATA_STAT,
  77. JX_DUTY,
  78. JX_DUTY_PHONE,
  79. JX_RSVR_TYPE,
  80. JX_RSVR_STND_LEV,
  81. RS_ADM_NAME,
  82. RS_ADM_CODE,
  83. AD_NM,
  84. DAM_SIZE_HIG,
  85. CENTER_X,
  86. CENTER_Y,
  87. CENTER_X_GD,
  88. CENTER_Y_GD
  89. </sql>
  90. <sql id="entity_properties">
  91. #{id},
  92. #{objId},
  93. #{rsCode},
  94. #{rsvrNm},
  95. #{adCode},
  96. #{resCreateTime},
  97. #{engScal},
  98. #{totCap},
  99. #{hystSite},
  100. #{hasDamRegCode},
  101. #{damRegCode},
  102. #{damType},
  103. #{resCreateTimeNote},
  104. #{engScalNote},
  105. #{groupId},
  106. #{groupLeader},
  107. #{groupLeaderTel},
  108. #{recPersId},
  109. #{recPers},
  110. #{recPersTel},
  111. #{state},
  112. #{dtyminState},
  113. #{mgamtState},
  114. #{plrdState},
  115. #{persId},
  116. #{note},
  117. #{intm},
  118. #{uptm},
  119. #{dataStat},
  120. #{jxDuty},
  121. #{jxDutyPhone},
  122. #{jxRsvrType},
  123. #{jxRsvrStndLev},
  124. #{rsAdmName},
  125. #{rsAdmCode},
  126. #{adNm},
  127. #{damSizeHig},
  128. #{centerX},
  129. #{centerY},
  130. #{centerXGd},
  131. #{centerYGd}
  132. </sql>
  133. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  134. <sql id="page_where">
  135. <trim prefix="where" prefixOverrides="and | or ">
  136. <if test="objId != null and objId != ''">and OBJ_ID = #{objId}</if>
  137. <if test="rsCode != null and rsCode != ''">and RS_CODE = #{rsCode}</if>
  138. <if test="rsvrNm != null and rsvrNm != ''">and RSVR_NM = #{rsvrNm}</if>
  139. <if test="adCode != null and adCode != ''">and AD_CODE = #{adCode}</if>
  140. <if test="resCreateTime != null">and RES_CREATE_TIME = #{resCreateTime}</if>
  141. <if test="engScal != null and engScal != ''">and ENG_SCAL = #{engScal}</if>
  142. <if test="totCap != null and totCap != ''">and TOT_CAP = #{totCap}</if>
  143. <if test="hystSite != null and hystSite != ''">and HYST_SITE = #{hystSite}</if>
  144. <if test="hasDamRegCode != null and hasDamRegCode != ''">and HAS_DAM_REG_CODE = #{hasDamRegCode}</if>
  145. <if test="damRegCode != null and damRegCode != ''">and DAM_REG_CODE = #{damRegCode}</if>
  146. <if test="damType != null and damType != ''">and DAM_TYPE = #{damType}</if>
  147. <if test="resCreateTimeNote != null and resCreateTimeNote != ''">and RES_CREATE_TIME_NOTE = #{resCreateTimeNote}</if>
  148. <if test="engScalNote != null and engScalNote != ''">and ENG_SCAL_NOTE = #{engScalNote}</if>
  149. <if test="groupId != null and groupId != ''">and GROUP_ID = #{groupId}</if>
  150. <if test="groupLeader != null and groupLeader != ''">and GROUP_LEADER = #{groupLeader}</if>
  151. <if test="groupLeaderTel != null and groupLeaderTel != ''">and GROUP_LEADER_TEL = #{groupLeaderTel}</if>
  152. <if test="recPersId != null and recPersId != ''">and REC_PERS_ID = #{recPersId}</if>
  153. <if test="recPers != null and recPers != ''">and REC_PERS = #{recPers}</if>
  154. <if test="recPersTel != null and recPersTel != ''">and REC_PERS_TEL = #{recPersTel}</if>
  155. <if test="state != null and state != ''">and STATE = #{state}</if>
  156. <if test="dtyminState != null and dtyminState != ''">and DTYMIN_STATE = #{dtyminState}</if>
  157. <if test="mgamtState != null and mgamtState != ''">and MGAMT_STATE = #{mgamtState}</if>
  158. <if test="plrdState != null and plrdState != ''">and PLRD_STATE = #{plrdState}</if>
  159. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  160. <if test="note != null and note != ''">and NOTE = #{note}</if>
  161. <if test="intm != null">and INTM = #{intm}</if>
  162. <if test="uptm != null">and UPTM = #{uptm}</if>
  163. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  164. <if test="jxDuty != null and jxDuty != ''">and JX_DUTY= #{jxDuty}</if>
  165. <if test="jxDutyPhone != null and jxDutyPhone != ''">and JX_DUTY_PHONE = #{jxDutyPhone}</if>
  166. <if test="jxRsvrType != null and jxRsvrType != ''">and JX_RSVR_TYPE = #{jxRsvrType}</if>
  167. <if test="jxRsvrStndLev != null and jxRsvrStndLev != ''">and JX_RSVR_STND_LEV = #{jxRsvrStndLev}</if>
  168. <if test="rsAdmName != null and rsAdmName != ''">and RS_ADM_NAME = #{rsAdmName}</if>
  169. <if test="rsAdmCode != null and rsAdmCode != ''">and RS_ADM_CODE = #{rsAdmCode}</if>
  170. <if test="adNm != null and adNm != ''">and AD_NM = #{adNm}</if>
  171. and DATA_STAT='0'
  172. </trim>
  173. </sql>
  174. <select id="get" resultMap="bisInspStndRgstrResultMap" parameterType="String" >
  175. select <include refid="table_columns" /> from BIS_INSP_STND_RGSTR where ID = #{id}
  176. </select>
  177. <select id="getBy" resultMap="bisInspStndRgstrResultMap">
  178. select <include refid="table_columns" /> from BIS_INSP_STND_RGSTR <include refid="page_where" />
  179. </select>
  180. <select id="findAll" resultMap="bisInspStndRgstrResultMap">
  181. select <include refid="table_columns" /> from BIS_INSP_STND_RGSTR
  182. </select>
  183. <select id="findList" resultMap="bisInspStndRgstrResultMap">
  184. select <include refid="table_columns" /> from BIS_INSP_STND_RGSTR <include refid="page_where" />
  185. </select>
  186. <select id="selectCount" resultType="int" >
  187. select count(ID) from BIS_INSP_STND_RGSTR <include refid="page_where" />
  188. </select>
  189. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspStndRgstr">
  190. insert into BIS_INSP_STND_RGSTR( <include refid="table_columns" /> )
  191. values ( <include refid="entity_properties" /> )
  192. </insert>
  193. <delete id="delete" parameterType="java.lang.String">
  194. update BIS_INSP_STND_RGSTR set DATA_STAT='9' where ID = #{id}
  195. </delete>
  196. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspStndRgstr">
  197. update BIS_INSP_STND_RGSTR set DATA_STAT='9' <include refid="page_where" />
  198. </delete>
  199. <update id="deleteInFlag" parameterType="java.lang.String">
  200. update BIS_INSP_STND_RGSTR set DATA_STAT = '9' where ID = #{id}
  201. </update>
  202. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspStndRgstr">
  203. update BIS_INSP_STND_RGSTR
  204. <trim prefix="set" suffixOverrides=",">
  205. <if test="objId != null and objId != ''">OBJ_ID = #{objId},</if>
  206. <if test="rsCode != null and rsCode != ''">RS_CODE = #{rsCode},</if>
  207. <if test="rsvrNm != null and rsvrNm != ''">RSVR_NM = #{rsvrNm},</if>
  208. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  209. <if test="resCreateTime != null">RES_CREATE_TIME = #{resCreateTime},</if>
  210. <if test="engScal != null and engScal != ''">ENG_SCAL = #{engScal},</if>
  211. <if test="totCap != null and totCap != ''">TOT_CAP = #{totCap},</if>
  212. <if test="hystSite != null and hystSite != ''">HYST_SITE = #{hystSite},</if>
  213. <if test="hasDamRegCode != null and hasDamRegCode != ''">HAS_DAM_REG_CODE = #{hasDamRegCode},</if>
  214. <if test="damRegCode != null and damRegCode != ''">DAM_REG_CODE = #{damRegCode},</if>
  215. <if test="damType != null and damType != ''">DAM_TYPE = #{damType},</if>
  216. <if test="resCreateTimeNote != null and resCreateTimeNote != ''">RES_CREATE_TIME_NOTE = #{resCreateTimeNote},</if>
  217. <if test="engScalNote != null and engScalNote != ''">ENG_SCAL_NOTE = #{engScalNote},</if>
  218. <if test="groupId != null and groupId != ''">GROUP_ID = #{groupId},</if>
  219. <if test="groupLeader != null and groupLeader != ''">GROUP_LEADER = #{groupLeader},</if>
  220. <if test="groupLeaderTel != null and groupLeaderTel != ''">GROUP_LEADER_TEL = #{groupLeaderTel},</if>
  221. <if test="recPersId != null and recPersId != ''">REC_PERS_ID = #{recPersId},</if>
  222. <if test="recPers != null and recPers != ''">REC_PERS = #{recPers},</if>
  223. <if test="recPersTel != null and recPersTel != ''">REC_PERS_TEL = #{recPersTel},</if>
  224. <if test="state != null and state != ''">STATE = #{state},</if>
  225. <if test="dtyminState != null and dtyminState != ''">DTYMIN_STATE = #{dtyminState},</if>
  226. <if test="mgamtState != null and mgamtState != ''">MGAMT_STATE = #{mgamtState},</if>
  227. <if test="plrdState != null and plrdState != ''">PLRD_STATE = #{plrdState},</if>
  228. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  229. <if test="note != null and note != ''">NOTE = #{note},</if>
  230. <if test="intm != null">INTM = #{intm},</if>
  231. <if test="uptm != null">UPTM = #{uptm},</if>
  232. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  233. <if test="jxDuty!= null and jxDuty != ''">JX_DUTY = #{jxDuty},</if>
  234. <if test="jxDutyPhone != null and jxDutyPhone != ''">JX_DUTY_PHONE = #{jxDutyPhone},</if>
  235. <if test="jxRsvrType != null and jxRsvrType != ''">JX_RSVR_TYPE = #{jxRsvrType},</if>
  236. <if test="jxRsvrStndLev != null and jxRsvrStndLev != ''">JX_RSVR_STND_LEV = #{jxRsvrStndLev},</if>
  237. <if test="rsAdmName != null and rsAdmName != ''">RS_ADM_NAME = #{rsAdmName},</if>
  238. <if test="rsAdmCode != null and rsAdmCode != ''">RS_ADM_CODE = #{rsAdmCode},</if>
  239. <if test="adNm != null and adNm != ''">AD_NM = #{adNm},</if>
  240. <if test="damSizeHig != null and damSizeHig != ''">DAM_SIZE_HIG = #{damSizeHig},</if>
  241. <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
  242. <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
  243. <if test="centerXGd != null and centerXGd != ''">CENTER_X_GD = #{centerXGd},</if>
  244. <if test="centerYGd != null and centerYGd != ''">CENTER_Y_GD = #{centerYGd},</if>
  245. </trim>
  246. <where>ID = #{id}</where>
  247. </update>
  248. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspStndRgstr">
  249. update BIS_INSP_STND_RGSTR
  250. <trim prefix="set" suffixOverrides=",">
  251. <if test="objId != null and objId != ''">OBJ_ID = #{objId},</if>
  252. <if test="rsCode != null and rsCode != ''">RS_CODE = #{rsCode},</if>
  253. <if test="rsvrNm != null and rsvrNm != ''">RSVR_NM = #{rsvrNm},</if>
  254. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  255. <if test="resCreateTime != null">RES_CREATE_TIME = #{resCreateTime},</if>
  256. <if test="engScal != null and engScal != ''">ENG_SCAL = #{engScal},</if>
  257. <if test="totCap != null and totCap != ''">TOT_CAP = #{totCap},</if>
  258. <if test="hystSite != null and hystSite != ''">HYST_SITE = #{hystSite},</if>
  259. <if test="hasDamRegCode != null and hasDamRegCode != ''">HAS_DAM_REG_CODE = #{hasDamRegCode},</if>
  260. <if test="damRegCode != null and damRegCode != ''">DAM_REG_CODE = #{damRegCode},</if>
  261. <if test="damType != null and damType != ''">DAM_TYPE = #{damType},</if>
  262. <if test="resCreateTimeNote != null and resCreateTimeNote != ''">RES_CREATE_TIME_NOTE = #{resCreateTimeNote},</if>
  263. <if test="engScalNote != null and engScalNote != ''">ENG_SCAL_NOTE = #{engScalNote},</if>
  264. <if test="groupId != null and groupId != ''">GROUP_ID = #{groupId},</if>
  265. <if test="groupLeader != null and groupLeader != ''">GROUP_LEADER = #{groupLeader},</if>
  266. <if test="groupLeaderTel != null and groupLeaderTel != ''">GROUP_LEADER_TEL = #{groupLeaderTel},</if>
  267. <if test="recPersId != null and recPersId != ''">REC_PERS_ID = #{recPersId},</if>
  268. <if test="recPers != null and recPers != ''">REC_PERS = #{recPers},</if>
  269. <if test="recPersTel != null and recPersTel != ''">REC_PERS_TEL = #{recPersTel},</if>
  270. <if test="state != null and state != ''">STATE = #{state},</if>
  271. <if test="dtyminState != null and dtyminState != ''">DTYMIN_STATE = #{dtyminState},</if>
  272. <if test="mgamtState != null and mgamtState != ''">MGAMT_STATE = #{mgamtState},</if>
  273. <if test="plrdState != null and plrdState != ''">PLRD_STATE = #{plrdState},</if>
  274. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  275. <if test="note != null and note != ''">NOTE = #{note},</if>
  276. <if test="intm != null">INTM = #{intm},</if>
  277. <if test="uptm != null">UPTM = #{uptm},</if>
  278. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  279. <if test="jxDuty!= null and jxDuty != ''">JX_DUTY = #{jxDuty},</if>
  280. <if test="jxDutyPhone != null and jxDutyPhone != ''">JX_DUTY_PHONE = #{jxDutyPhone},</if>
  281. <if test="jxRsvrType != null and jxRsvrType != ''">JX_RSVR_TYPE = #{jxRsvrType},</if>
  282. <if test="jxRsvrStndLev != null and jxRsvrStndLev != ''">JX_RSVR_STND_LEV = #{jxRsvrStndLev},</if>
  283. <if test="rsAdmName != null and rsAdmName != ''">RS_ADM_NAME = #{rsAdmName},</if>
  284. <if test="rsAdmCode != null and rsAdmCode != ''">RS_ADM_CODE = #{rsAdmCode},</if>
  285. <if test="adNm != null and adNm != ''">AD_NM = #{adNm},</if>
  286. <if test="damSizeHig != null and damSizeHig != ''">DAM_SIZE_HIG = #{damSizeHig},</if>
  287. <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
  288. <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
  289. <if test="centerXGd != null and centerXGd != ''">CENTER_X_GD = #{centerXGd},</if>
  290. <if test="centerYGd != null and centerYGd != ''">CENTER_Y_GD = #{centerYGd},</if>
  291. </trim>
  292. <include refid="page_where" />
  293. </update>
  294. <!-- 其他自定义SQL -->
  295. <select id="findStndRgstrPage" resultType="cn.com.goldenwater.dcproj.dto.BisInspRgstrDto"
  296. parameterType="cn.com.goldenwater.dcproj.param.TypeParam">
  297. select * from (
  298. SELECT A.code,
  299. (case when b.rsvr_nm is null then A.nm else b.rsvr_nm end) nm,
  300. A.id groupId,
  301. A.ID,
  302. A.pType,
  303. A.OBJ_INTM,
  304. A.OBJ_ID,
  305. c.pnm groupName,
  306. A.Is_Set_Obj,
  307. (CASE WHEN B.STATE IS NULL THEN '0' ELSE B.STATE END) AS wtdstState,
  308. (case when b.eng_scal is null then cast(e.eng_scal as char) else b.eng_scal end) eng_scal,
  309. b.state,
  310. (case when b.hyst_site is null then cast(e.location as char) else b.hyst_site end) as hyst_site,
  311. (case when b.hyst_site is null then cast(e.location as char) else b.hyst_site end) location,
  312. b.id rgstrId,
  313. b.rsvr_nm rsvrNm,
  314. b.ad_code adCode,
  315. b.res_create_time resCreateTime,
  316. b.tot_cap totCap,
  317. b.dam_reg_code damRegCode,
  318. b.dam_type damType,
  319. b.has_dam_reg_code hasDamRegCode,
  320. b.res_create_time_note resCreateTimeNote,
  321. b.eng_scal_note engScalNote,
  322. b.group_leader groupLeader,
  323. b.group_leader_tel groupLeaderTel,
  324. b.rec_pers_id recPersId,
  325. b.rec_pers recPers,
  326. b.rec_pers_tel recPersTel,
  327. b.uptm,
  328. b.intm,
  329. b.note,
  330. b.dtymin_state,
  331. b.mgamt_state,
  332. b.plrd_state
  333. FROM BIS_INSP_ALL_OBJ A
  334. LEFT JOIN BIS_INSP_STND_RGSTR B
  335. ON A.Obj_Id = B.OBJ_ID
  336. left join BIS_INSP_ALL C on A.ID=C.ID
  337. left join ATT_RS_BASE e
  338. on A.code = e.rs_code
  339. where 1=1 and A.id in (${inIdsSql})
  340. <if test="tabType =='2'.toString()">
  341. and C.entm &lt; DATE_ADD(STR_TO_DATE(#{nowTime},'%Y-%m-%d'),INTERVAL 1 DAY)
  342. </if>
  343. <if test="tabType =='1'.toString()">
  344. and C.entm &gt;=STR_TO_DATE(#{nowTime},'%Y-%m-%d')
  345. </if>
  346. ) a where a.PTYPE=#{pType}
  347. <if test="plnaId !=null and plnaId !=''">
  348. and ID like '${plnaId}%'
  349. </if>
  350. <if test="engScal !=null and engScal !=''">
  351. and eng_scal =#{engScal}
  352. </if>
  353. <if test="state !=null and state !=''">
  354. and wtdstState =#{state}
  355. </if>
  356. <if test="adName !=null and adName !=''">
  357. and location like '${adName}%'
  358. </if>
  359. <if test="code !=null and code !=''">
  360. and code like '${code}%'
  361. </if>
  362. <if test="rsName !=null and rsName !=''">
  363. and rsvrNm like '%${rsName}%'
  364. </if>
  365. <if test="sttm !=null and sttm !='' and entm !=null and entm !=''">
  366. and intm&gt;=STR_TO_DATE(#{sttm},'%Y-%m-%d') and intm &lt;=STR_TO_DATE(#{entm},'%Y-%m-%d')
  367. </if>
  368. order by wtdstState asc
  369. <if test="orderBy != null and orderBy != ''">
  370. ,${orderBy}
  371. </if>
  372. </select>
  373. <sql id="orgIdSql">
  374. <choose>
  375. <when test="orgId !=null and orgId !=''">
  376. and ORG_ID=#{orgId}
  377. </when>
  378. <otherwise>
  379. and ORG_ID is null
  380. </otherwise>
  381. </choose>
  382. </sql>
  383. <select id="getListStndByInspGroupIdObjType" resultType="cn.com.goldenwater.dcproj.model.BisInspStndRgstr" parameterType="cn.com.goldenwater.dcproj.param.PagePersObjParam">
  384. select t.*,C.id groupId,C.PNM groupName,B.obj_id,r.hyst_site loc
  385. from att_ad_base t
  386. left join BIS_INSP_ALL_OBJ B
  387. on B.CODE = t.ad_code
  388. LEFT JOIN BIS_INSP_ALL C ON B.ID = C.ID
  389. and B.ptype = #{objType}
  390. left join BIS_INSP_STND_RGSTR r on b.obj_id=r.obj_id
  391. where 1 = 1
  392. <if test='isAll == "0"'>and B.ID = #{inspGroupId}</if>
  393. <if test='isAll == "1"'>and B.ID LIKE '${inspGroupId}%'</if>
  394. <if test="adCode != null and adCode != ''">
  395. and t.AD_CODE like '${adCode}%'
  396. </if>
  397. <choose>
  398. <when test="province != null and province != ''">
  399. and B.AD_CODE LIKE '${province}%'
  400. </when>
  401. <otherwise>
  402. and B.AD_CODE is null
  403. </otherwise>
  404. </choose>
  405. </select>
  406. </mapper>