BisInspGrwDao.xml 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462
  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.BisInspGrwDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspGrw" id="bisInspGrwResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="repeatability" column="REPEATABILITY"/>
  7. <result property="upTm" column="UPTM"/>
  8. <result property="toolProfScore" column="TOOL_PROF_SCORE"/>
  9. <result property="flagTool" column="FLAG_TOOL"/>
  10. <result property="objId" column="OBJ_ID"/>
  11. <result property="monitorRate" column="MONITOR_RATE"/>
  12. <result property="toolTsoScore" column="TOOL_TSO_SCORE"/>
  13. <result property="checkComment" column="CHECK_COMMENT"/>
  14. <result property="flagSafeguard" column="FLAG_SAFEGUARD"/>
  15. <result property="signScore" column="SIGN_SCORE"/>
  16. <result property="trainScore" column="TRAIN_SCORE"/>
  17. <result property="intm" column="INTM"/>
  18. <result property="markScore" column="MARK_SCORE"/>
  19. <result property="repeatabilityScore" column="REPEATABILITY_SCORE"/>
  20. <result property="allScore" column="ALL_SCORE"/>
  21. <result property="safeguardScore" column="SAFEGUARD_SCORE"/>
  22. <result property="flagExact" column="FLAG_EXACT"/>
  23. <result property="toolScore" column="TOOL_SCORE"/>
  24. <result property="exactScore" column="EXACT_SCORE"/>
  25. <result property="inspState" column="INSP_STATE"/>
  26. <result property="handScore" column="HAND_SCORE"/>
  27. <result property="stnm" column="STNM"/>
  28. <result property="flagValid" column="FLAG_VALID"/>
  29. <result property="percentage" column="PERCENTAGE"/>
  30. <result property="sttp" column="STTP"/>
  31. <result property="stcd" column="STCD"/>
  32. <result property="percentageStatus" column="PERCENTAGE_STATUS"/>
  33. <result property="checkPid" column="CHECK_PID"/>
  34. <result property="percentageScore" column="PERCENTAGE_SCORE"/>
  35. <result property="wellProtScore" column="WELL_PROT_SCORE"/>
  36. <result property="flagMark" column="FLAG_MARK"/>
  37. <result property="flagSign" column="FLAG_SIGN"/>
  38. <result property="maintainStatus" column="MAINTAIN_STATUS"/>
  39. <result property="checkPname" column="CHECK_PNAME"/>
  40. <result property="flagTrain" column="FLAG_TRAIN"/>
  41. <result property="stlc" column="STLC"/>
  42. <result property="orgId" column="ORG_ID"/>
  43. </resultMap>
  44. <sql id="table_columns">
  45. ID ,
  46. REPEATABILITY ,
  47. DATE_FORMAT(UPTM,'%Y-%m-%d %T') UPTM,
  48. TOOL_PROF_SCORE ,
  49. FLAG_TOOL ,
  50. OBJ_ID ,
  51. MONITOR_RATE ,
  52. TOOL_TSO_SCORE ,
  53. CHECK_COMMENT ,
  54. FLAG_SAFEGUARD ,
  55. SIGN_SCORE ,
  56. TRAIN_SCORE ,
  57. DATE_FORMAT(INTM,'%Y-%m-%d %T') INTM,
  58. MARK_SCORE ,
  59. REPEATABILITY_SCORE ,
  60. ALL_SCORE ,
  61. SAFEGUARD_SCORE ,
  62. FLAG_EXACT ,
  63. TOOL_SCORE ,
  64. EXACT_SCORE ,
  65. INSP_STATE ,
  66. HAND_SCORE ,
  67. STNM ,
  68. FLAG_VALID ,
  69. PERCENTAGE ,
  70. STTP ,
  71. STCD ,
  72. PERCENTAGE_STATUS ,
  73. CHECK_PID ,
  74. PERCENTAGE_SCORE ,
  75. WELL_PROT_SCORE ,
  76. FLAG_MARK ,
  77. FLAG_SIGN ,
  78. MAINTAIN_STATUS ,
  79. CHECK_PNAME ,
  80. FLAG_TRAIN ,
  81. STLC ,ORG_ID
  82. </sql>
  83. <sql id="table_columns2">
  84. ID ,
  85. REPEATABILITY ,
  86. UPTM ,
  87. TOOL_PROF_SCORE ,
  88. FLAG_TOOL ,
  89. OBJ_ID ,
  90. MONITOR_RATE ,
  91. TOOL_TSO_SCORE ,
  92. CHECK_COMMENT ,
  93. FLAG_SAFEGUARD ,
  94. SIGN_SCORE ,
  95. TRAIN_SCORE ,
  96. INTM ,
  97. MARK_SCORE ,
  98. REPEATABILITY_SCORE ,
  99. ALL_SCORE ,
  100. SAFEGUARD_SCORE ,
  101. FLAG_EXACT ,
  102. TOOL_SCORE ,
  103. EXACT_SCORE ,
  104. INSP_STATE ,
  105. HAND_SCORE ,
  106. STNM ,
  107. FLAG_VALID ,
  108. PERCENTAGE ,
  109. STTP ,
  110. STCD ,
  111. PERCENTAGE_STATUS ,
  112. CHECK_PID ,
  113. PERCENTAGE_SCORE ,
  114. WELL_PROT_SCORE ,
  115. FLAG_MARK ,
  116. FLAG_SIGN ,
  117. MAINTAIN_STATUS ,
  118. CHECK_PNAME ,
  119. FLAG_TRAIN ,
  120. STLC ,ORG_ID
  121. </sql>
  122. <sql id="entity_properties">
  123. #{id},
  124. #{repeatability},
  125. DATE_FORMAT(#{upTm},'%Y-%m-%d %T') ,
  126. #{toolProfScore},
  127. #{flagTool},
  128. #{objId},
  129. #{monitorRate},
  130. #{toolTsoScore},
  131. #{checkComment},
  132. #{flagSafeguard},
  133. #{signScore},
  134. #{trainScore},
  135. DATE_FORMAT(#{intm},'%Y-%m-%d %T') ,
  136. #{markScore},
  137. #{repeatabilityScore},
  138. #{allScore},
  139. #{safeguardScore},
  140. #{flagExact},
  141. #{toolScore},
  142. #{exactScore},
  143. #{inspState},
  144. #{handScore},
  145. #{stnm},
  146. #{flagValid},
  147. #{percentage},
  148. #{sttp},
  149. #{stcd},
  150. #{percentageStatus},
  151. #{checkPid},
  152. #{percentageScore},
  153. #{wellProtScore},
  154. #{flagMark},
  155. #{flagSign},
  156. #{maintainStatus},
  157. #{checkPname},
  158. #{flagTrain},
  159. #{stlc},#{orgId}
  160. </sql>
  161. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  162. <sql id="page_where">
  163. <trim prefix="where" prefixOverrides="and | or ">
  164. <if test="id != null and id != ''">and ID = #{id}</if>
  165. <if test="orgId != null and orgId != ''">and ORG_ID = #{orgId}</if>
  166. <if test="repeatability != null">and REPEATABILITY = #{repeatability}</if>
  167. <if test="uptm != null and uptm != ''">and UPTM = STR_TO_DATE(#{uptm},'%Y-%m-%d %T')</if>
  168. <if test="toolProfScore != null">and TOOL_PROF_SCORE = #{toolProfScore}</if>
  169. <if test="flagTool != null and flagTool != ''">and FLAG_TOOL = #{flagTool}</if>
  170. <if test="objId != null and objId != ''">and OBJ_ID = #{objId}</if>
  171. <if test="monitorRate != null and monitorRate != ''">and MONITOR_RATE = #{monitorRate}</if>
  172. <if test="toolTsoScore != null">and TOOL_TSO_SCORE = #{toolTsoScore}</if>
  173. <if test="checkComment != null and checkComment != ''">and CHECK_COMMENT = #{checkComment}</if>
  174. <if test="flagSafeguard != null and flagSafeguard != ''">and FLAG_SAFEGUARD = #{flagSafeguard}</if>
  175. <if test="signScore != null">and SIGN_SCORE = #{signScore}</if>
  176. <if test="trainScore != null">and TRAIN_SCORE = #{trainScore}</if>
  177. <if test="intm != null and intm != ''">and INTM = STR_TO_DATE(#{intm},'%Y-%m-%d %T')</if>
  178. <if test="markScore != null">and MARK_SCORE = #{markScore}</if>
  179. <if test="repeatabilityScore != null">and REPEATABILITY_SCORE = #{repeatabilityScore}</if>
  180. <if test="allScore != null">and ALL_SCORE = #{allScore}</if>
  181. <if test="safeguardScore != null">and SAFEGUARD_SCORE = #{safeguardScore}</if>
  182. <if test="flagExact != null and flagExact != ''">and FLAG_EXACT = #{flagExact}</if>
  183. <if test="toolScore != null">and TOOL_SCORE = #{toolScore}</if>
  184. <if test="exactScore != null">and EXACT_SCORE = #{exactScore}</if>
  185. <if test="inspState != null and inspState != ''">and INSP_STATE = #{inspState}</if>
  186. <if test="handScore != null">and HAND_SCORE = #{handScore}</if>
  187. <if test="stnm != null and stnm != ''">and STNM = #{stnm}</if>
  188. <if test="flagValid != null and flagValid != ''">and FLAG_VALID = #{flagValid}</if>
  189. <if test="percentage != null">and PERCENTAGE = #{percentage}</if>
  190. <if test="sttp != null and sttp != ''">and STTP = #{sttp}</if>
  191. <if test="stcd != null and stcd != ''">and STCD = #{stcd}</if>
  192. <if test="percentageStatus != null and percentageStatus != ''">and PERCENTAGE_STATUS = #{percentageStatus}</if>
  193. <if test="checkPid != null and checkPid != ''">and CHECK_PID = #{checkPid}</if>
  194. <if test="percentageScore != null">and PERCENTAGE_SCORE = #{percentageScore}</if>
  195. <if test="wellProtScore != null">and WELL_PROT_SCORE = #{wellProtScore}</if>
  196. <if test="flagMark != null and flagMark != ''">and FLAG_MARK = #{flagMark}</if>
  197. <if test="flagSign != null and flagSign != ''">and FLAG_SIGN = #{flagSign}</if>
  198. <if test="maintainStatus != null and maintainStatus != ''">and MAINTAIN_STATUS = #{maintainStatus}</if>
  199. <if test="checkPname != null and checkPname != ''">and CHECK_PNAME LIKE CONCAT('%', #{checkPname}, '%')</if>
  200. <if test="flagTrain != null and flagTrain != ''">and FLAG_TRAIN = #{flagTrain}</if>
  201. <if test="stlc != null and stlc != ''">and STLC = #{stlc}</if>
  202. </trim>
  203. </sql>
  204. <select id="get" resultMap="bisInspGrwResultMap" parameterType="String" >
  205. select <include refid="table_columns" /> from BIS_INSP_GRW where ID = #{id}
  206. </select>
  207. <select id="getBy" resultMap="bisInspGrwResultMap">
  208. select <include refid="table_columns" /> from BIS_INSP_GRW <include refid="page_where" />
  209. </select>
  210. <select id="findAll" resultMap="bisInspGrwResultMap">
  211. select <include refid="table_columns" /> from BIS_INSP_GRW
  212. </select>
  213. <select id="findList" resultMap="bisInspGrwResultMap">
  214. select <include refid="table_columns" /> from BIS_INSP_GRW <include refid="page_where" /> ORDER BY ID
  215. </select>
  216. <select id="selectCount" resultType="int" >
  217. select count(ID) from BIS_INSP_GRW <include refid="page_where" />
  218. </select>
  219. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspGrw">
  220. insert into BIS_INSP_GRW( <include refid="table_columns2" /> )
  221. values ( <include refid="entity_properties" /> )
  222. </insert>
  223. <delete id="delete" parameterType="java.lang.String">
  224. delete from BIS_INSP_GRW where ID = #{id}
  225. </delete>
  226. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspGrw">
  227. delete from BIS_INSP_GRW <include refid="page_where" />
  228. </delete>
  229. <update id="deleteInFlag" parameterType="java.lang.String">
  230. update BIS_INSP_GRW set flag_valid = 0 where ID = #{id}
  231. </update>
  232. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspGrw">
  233. update BIS_INSP_GRW
  234. <trim prefix="set" suffixOverrides=",">
  235. <if test="id != null and id != ''"> ID = #{id},</if>
  236. <if test="repeatability != null"> REPEATABILITY = #{repeatability},</if>
  237. <if test="uptm != null and uptm != ''"> UPTM = STR_TO_DATE(#{uptm},'%Y-%m-%d %T'),</if>
  238. <if test="toolProfScore != null"> TOOL_PROF_SCORE = #{toolProfScore},</if>
  239. <if test="flagTool != null and flagTool != ''"> FLAG_TOOL = #{flagTool},</if>
  240. <if test="objId != null and objId != ''"> OBJ_ID = #{objId},</if>
  241. <if test="monitorRate != null and monitorRate != ''"> MONITOR_RATE = #{monitorRate},</if>
  242. <if test="toolTsoScore != null"> TOOL_TSO_SCORE = #{toolTsoScore},</if>
  243. <if test="checkComment != null and checkComment != ''"> CHECK_COMMENT = #{checkComment},</if>
  244. <if test="flagSafeguard != null and flagSafeguard != ''"> FLAG_SAFEGUARD = #{flagSafeguard},</if>
  245. <if test="signScore != null"> SIGN_SCORE = #{signScore},</if>
  246. <if test="trainScore != null"> TRAIN_SCORE = #{trainScore},</if>
  247. <if test="intm != null and intm != ''"> INTM = STR_TO_DATE(#{intm},'%Y-%m-%d %T'),</if>
  248. <if test="markScore != null"> MARK_SCORE = #{markScore},</if>
  249. <if test="repeatabilityScore != null"> REPEATABILITY_SCORE = #{repeatabilityScore},</if>
  250. <if test="allScore != null"> ALL_SCORE = #{allScore},</if>
  251. <if test="safeguardScore != null"> SAFEGUARD_SCORE = #{safeguardScore},</if>
  252. <if test="flagExact != null and flagExact != ''"> FLAG_EXACT = #{flagExact},</if>
  253. <if test="toolScore != null"> TOOL_SCORE = #{toolScore},</if>
  254. <if test="exactScore != null"> EXACT_SCORE = #{exactScore},</if>
  255. <if test="inspState != null and inspState != ''"> INSP_STATE = #{inspState},</if>
  256. <if test="handScore != null"> HAND_SCORE = #{handScore},</if>
  257. <if test="stnm != null and stnm != ''"> STNM = #{stnm},</if>
  258. <if test="flagValid != null and flagValid != ''"> FLAG_VALID = #{flagValid},</if>
  259. <if test="percentage != null"> PERCENTAGE = #{percentage},</if>
  260. <if test="sttp != null and sttp != ''"> STTP = #{sttp},</if>
  261. <if test="stcd != null and stcd != ''"> STCD = #{stcd},</if>
  262. <if test="percentageStatus != null and percentageStatus != ''"> PERCENTAGE_STATUS = #{percentageStatus},</if>
  263. <if test="checkPid != null and checkPid != ''"> CHECK_PID = #{checkPid},</if>
  264. <if test="percentageScore != null"> PERCENTAGE_SCORE = #{percentageScore},</if>
  265. <if test="wellProtScore != null"> WELL_PROT_SCORE = #{wellProtScore},</if>
  266. <if test="flagMark != null and flagMark != ''"> FLAG_MARK = #{flagMark},</if>
  267. <if test="flagSign != null and flagSign != ''"> FLAG_SIGN = #{flagSign},</if>
  268. <if test="maintainStatus != null and maintainStatus != ''"> MAINTAIN_STATUS = #{maintainStatus},</if>
  269. <if test="checkPname != null and checkPname != ''"> CHECK_PNAME = #{checkPname},</if>
  270. <if test="flagTrain != null and flagTrain != ''"> FLAG_TRAIN = #{flagTrain},</if>
  271. <if test="stlc != null and stlc != ''"> STLC = #{stlc},</if>
  272. <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
  273. </trim>
  274. <where>ID = #{id}</where>
  275. </update>
  276. <update id="updateByStcd" parameterType="cn.com.goldenwater.dcproj.model.BisInspGrw">
  277. update BIS_INSP_GRW
  278. <trim prefix="set" suffixOverrides=",">
  279. <if test="id != null and id != ''"> ID = #{id},</if>
  280. <if test="repeatability != null"> REPEATABILITY = #{repeatability},</if>
  281. <if test="uptm != null and uptm != ''"> UPTM = STR_TO_DATE(#{uptm},'%Y-%m-%d %T'),</if>
  282. <if test="toolProfScore != null"> TOOL_PROF_SCORE = #{toolProfScore},</if>
  283. <if test="flagTool != null and flagTool != ''"> FLAG_TOOL = #{flagTool},</if>
  284. <if test="objId != null and objId != ''"> OBJ_ID = #{objId},</if>
  285. <if test="monitorRate != null and monitorRate != ''"> MONITOR_RATE = #{monitorRate},</if>
  286. <if test="toolTsoScore != null"> TOOL_TSO_SCORE = #{toolTsoScore},</if>
  287. <if test="checkComment != null and checkComment != ''"> CHECK_COMMENT = #{checkComment},</if>
  288. <if test="flagSafeguard != null and flagSafeguard != ''"> FLAG_SAFEGUARD = #{flagSafeguard},</if>
  289. <if test="signScore != null"> SIGN_SCORE = #{signScore},</if>
  290. <if test="trainScore != null"> TRAIN_SCORE = #{trainScore},</if>
  291. <if test="intm != null and intm != ''"> INTM = STR_TO_DATE(#{intm},'%Y-%m-%d %T'),</if>
  292. <if test="markScore != null"> MARK_SCORE = #{markScore},</if>
  293. <if test="repeatabilityScore != null"> REPEATABILITY_SCORE = #{repeatabilityScore},</if>
  294. <if test="allScore != null"> ALL_SCORE = #{allScore},</if>
  295. <if test="safeguardScore != null"> SAFEGUARD_SCORE = #{safeguardScore},</if>
  296. <if test="flagExact != null and flagExact != ''"> FLAG_EXACT = #{flagExact},</if>
  297. <if test="toolScore != null"> TOOL_SCORE = #{toolScore},</if>
  298. <if test="exactScore != null"> EXACT_SCORE = #{exactScore},</if>
  299. <if test="inspState != null and inspState != ''"> INSP_STATE = #{inspState},</if>
  300. <if test="handScore != null"> HAND_SCORE = #{handScore},</if>
  301. <if test="stnm != null and stnm != ''"> STNM = #{stnm},</if>
  302. <if test="flagValid != null and flagValid != ''"> FLAG_VALID = #{flagValid},</if>
  303. <if test="percentage != null"> PERCENTAGE = #{percentage},</if>
  304. <if test="sttp != null and sttp != ''"> STTP = #{sttp},</if>
  305. <if test="percentageStatus != null and percentageStatus != ''"> PERCENTAGE_STATUS = #{percentageStatus},</if>
  306. <if test="checkPid != null and checkPid != ''"> CHECK_PID = #{checkPid},</if>
  307. <if test="percentageScore != null"> PERCENTAGE_SCORE = #{percentageScore},</if>
  308. <if test="wellProtScore != null"> WELL_PROT_SCORE = #{wellProtScore},</if>
  309. <if test="flagMark != null and flagMark != ''"> FLAG_MARK = #{flagMark},</if>
  310. <if test="flagSign != null and flagSign != ''"> FLAG_SIGN = #{flagSign},</if>
  311. <if test="maintainStatus != null and maintainStatus != ''"> MAINTAIN_STATUS = #{maintainStatus},</if>
  312. <if test="checkPname != null and checkPname != ''"> CHECK_PNAME = #{checkPname},</if>
  313. <if test="flagTrain != null and flagTrain != ''"> FLAG_TRAIN = #{flagTrain},</if>
  314. <if test="stlc != null and stlc != ''"> STLC = #{stlc},</if>
  315. <if test="orgId != null and orgId != ''"> ORG_ID = #{orgId},</if>
  316. </trim>
  317. <where>stcd = #{stcd}</where>
  318. </update>
  319. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspGrw">
  320. update BIS_INSP_GRW
  321. <trim prefix="set" suffixOverrides=",">
  322. <if test="id != null and id != ''"> ID = #{id},</if>
  323. <if test="repeatability != null and repeatability != ''"> REPEATABILITY = #{repeatability},</if>
  324. <if test="uptm != null and uptm != ''"> UPTM = STR_TO_DATE(#{uptm},'%Y-%m-%d %T'),</if>
  325. <if test="toolProfScore != null and toolProfScore != ''"> TOOL_PROF_SCORE = #{toolProfScore},</if>
  326. <if test="flagTool != null and flagTool != ''"> FLAG_TOOL = #{flagTool},</if>
  327. <if test="objId != null and objId != ''"> OBJ_ID = #{objId},</if>
  328. <if test="monitorRate != null and monitorRate != ''"> MONITOR_RATE = #{monitorRate},</if>
  329. <if test="toolTsoScore != null and toolTsoScore != ''"> TOOL_TSO_SCORE = #{toolTsoScore},</if>
  330. <if test="checkComment != null and checkComment != ''"> CHECK_COMMENT = #{checkComment},</if>
  331. <if test="flagSafeguard != null and flagSafeguard != ''"> FLAG_SAFEGUARD = #{flagSafeguard},</if>
  332. <if test="signScore != null and signScore != ''"> SIGN_SCORE = #{signScore},</if>
  333. <if test="trainScore != null and trainScore != ''"> TRAIN_SCORE = #{trainScore},</if>
  334. <if test="markScore != null and markScore != ''"> MARK_SCORE = #{markScore},</if>
  335. <if test="repeatabilityScore != null and repeatabilityScore != ''"> REPEATABILITY_SCORE = #{repeatabilityScore},</if>
  336. <if test="allScore != null and allScore != ''"> ALL_SCORE = #{allScore},</if>
  337. <if test="safeguardScore != null and safeguardScore != ''"> SAFEGUARD_SCORE = #{safeguardScore},</if>
  338. <if test="flagExact != null and flagExact != ''"> FLAG_EXACT = #{flagExact},</if>
  339. <if test="toolScore != null and toolScore != ''"> TOOL_SCORE = #{toolScore},</if>
  340. <if test="exactScore != null and exactScore != ''"> EXACT_SCORE = #{exactScore},</if>
  341. <if test="inspState != null and inspState != ''"> INSP_STATE = #{inspState},</if>
  342. <if test="handScore != null and handScore != ''"> HAND_SCORE = #{handScore},</if>
  343. <if test="stnm != null and stnm != ''"> STNM = #{stnm},</if>
  344. <if test="flagValid != null and flagValid != ''"> FLAG_VALID = #{flagValid},</if>
  345. <if test="percentage != null and percentage != ''"> PERCENTAGE = #{percentage},</if>
  346. <if test="sttp != null and sttp != ''"> STTP = #{sttp},</if>
  347. <if test="stcd != null and stcd != ''"> STCD = #{stcd},</if>
  348. <if test="percentageStatus != null and percentageStatus != ''"> PERCENTAGE_STATUS = #{percentageStatus},</if>
  349. <if test="checkPid != null and checkPid != ''"> CHECK_PID = #{checkPid},</if>
  350. <if test="percentageScore != null and percentageScore != ''"> PERCENTAGE_SCORE = #{percentageScore},</if>
  351. <if test="wellProtScore != null and wellProtScore != ''"> WELL_PROT_SCORE = #{wellProtScore},</if>
  352. <if test="flagMark != null and flagMark != ''"> FLAG_MARK = #{flagMark},</if>
  353. <if test="flagSign != null and flagSign != ''"> FLAG_SIGN = #{flagSign},</if>
  354. <if test="maintainStatus != null and maintainStatus != ''"> MAINTAIN_STATUS = #{maintainStatus},</if>
  355. <if test="checkPname != null and checkPname != ''"> CHECK_PNAME = #{checkPname},</if>
  356. <if test="flagTrain != null and flagTrain != ''"> FLAG_TRAIN = #{flagTrain},</if>
  357. <if test="stlc != null and stlc != ''"> STLC = #{stlc},</if>
  358. <if test="orgId != null and orgId != ''"> ORG_ID = #{orgId},</if>
  359. </trim>
  360. <include refid="page_where" />
  361. </update>
  362. <sql id="choseSql">
  363. <choose>
  364. <when test="province !=null and province !=''">
  365. and A.ad_code=#{province}
  366. </when>
  367. <otherwise>
  368. and A.ad_code is null
  369. </otherwise>
  370. </choose>
  371. </sql>
  372. <sql id="orgIdSql">
  373. <choose>
  374. <when test="orgId !=null and orgId !=''">
  375. and ORG_ID=#{orgId}
  376. </when>
  377. <otherwise>
  378. and ORG_ID is null
  379. </otherwise>
  380. </choose>
  381. </sql>
  382. <!-- 其他自定义SQL -->
  383. <select id="findPageByType" parameterType="cn.com.goldenwater.dcproj.param.TypeParam" resultType="cn.com.goldenwater.dcproj.dto.BisInspGrwListDto">
  384. select * from (select A.ID NODEID,A.CODE,A.Nm,A.PTYPE,A.OBJ_ID,A.IS_SET_OBJ,
  385. CASE WHEN b.INSP_STATE IS NULL THEN '0' ELSE b.INSP_STATE END AS INSP_STATE,
  386. CASE WHEN b.INSP_STATE IS NULL THEN '0' ELSE b.INSP_STATE END AS WTDST_STATE,
  387. B.ID,B.STTP,C.LTTD,C.LGTD,C.LGTD_PC,C.LTTD_PC,B.STCD,
  388. B.STNM,B.STLC,B.INTM
  389. FROM BIS_INSP_ALL_OBJ A
  390. LEFT JOIN BIS_INSP_GRW B
  391. ON A.OBJ_ID = B.OBJ_ID
  392. LEFT JOIN ATT_GRW_BASE C ON B.STCD=C.STCD
  393. where 1=1
  394. <include refid="choseSql"/>
  395. and
  396. A.id in (${inIdsSql})
  397. ) a
  398. where ptype=#{pType}
  399. <if test="plnaId !=null and plnaId !=''">
  400. and a.NODEID like '${plnaId}%'
  401. </if>
  402. <if test="state !=null and state !=''">
  403. and INSP_STATE =#{state}
  404. </if>
  405. <if test="rsName !=null and rsName !=''">
  406. and a.nm like '%${rsName}%'
  407. </if>
  408. order by WTDST_STATE asc
  409. <if test="orderBy != null and orderBy != ''">
  410. ,CONVERT( nm USING gbk ) COLLATE gbk_chinese_ci ASC
  411. </if>
  412. </select>
  413. <select id="queryDetailListWithPblm" parameterType="cn.com.goldenwater.dcproj.param.GetPageByNodeIdParam" resultType="cn.com.goldenwater.dcproj.dto.BisInspGrwDetailDto">
  414. SELECT E.*,B.LTTD,B.LGTD,B.LGTD_PC,B.LTTD_PC,B.ADCD,B.ADNM,B.GOGUNT,B.RVNM, DATE_FORMAT(B.ESSTYM,'%Y-%m-%d') ESSTYM,
  415. B.ONUN,B.MNUN
  416. FROM BIS_INSP_GRW E LEFT JOIN ATT_GRW_BASE B ON E.STCD=B.STCD
  417. LEFT JOIN bis_insp_all_obj A ON E.OBJ_ID=A.OBJ_ID left join bis_insp_all rt on A.id=rt.id where 1=1
  418. <if test="nodeId !=null and nodeId !=''">
  419. and A.id like CONCAT(#{nodeId}, '%')
  420. </if>
  421. <if test="tabType =='2'.toString()">
  422. and rt.entm &lt;STR_TO_DATE(#{nowTime},'%Y-%m-%d')
  423. </if>
  424. <if test="tabType =='1'.toString()">
  425. and rt.entm &gt;=STR_TO_DATE(#{nowTime},'%Y-%m-%d')
  426. </if>
  427. <include refid="choseSql"/>
  428. <if test="stnm != null and stnm != ''">and E.STNM like CONCAT(#{stnm}, '%')</if>
  429. <if test="inspState != null and inspState != ''">and E.INSP_STATE = #{inspState}</if>
  430. ORDER BY E.INSP_STATE ASC
  431. </select>
  432. <select id="getGrwByIdNm" resultType="cn.com.goldenwater.dcproj.model.BisInspBase">
  433. select b.id RGSTR_ID, b.obj_id obj_id,b.stnm nm from bis_insp_all_obj a join BIS_INSP_GRW b on a.obj_id=b.obj_id where id=#{groupId} and a.nm like '%${nm}%'
  434. </select>
  435. </mapper>