BisInspRectProvinceDao.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  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.BisInspRectProvinceDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspRectProvince" id="bisInspRectProvinceResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="sndType" column="SND_TYPE"/>
  7. <result property="sndTitle" column="SND_TITLE"/>
  8. <result property="sndNub" column="SND_NUB"/>
  9. <result property="crrtTm" column="CRRT_TM"/>
  10. <result property="sndOrgId" column="SND_ORG_ID"/>
  11. <result property="sndOrgName" column="SND_ORG_NAME"/>
  12. <result property="rectOrgId" column="RECT_ORG_ID"/>
  13. <result property="rectOrgName" column="RECT_ORG_NAME"/>
  14. <result property="pjctSize" column="PJCT_SIZE"/>
  15. <result property="pblmSize" column="PBLM_SIZE"/>
  16. <result property="fileId" column="FILE_ID"/>
  17. <result property="fileName" column="FILE_NAME"/>
  18. <result property="filePath" column="FILE_PATH"/>
  19. <result property="rectTm" column="RECT_TM"/>
  20. <result property="rectPersId" column="RECT_PERS_ID"/>
  21. <result property="rectPersName" column="RECT_PERS_NAME"/>
  22. <result property="state" column="STATE"/>
  23. <result property="note" column="NOTE"/>
  24. <result property="persId" column="PERS_ID"/>
  25. <result property="persName" column="PERS_NAME"/>
  26. <result property="intm" column="INTM"/>
  27. <result property="uptm" column="UPTM"/>
  28. <result property="dataStat" column="DATA_STAT"/>
  29. <result property="sndTypeNm" column="SND_TYPE_NM"/>
  30. <result property="province" column="PROVINCE"/>
  31. <result property="isOvertime" column="isOvertime"/>
  32. </resultMap>
  33. <sql id="table_columns">
  34. ID,
  35. SND_TYPE,
  36. SND_TITLE,
  37. SND_NUB,
  38. CRRT_TM,
  39. SND_ORG_ID,
  40. SND_ORG_NAME,
  41. RECT_ORG_ID,
  42. RECT_ORG_NAME,
  43. PJCT_SIZE,
  44. PBLM_SIZE,
  45. FILE_ID,
  46. FILE_NAME,
  47. FILE_PATH,
  48. RECT_TM,
  49. RECT_PERS_ID,
  50. RECT_PERS_NAME,
  51. STATE,
  52. NOTE,
  53. PERS_ID,
  54. PERS_NAME,
  55. INTM,
  56. UPTM,
  57. DATA_STAT,
  58. SND_TYPE_NM,
  59. PROVINCE
  60. </sql>
  61. <sql id="entity_properties">
  62. #{id},
  63. #{sndType},
  64. #{sndTitle},
  65. #{sndNub},
  66. #{crrtTm},
  67. #{sndOrgId},
  68. #{sndOrgName},
  69. #{rectOrgId},
  70. #{rectOrgName},
  71. #{pjctSize},
  72. #{pblmSize},
  73. #{fileId},
  74. #{fileName},
  75. #{filePath},
  76. #{rectTm},
  77. #{rectPersId},
  78. #{rectPersName},
  79. #{state},
  80. #{note},
  81. #{persId},
  82. #{persName},
  83. #{intm},
  84. #{uptm},
  85. #{dataStat},
  86. #{sndTypeNm},
  87. #{province}
  88. </sql>
  89. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  90. <sql id="page_where">
  91. <trim prefix="where" prefixOverrides="and | or ">
  92. <if test="sndType != null and sndType != ''">and SND_TYPE = #{sndType}</if>
  93. <if test="sndTitle != null and sndTitle != ''">and SND_TITLE like concat('%',#{sndTitle},'%')</if>
  94. <if test="sndNub != null and sndNub != ''">and SND_NUB = #{sndNub}</if>
  95. <if test="crrtTm != null">and CRRT_TM = #{crrtTm}</if>
  96. <if test="sndOrgId != null and sndOrgId != ''">and SND_ORG_ID = #{sndOrgId}</if>
  97. <if test="sndOrgName != null and sndOrgName != ''">and SND_ORG_NAME = #{sndOrgName}</if>
  98. <if test="rectOrgId != null and rectOrgId != ''">and RECT_ORG_ID = #{rectOrgId}</if>
  99. <if test="rectOrgName != null and rectOrgName != ''">and RECT_ORG_NAME = #{rectOrgName}</if>
  100. <if test="pjctSize != null and pjctSize != ''">and PJCT_SIZE = #{pjctSize}</if>
  101. <if test="pblmSize != null and pblmSize != ''">and PBLM_SIZE = #{pblmSize}</if>
  102. <if test="fileId != null and fileId != ''">and FILE_ID = #{fileId}</if>
  103. <if test="fileName != null and fileName != ''">and FILE_NAME = #{fileName}</if>
  104. <if test="filePath != null and filePath != ''">and FILE_PATH = #{filePath}</if>
  105. <if test="rectTm != null">and RECT_TM = #{rectTm}</if>
  106. <if test="rectPersId != null and rectPersId != ''">and RECT_PERS_ID = #{rectPersId}</if>
  107. <if test="rectPersName != null and rectPersName != ''">and RECT_PERS_NAME = #{rectPersName}</if>
  108. <if test="state != null and state != ''">and STATE in (${state})</if>
  109. <if test="note != null and note != ''">and NOTE = #{note}</if>
  110. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  111. <if test="persName != null and persName != ''">and PERS_NAME = #{persName}</if>
  112. <if test="intm != null">and INTM = #{intm}</if>
  113. <if test="uptm != null">and UPTM = #{uptm}</if>
  114. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  115. <if test="year != null and year != ''">and to_char(intm,'yyyy') = #{year}</if>
  116. <if test="sndTypeNm != null and sndTypeNm != ''">and SND_TYPE_NM = #{sndTypeNm}</if>
  117. <if test="province != null and province != ''">and province like '${province}%'</if>
  118. and DATA_STAT='0'
  119. </trim>
  120. </sql>
  121. <select id="get" resultMap="bisInspRectProvinceResultMap" parameterType="String">
  122. select
  123. <include refid="table_columns"/>
  124. from BIS_INSP_RECT_PROVINCE where ID = #{id}
  125. </select>
  126. <select id="getBy" resultMap="bisInspRectProvinceResultMap">
  127. select
  128. <include refid="table_columns"/>
  129. from BIS_INSP_RECT_PROVINCE
  130. <include refid="page_where"/>
  131. </select>
  132. <select id="findAll" resultMap="bisInspRectProvinceResultMap">
  133. select
  134. <include refid="table_columns"/>
  135. from BIS_INSP_RECT_PROVINCE
  136. </select>
  137. <select id="findList" resultMap="bisInspRectProvinceResultMap">
  138. select
  139. <include refid="table_columns"/>,(case when crrt_tm &lt; sysdate then '0' else '1' end)isOvertime
  140. from BIS_INSP_RECT_PROVINCE
  141. <include refid="page_where"/>
  142. order by UPTM desc
  143. </select>
  144. <select id="selectCount" resultType="int">
  145. select count(ID) from BIS_INSP_RECT_PROVINCE
  146. <include refid="page_where"/>
  147. </select>
  148. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspRectProvince">
  149. insert into BIS_INSP_RECT_PROVINCE(
  150. <include refid="table_columns"/>
  151. )
  152. values (
  153. <include refid="entity_properties"/>
  154. )
  155. </insert>
  156. <delete id="delete" parameterType="java.lang.String">
  157. update BIS_INSP_RECT_PROVINCE set DATA_STAT='9' where ID = #{id}
  158. </delete>
  159. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspRectProvince">
  160. update BIS_INSP_RECT_PROVINCE set DATA_STAT='9'
  161. <include refid="page_where"/>
  162. </delete>
  163. <update id="deleteInFlag" parameterType="java.lang.String">
  164. update BIS_INSP_RECT_PROVINCE set DATA_STAT = '9' where ID = #{id}
  165. </update>
  166. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspRectProvince">
  167. update BIS_INSP_RECT_PROVINCE
  168. <trim prefix="set" suffixOverrides=",">
  169. <if test="sndType != null and sndType != ''">SND_TYPE = #{sndType},</if>
  170. <if test="sndTitle != null and sndTitle != ''">SND_TITLE = #{sndTitle},</if>
  171. <if test="sndNub != null and sndNub != ''">SND_NUB = #{sndNub},</if>
  172. <if test="crrtTm != null">CRRT_TM = #{crrtTm},</if>
  173. <if test="sndOrgId != null and sndOrgId != ''">SND_ORG_ID = #{sndOrgId},</if>
  174. <if test="sndOrgName != null and sndOrgName != ''">SND_ORG_NAME = #{sndOrgName},</if>
  175. <if test="rectOrgId != null and rectOrgId != ''">RECT_ORG_ID = #{rectOrgId},</if>
  176. <if test="rectOrgName != null and rectOrgName != ''">RECT_ORG_NAME = #{rectOrgName},</if>
  177. <if test="pjctSize != null and pjctSize != ''">PJCT_SIZE = #{pjctSize},</if>
  178. <if test="pblmSize != null and pblmSize != ''">PBLM_SIZE = #{pblmSize},</if>
  179. <if test="fileId != null and fileId != ''">FILE_ID = #{fileId},</if>
  180. <if test="fileName != null and fileName != ''">FILE_NAME = #{fileName},</if>
  181. <if test="filePath != null and filePath != ''">FILE_PATH = #{filePath},</if>
  182. <if test="rectTm != null">RECT_TM = #{rectTm},</if>
  183. <if test="rectPersId != null and rectPersId != ''">RECT_PERS_ID = #{rectPersId},</if>
  184. <if test="rectPersName != null and rectPersName != ''">RECT_PERS_NAME = #{rectPersName},</if>
  185. <if test="state != null and state != ''">STATE = #{state},</if>
  186. <if test="note != null and note != ''">NOTE = #{note},</if>
  187. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  188. <if test="persName != null and persName != ''">PERS_NAME = #{persName},</if>
  189. <if test="intm != null">INTM = #{intm},</if>
  190. <if test="uptm != null">UPTM = #{uptm},</if>
  191. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  192. <if test="sndTypeNm != null and sndTypeNm != ''">SND_TYPE_NM = #{sndTypeNm},</if>
  193. </trim>
  194. <where>ID = #{id}</where>
  195. </update>
  196. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspRectProvince">
  197. update BIS_INSP_RECT_PROVINCE
  198. <trim prefix="set" suffixOverrides=",">
  199. <if test="sndType != null and sndType != ''">SND_TYPE = #{sndType},</if>
  200. <if test="sndTitle != null and sndTitle != ''">SND_TITLE = #{sndTitle},</if>
  201. <if test="sndNub != null and sndNub != ''">SND_NUB = #{sndNub},</if>
  202. <if test="crrtTm != null">CRRT_TM = #{crrtTm},</if>
  203. <if test="sndOrgId != null and sndOrgId != ''">SND_ORG_ID = #{sndOrgId},</if>
  204. <if test="sndOrgName != null and sndOrgName != ''">SND_ORG_NAME = #{sndOrgName},</if>
  205. <if test="rectOrgId != null and rectOrgId != ''">RECT_ORG_ID = #{rectOrgId},</if>
  206. <if test="rectOrgName != null and rectOrgName != ''">RECT_ORG_NAME = #{rectOrgName},</if>
  207. <if test="pjctSize != null and pjctSize != ''">PJCT_SIZE = #{pjctSize},</if>
  208. <if test="pblmSize != null and pblmSize != ''">PBLM_SIZE = #{pblmSize},</if>
  209. <if test="fileId != null and fileId != ''">FILE_ID = #{fileId},</if>
  210. <if test="fileName != null and fileName != ''">FILE_NAME = #{fileName},</if>
  211. <if test="filePath != null and filePath != ''">FILE_PATH = #{filePath},</if>
  212. <if test="rectTm != null">RECT_TM = #{rectTm},</if>
  213. <if test="rectPersId != null and rectPersId != ''">RECT_PERS_ID = #{rectPersId},</if>
  214. <if test="rectPersName != null and rectPersName != ''">RECT_PERS_NAME = #{rectPersName},</if>
  215. <if test="state != null and state != ''">STATE = #{state},</if>
  216. <if test="note != null and note != ''">NOTE = #{note},</if>
  217. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  218. <if test="persName != null and persName != ''">PERS_NAME = #{persName},</if>
  219. <if test="intm != null">INTM = #{intm},</if>
  220. <if test="uptm != null">UPTM = #{uptm},</if>
  221. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  222. <if test="sndTypeNm != null and sndTypeNm != ''">SND_TYPE_NM = #{sndTypeNm},</if>
  223. </trim>
  224. <include refid="page_where"/>
  225. </update>
  226. <!-- 其他自定义SQL -->
  227. <update id="setFileNull" parameterType="java.lang.String">
  228. update BIS_INSP_RECT_PROVINCE set FILE_ID =NULL,FILE_NAME=NULL,FILE_PATH=NULL where ID = #{id}
  229. </update>
  230. </mapper>