BisInspRectProvinceDao.xml 11 KB

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