BisInspPblmRepeatDao.xml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  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.BisInspPblmRepeatDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspPblm" id="bisInspPblmRepeatResultMap">
  5. <result property="inspPblmCate" column="INSP_PBLM_CATE"/>
  6. <result property="pblmStat" column="PBLM_STAT"/>
  7. <result property="reviOpin" column="REVI_OPIN"/>
  8. <result property="reviConc" column="REVI_CONC"/>
  9. <result property="reviOrgGuid" column="REVI_ORG_GUID"/>
  10. <result property="dataStat" column="DATA_STAT"/>
  11. <result property="collTime" column="COLL_TIME"/>
  12. <result property="recPers" column="REC_PERS"/>
  13. <result property="note" column="NOTE"/>
  14. <result property="regid" column="REGID"/>
  15. <result property="commonFileIds" column="COMMON_FILE_IDS"/>
  16. <result property="fileNo" column="FILE_NO"/>
  17. <result property="fileNoNumber" column="FILE_NO_NUMBER"/>
  18. <result property="pblmsId" column="PBLMS_ID"/>
  19. <result property="pblmsTypeId" column="PBLMS_TYPE_ID"/>
  20. <result property="villType" column="VILL_TYPE"/>
  21. <result property="cwsCode" column="CWS_CODE"/>
  22. <result property="villageCode" column="VILLAGE_CODE"/>
  23. <result property="hasVedio" column="HAS_VEDIO"/>
  24. <result property="problemType" column="PROBLEM_TYPE"/>
  25. <result property="qualityTypeId" column="QUALITY_TYPE_ID"/>
  26. <result property="defectTypeId" column="DEFECT_TYPE_ID"/>
  27. <result property="fdbkId" column="FDBK_ID"/>
  28. <result property="itemId" column="ITEM_ID"/>
  29. <result property="waterUserId" column="WATER_USER_ID"/>
  30. <result property="quote" column="QUOTE"/>
  31. <result property="pblmId" column="PBLM_ID"/>
  32. <result property="objId" column="OBJ_ID"/>
  33. <result property="objType" column="OBJ_TYPE"/>
  34. <result property="inspGroupId" column="INSP_GROUP_ID"/>
  35. <result property="pguid" column="PGUID"/>
  36. <result property="inspPblmType" column="INSP_PBLM_TYPE"/>
  37. <result property="inspPblmCode" column="INSP_PBLM_CODE"/>
  38. <result property="inspPblmName" column="INSP_PBLM_NAME"/>
  39. <result property="inspPblmDesc" column="INSP_PBLM_DESC"/>
  40. <result property="inspAddDesc" column="INSP_ADD_DESC"/>
  41. <result property="pblmLong" column="PBLM_LONG"/>
  42. <result property="pblmLat" column="PBLM_LAT"/>
  43. <result property="ifCasePblm" column="IF_CASE_PBLM"/>
  44. <result property="inspPblmOrgName" column="INSP_PBLM_ORG_NAME"/>
  45. <result property="pblmPersName" column="PBLM_PERS_NAME"/>
  46. </resultMap>
  47. <sql id="table_columns">
  48. INSP_PBLM_CATE,
  49. PBLM_STAT,
  50. REVI_OPIN,
  51. REVI_CONC,
  52. REVI_ORG_GUID,
  53. DATA_STAT,
  54. COLL_TIME,
  55. REC_PERS,
  56. NOTE,
  57. REGID,
  58. COMMON_FILE_IDS,
  59. FILE_NO,
  60. FILE_NO_NUMBER,
  61. PBLMS_ID,
  62. PBLMS_TYPE_ID,
  63. VILL_TYPE,
  64. CWS_CODE,
  65. VILLAGE_CODE,
  66. HAS_VEDIO,
  67. PROBLEM_TYPE,
  68. QUALITY_TYPE_ID,
  69. DEFECT_TYPE_ID,
  70. FDBK_ID,
  71. ITEM_ID,
  72. WATER_USER_ID,
  73. QUOTE,
  74. PBLM_ID,
  75. OBJ_ID,
  76. OBJ_TYPE,
  77. INSP_GROUP_ID,
  78. PGUID,
  79. INSP_PBLM_TYPE,
  80. INSP_PBLM_CODE,
  81. INSP_PBLM_NAME,
  82. INSP_PBLM_DESC,
  83. INSP_ADD_DESC,
  84. PBLM_LONG,
  85. PBLM_LAT,
  86. IF_CASE_PBLM,
  87. INSP_PBLM_ORG_NAME,
  88. PBLM_PERS_NAME
  89. </sql>
  90. <sql id="entity_properties">
  91. #{inspPblmCate},
  92. #{pblmStat},
  93. #{reviOpin},
  94. #{reviConc},
  95. #{reviOrgGuid},
  96. #{dataStat},
  97. #{collTime},
  98. #{recPers},
  99. #{note},
  100. #{regid},
  101. #{commonFileIds},
  102. #{fileNo},
  103. #{fileNoNumber},
  104. #{pblmsId},
  105. #{pblmsTypeId},
  106. #{villType},
  107. #{cwsCode},
  108. #{villageCode},
  109. #{hasVedio},
  110. #{problemType},
  111. #{qualityTypeId},
  112. #{defectTypeId},
  113. #{fdbkId},
  114. #{itemId},
  115. #{waterUserId},
  116. #{quote},
  117. #{pblmId},
  118. #{objId},
  119. #{objType},
  120. #{inspGroupId},
  121. #{pguid},
  122. #{inspPblmType},
  123. #{inspPblmCode},
  124. #{inspPblmName},
  125. #{inspPblmDesc},
  126. #{inspAddDesc},
  127. #{pblmLong},
  128. #{pblmLat},
  129. #{ifCasePblm},
  130. #{inspPblmOrgName},
  131. #{pblmPersName}
  132. </sql>
  133. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  134. <sql id="page_where">
  135. <trim prefix="where" prefixOverrides="and | or ">
  136. <if test="pblmStat != null and pblmStat != ''">and PBLM_STAT = #{pblmStat}</if>
  137. <if test="reviOpin != null and reviOpin != ''">and REVI_OPIN = #{reviOpin}</if>
  138. <if test="reviConc != null and reviConc != ''">and REVI_CONC = #{reviConc}</if>
  139. <if test="reviOrgGuid != null and reviOrgGuid != ''">and REVI_ORG_GUID = #{reviOrgGuid}</if>
  140. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  141. <if test="collTime != null">and COLL_TIME = #{collTime}</if>
  142. <if test="recPers != null and recPers != ''">and REC_PERS = #{recPers}</if>
  143. <if test="note != null and note != ''">and NOTE = #{note}</if>
  144. <if test="regid != null and regid != ''">and REGID = #{regid}</if>
  145. <if test="commonFileIds != null and commonFileIds != ''">and COMMON_FILE_IDS = #{commonFileIds}</if>
  146. <if test="fileNo != null and fileNo != ''">and FILE_NO = #{fileNo}</if>
  147. <if test="fileNoNumber != null and fileNoNumber != ''">and FILE_NO_NUMBER = #{fileNoNumber}</if>
  148. <if test="pblmsId != null and pblmsId != ''">and PBLMS_ID = #{pblmsId}</if>
  149. <if test="pblmsTypeId != null and pblmsTypeId != ''">and PBLMS_TYPE_ID = #{pblmsTypeId}</if>
  150. <if test="villType != null and villType != ''">and VILL_TYPE = #{villType}</if>
  151. <if test="cwsCode != null and cwsCode != ''">and CWS_CODE = #{cwsCode}</if>
  152. <if test="villageCode != null and villageCode != ''">and VILLAGE_CODE = #{villageCode}</if>
  153. <if test="hasVedio != null and hasVedio != ''">and HAS_VEDIO = #{hasVedio}</if>
  154. <if test="problemType != null and problemType != ''">and PROBLEM_TYPE = #{problemType}</if>
  155. <if test="qualityTypeId != null and qualityTypeId != ''">and QUALITY_TYPE_ID = #{qualityTypeId}</if>
  156. <if test="defectTypeId != null and defectTypeId != ''">and DEFECT_TYPE_ID = #{defectTypeId}</if>
  157. <if test="fdbkId != null and fdbkId != ''">and FDBK_ID = #{fdbkId}</if>
  158. <if test="itemId != null and itemId != ''">and ITEM_ID = #{itemId}</if>
  159. <if test="waterUserId != null and waterUserId != ''">and WATER_USER_ID = #{waterUserId}</if>
  160. <if test="quote != null and quote != ''">and QUOTE = #{quote}</if>
  161. <if test="pblmId != null and pblmId != ''">and PBLM_ID = #{pblmId}</if>
  162. <if test="objId != null and objId != ''">and OBJ_ID = #{objId}</if>
  163. <if test="objType != null and objType != ''">and OBJ_TYPE = #{objType}</if>
  164. <if test="inspGroupId != null and inspGroupId != ''">and INSP_GROUP_ID = #{inspGroupId}</if>
  165. <if test="pguid != null and pguid != ''">and PGUID = #{pguid}</if>
  166. <if test="inspPblmType != null and inspPblmType != ''">and INSP_PBLM_TYPE = #{inspPblmType}</if>
  167. <if test="inspPblmCode != null and inspPblmCode != ''">and INSP_PBLM_CODE = #{inspPblmCode}</if>
  168. <if test="inspPblmName != null and inspPblmName != ''">and INSP_PBLM_NAME = #{inspPblmName}</if>
  169. <if test="inspPblmDesc != null and inspPblmDesc != ''">and INSP_PBLM_DESC = #{inspPblmDesc}</if>
  170. <if test="inspAddDesc != null and inspAddDesc != ''">and INSP_ADD_DESC = #{inspAddDesc}</if>
  171. <if test="pblmLong != null and pblmLong != ''">and PBLM_LONG = #{pblmLong}</if>
  172. <if test="pblmLat != null and pblmLat != ''">and PBLM_LAT = #{pblmLat}</if>
  173. <if test="ifCasePblm != null and ifCasePblm != ''">and IF_CASE_PBLM = #{ifCasePblm}</if>
  174. <if test="inspPblmOrgName != null and inspPblmOrgName != ''">and INSP_PBLM_ORG_NAME = #{inspPblmOrgName}</if>
  175. <if test="pblmPersName != null and pblmPersName != ''">and PBLM_PERS_NAME = #{pblmPersName}</if>
  176. </trim>
  177. </sql>
  178. <select id="get" resultMap="bisInspPblmRepeatResultMap" parameterType="String" >
  179. select b.PERS_NAME,s.*,p.insp_pblms_name,p.org_Id,p.check_point,p.pblm_desc,j.nm,CASE WHEN r.STATE IS NULL THEN '0' ELSE r.STATE END as state from BIS_INSP_PBLM_REPEAT s
  180. left join bis_insp_all_obj j on s.obj_id=j.obj_id
  181. left join bis_insp_rsvr_rgstr_repeat r on r.obj_id=j.obj_id
  182. join BIS_INSP_ALL_RLATION_PERS b on s.REC_PERS=b.GUID
  183. left join obj_insp_pblms p on p.guid=s.pblms_type_id
  184. where s.PBLM_ID=#{id}
  185. </select>
  186. <select id="getBy" resultMap="bisInspPblmRepeatResultMap">
  187. select <include refid="table_columns" /> from BIS_INSP_PBLM_REPEAT <include refid="page_where" />
  188. </select>
  189. <select id="findAll" resultMap="bisInspPblmRepeatResultMap">
  190. select <include refid="table_columns" /> from BIS_INSP_PBLM_REPEAT
  191. </select>
  192. <select id="findList" resultMap="bisInspPblmRepeatResultMap">
  193. select <include refid="table_columns" /> from BIS_INSP_PBLM_REPEAT <include refid="page_where" />
  194. </select>
  195. <select id="selectCount" resultType="int" >
  196. select count(ID) from BIS_INSP_PBLM_REPEAT <include refid="page_where" />
  197. </select>
  198. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspPblm">
  199. insert into BIS_INSP_PBLM_REPEAT( <include refid="table_columns" /> )
  200. values ( <include refid="entity_properties" /> )
  201. </insert>
  202. <delete id="delete" parameterType="java.lang.String">
  203. delete from BIS_INSP_PBLM_REPEAT where ID = #{id}
  204. </delete>
  205. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspPblm">
  206. delete from BIS_INSP_PBLM_REPEAT <include refid="page_where" />
  207. </delete>
  208. <update id="deleteInFlag" parameterType="java.lang.String">
  209. update BIS_INSP_PBLM_REPEAT set flag_valid = 0 where ID = #{id}
  210. </update>
  211. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspPblm">
  212. update BIS_INSP_PBLM_REPEAT
  213. <trim prefix="set" suffixOverrides=",">
  214. <if test="pblmStat != null and pblmStat != ''">PBLM_STAT = #{pblmStat},</if>
  215. <if test="reviOpin != null and reviOpin != ''">REVI_OPIN = #{reviOpin},</if>
  216. <if test="reviConc != null and reviConc != ''">REVI_CONC = #{reviConc},</if>
  217. <if test="reviOrgGuid != null and reviOrgGuid != ''">REVI_ORG_GUID = #{reviOrgGuid},</if>
  218. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  219. <if test="collTime != null">COLL_TIME = #{collTime},</if>
  220. <if test="recPers != null and recPers != ''">REC_PERS = #{recPers},</if>
  221. <if test="note != null and note != ''">NOTE = #{note},</if>
  222. <if test="regid != null and regid != ''">REGID = #{regid},</if>
  223. <if test="commonFileIds != null and commonFileIds != ''">COMMON_FILE_IDS = #{commonFileIds},</if>
  224. <if test="fileNo != null and fileNo != ''">FILE_NO = #{fileNo},</if>
  225. <if test="fileNoNumber != null and fileNoNumber != ''">FILE_NO_NUMBER = #{fileNoNumber},</if>
  226. <if test="pblmsId != null and pblmsId != ''">PBLMS_ID = #{pblmsId},</if>
  227. <if test="pblmsTypeId != null and pblmsTypeId != ''">PBLMS_TYPE_ID = #{pblmsTypeId},</if>
  228. <if test="villType != null and villType != ''">VILL_TYPE = #{villType},</if>
  229. <if test="cwsCode != null and cwsCode != ''">CWS_CODE = #{cwsCode},</if>
  230. <if test="villageCode != null and villageCode != ''">VILLAGE_CODE = #{villageCode},</if>
  231. <if test="hasVedio != null and hasVedio != ''">HAS_VEDIO = #{hasVedio},</if>
  232. <if test="problemType != null and problemType != ''">PROBLEM_TYPE = #{problemType},</if>
  233. <if test="qualityTypeId != null and qualityTypeId != ''">QUALITY_TYPE_ID = #{qualityTypeId},</if>
  234. <if test="defectTypeId != null and defectTypeId != ''">DEFECT_TYPE_ID = #{defectTypeId},</if>
  235. <if test="fdbkId != null and fdbkId != ''">FDBK_ID = #{fdbkId},</if>
  236. <if test="itemId != null and itemId != ''">ITEM_ID = #{itemId},</if>
  237. <if test="waterUserId != null and waterUserId != ''">WATER_USER_ID = #{waterUserId},</if>
  238. <if test="quote != null and quote != ''">QUOTE = #{quote},</if>
  239. <if test="pblmId != null and pblmId != ''">PBLM_ID = #{pblmId},</if>
  240. <if test="objId != null and objId != ''">OBJ_ID = #{objId},</if>
  241. <if test="objType != null and objType != ''">OBJ_TYPE = #{objType},</if>
  242. <if test="inspGroupId != null and inspGroupId != ''">INSP_GROUP_ID = #{inspGroupId},</if>
  243. <if test="pguid != null and pguid != ''">PGUID = #{pguid},</if>
  244. <if test="inspPblmType != null and inspPblmType != ''">INSP_PBLM_TYPE = #{inspPblmType},</if>
  245. <if test="inspPblmCode != null and inspPblmCode != ''">INSP_PBLM_CODE = #{inspPblmCode},</if>
  246. <if test="inspPblmName != null and inspPblmName != ''">INSP_PBLM_NAME = #{inspPblmName},</if>
  247. <if test="inspPblmDesc != null and inspPblmDesc != ''">INSP_PBLM_DESC = #{inspPblmDesc},</if>
  248. <if test="inspAddDesc != null and inspAddDesc != ''">INSP_ADD_DESC = #{inspAddDesc},</if>
  249. <if test="pblmLong != null and pblmLong != ''">PBLM_LONG = #{pblmLong},</if>
  250. <if test="pblmLat != null and pblmLat != ''">PBLM_LAT = #{pblmLat},</if>
  251. <if test="ifCasePblm != null and ifCasePblm != ''">IF_CASE_PBLM = #{ifCasePblm},</if>
  252. <if test="inspPblmOrgName != null and inspPblmOrgName != ''">INSP_PBLM_ORG_NAME = #{inspPblmOrgName},</if>
  253. <if test="pblmPersName != null and pblmPersName != ''">PBLM_PERS_NAME = #{pblmPersName},</if>
  254. </trim>
  255. <where>ID = #{id}</where>
  256. </update>
  257. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspPblm">
  258. update BIS_INSP_PBLM_REPEAT
  259. <trim prefix="set" suffixOverrides=",">
  260. <if test="pblmStat != null and pblmStat != ''">PBLM_STAT = #{pblmStat},</if>
  261. <if test="reviOpin != null and reviOpin != ''">REVI_OPIN = #{reviOpin},</if>
  262. <if test="reviConc != null and reviConc != ''">REVI_CONC = #{reviConc},</if>
  263. <if test="reviOrgGuid != null and reviOrgGuid != ''">REVI_ORG_GUID = #{reviOrgGuid},</if>
  264. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  265. <if test="collTime != null">COLL_TIME = #{collTime},</if>
  266. <if test="recPers != null and recPers != ''">REC_PERS = #{recPers},</if>
  267. <if test="note != null and note != ''">NOTE = #{note},</if>
  268. <if test="regid != null and regid != ''">REGID = #{regid},</if>
  269. <if test="commonFileIds != null and commonFileIds != ''">COMMON_FILE_IDS = #{commonFileIds},</if>
  270. <if test="fileNo != null and fileNo != ''">FILE_NO = #{fileNo},</if>
  271. <if test="fileNoNumber != null and fileNoNumber != ''">FILE_NO_NUMBER = #{fileNoNumber},</if>
  272. <if test="pblmsId != null and pblmsId != ''">PBLMS_ID = #{pblmsId},</if>
  273. <if test="pblmsTypeId != null and pblmsTypeId != ''">PBLMS_TYPE_ID = #{pblmsTypeId},</if>
  274. <if test="villType != null and villType != ''">VILL_TYPE = #{villType},</if>
  275. <if test="cwsCode != null and cwsCode != ''">CWS_CODE = #{cwsCode},</if>
  276. <if test="villageCode != null and villageCode != ''">VILLAGE_CODE = #{villageCode},</if>
  277. <if test="hasVedio != null and hasVedio != ''">HAS_VEDIO = #{hasVedio},</if>
  278. <if test="problemType != null and problemType != ''">PROBLEM_TYPE = #{problemType},</if>
  279. <if test="qualityTypeId != null and qualityTypeId != ''">QUALITY_TYPE_ID = #{qualityTypeId},</if>
  280. <if test="defectTypeId != null and defectTypeId != ''">DEFECT_TYPE_ID = #{defectTypeId},</if>
  281. <if test="fdbkId != null and fdbkId != ''">FDBK_ID = #{fdbkId},</if>
  282. <if test="itemId != null and itemId != ''">ITEM_ID = #{itemId},</if>
  283. <if test="waterUserId != null and waterUserId != ''">WATER_USER_ID = #{waterUserId},</if>
  284. <if test="quote != null and quote != ''">QUOTE = #{quote},</if>
  285. <if test="pblmId != null and pblmId != ''">PBLM_ID = #{pblmId},</if>
  286. <if test="objId != null and objId != ''">OBJ_ID = #{objId},</if>
  287. <if test="objType != null and objType != ''">OBJ_TYPE = #{objType},</if>
  288. <if test="inspGroupId != null and inspGroupId != ''">INSP_GROUP_ID = #{inspGroupId},</if>
  289. <if test="pguid != null and pguid != ''">PGUID = #{pguid},</if>
  290. <if test="inspPblmType != null and inspPblmType != ''">INSP_PBLM_TYPE = #{inspPblmType},</if>
  291. <if test="inspPblmCode != null and inspPblmCode != ''">INSP_PBLM_CODE = #{inspPblmCode},</if>
  292. <if test="inspPblmName != null and inspPblmName != ''">INSP_PBLM_NAME = #{inspPblmName},</if>
  293. <if test="inspPblmDesc != null and inspPblmDesc != ''">INSP_PBLM_DESC = #{inspPblmDesc},</if>
  294. <if test="inspAddDesc != null and inspAddDesc != ''">INSP_ADD_DESC = #{inspAddDesc},</if>
  295. <if test="pblmLong != null and pblmLong != ''">PBLM_LONG = #{pblmLong},</if>
  296. <if test="pblmLat != null and pblmLat != ''">PBLM_LAT = #{pblmLat},</if>
  297. <if test="ifCasePblm != null and ifCasePblm != ''">IF_CASE_PBLM = #{ifCasePblm},</if>
  298. <if test="inspPblmOrgName != null and inspPblmOrgName != ''">INSP_PBLM_ORG_NAME = #{inspPblmOrgName},</if>
  299. <if test="pblmPersName != null and pblmPersName != ''">PBLM_PERS_NAME = #{pblmPersName},</if>
  300. </trim>
  301. <include refid="page_where" />
  302. </update>
  303. <!-- 其他自定义SQL -->
  304. </mapper>