ImpPblmInfoDao.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  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.ImpPblmInfoDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.ImpPblmInfo" id="impPblmInfoResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="sn" column="SN"/>
  7. <result property="proCode" column="PRO_CODE"/>
  8. <result property="proName" column="PRO_NAME"/>
  9. <result property="cityCode" column="CITY_CODE"/>
  10. <result property="cityName" column="CITY_NAME"/>
  11. <result property="countyCode" column="COUNTY_CODE"/>
  12. <result property="countyName" column="COUNTY_NAME"/>
  13. <result property="rsCode" column="RS_CODE"/>
  14. <result property="rsName" column="RS_NAME"/>
  15. <result property="engScal" column="ENG_SCAL"/>
  16. <result property="unit" column="UNIT"/>
  17. <result property="pblmType" column="PBLM_TYPE"/>
  18. <result property="pblmOption" column="PBLM_OPTION"/>
  19. <result property="pblmDesc" column="PBLM_DESC"/>
  20. <result property="pblmLevl" column="PBLM_LEVL"/>
  21. <result property="attach" column="ATTACH"/>
  22. <result property="pblmSn" column="PBLM_SN"/>
  23. <result property="pblmId" column="PBLM_ID"/>
  24. <result property="mnth" column="MNTH"/>
  25. <result property="oldGroupId" column="OLD_GROUP_ID"/>
  26. <result property="groupId" column="GROUP_ID"/>
  27. <result property="groupNm" column="GROUP_NM"/>
  28. <result property="regId" column="REG_ID"/>
  29. <result property="objId" column="OBJ_ID"/>
  30. <result property="note" column="NOTE"/>
  31. <result property="orgId" column="ORG_ID"/>
  32. <result property="orgNm" column="ORG_NM"/>
  33. <result property="pblmTypeId" column="PBLMS_TYPE_ID"/>
  34. </resultMap>
  35. <sql id="table_columns">
  36. ID,
  37. SN,
  38. PRO_CODE,
  39. PRO_NAME,
  40. CITY_CODE,
  41. CITY_NAME,
  42. COUNTY_CODE,
  43. COUNTY_NAME,
  44. RS_CODE,
  45. RS_NAME,
  46. ENG_SCAL,
  47. UNIT,
  48. PBLM_TYPE,
  49. PBLM_OPTION,
  50. PBLM_DESC,
  51. PBLM_LEVL,
  52. ATTACH,
  53. PBLM_SN,
  54. PBLM_ID,
  55. MNTH,
  56. OLD_GROUP_ID,
  57. GROUP_ID,
  58. GROUP_NM,
  59. REG_ID,
  60. OBJ_ID,
  61. NOTE,
  62. ORG_ID,
  63. ORG_NM,
  64. PBLMS_TYPE_ID
  65. </sql>
  66. <sql id="entity_properties">
  67. #{id},
  68. #{sn},
  69. #{proCode},
  70. #{proName},
  71. #{cityCode},
  72. #{cityName},
  73. #{countyCode},
  74. #{countyName},
  75. #{rsCode},
  76. #{rsName},
  77. #{engScal},
  78. #{unit},
  79. #{pblmType},
  80. #{pblmOption},
  81. #{pblmDesc},
  82. #{pblmLevl},
  83. #{attach},
  84. #{pblmSn},
  85. #{pblmId},
  86. #{mnth},
  87. #{oldGroupId},
  88. #{groupId},
  89. #{groupNm},
  90. #{regId},
  91. #{objId},
  92. #{note},
  93. #{orgId},
  94. #{orgNm},
  95. #{pblmTypeId}
  96. </sql>
  97. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  98. <sql id="page_where">
  99. <trim prefix="where" prefixOverrides="and | or ">
  100. <if test="sn != null and sn != ''">and SN = #{sn}</if>
  101. <if test="proCode != null and proCode != ''">and PRO_CODE = #{proCode}</if>
  102. <if test="proName != null and proName != ''">and PRO_NAME = #{proName}</if>
  103. <if test="cityCode != null and cityCode != ''">and CITY_CODE = #{cityCode}</if>
  104. <if test="cityName != null and cityName != ''">and CITY_NAME = #{cityName}</if>
  105. <if test="countyCode != null and countyCode != ''">and COUNTY_CODE = #{countyCode}</if>
  106. <if test="countyName != null and countyName != ''">and COUNTY_NAME = #{countyName}</if>
  107. <if test="rsCode != null and rsCode != ''">and RS_CODE = #{rsCode}</if>
  108. <if test="rsName != null and rsName != ''">and RS_NAME = #{rsName}</if>
  109. <if test="engScal != null and engScal != ''">and ENG_SCAL = #{engScal}</if>
  110. <if test="unit != null and unit != ''">and UNIT = #{unit}</if>
  111. <if test="pblmType != null and pblmType != ''">and PBLM_TYPE = #{pblmType}</if>
  112. <if test="pblmOption != null and pblmOption != ''">and PBLM_OPTION = #{pblmOption}</if>
  113. <if test="pblmDesc != null and pblmDesc != ''">and PBLM_DESC = #{pblmDesc}</if>
  114. <if test="pblmLevl != null and pblmLevl != ''">and PBLM_LEVL = #{pblmLevl}</if>
  115. <if test="attach != null and attach != ''">and ATTACH = #{attach}</if>
  116. <if test="pblmSn != null and pblmSn != ''">and PBLM_SN = #{pblmSn}</if>
  117. <if test="pblmId != null and pblmId != ''">and PBLM_ID = #{pblmId}</if>
  118. <if test="mnth != null and mnth != ''">and MNTH = #{mnth}</if>
  119. <if test="oldGroupId != null and oldGroupId != ''">and OLD_GROUP_ID = #{oldGroupId}</if>
  120. <if test="groupId != null and groupId != ''">and GROUP_ID = #{groupId}</if>
  121. <if test="groupNm != null and groupNm != ''">and GROUP_NM = #{groupNm}</if>
  122. <if test="regId != null and regId != ''">and REG_ID = #{regId}</if>
  123. <if test="objId != null and objId != ''">and OBJ_ID = #{objId}</if>
  124. <if test="note != null and note != ''">and NOTE = #{note},</if>
  125. <if test="orgId != null and orgId != ''">and ORG_ID = #{orgId}</if>
  126. <if test="orgNm != null and orgNm != ''">and ORG_NM = #{orgNm}</if>
  127. <if test="pblmTypeId != null and pblmTypeId != ''">AND PBLMS_TYPE_ID = #{pblmTypeId},</if>
  128. </trim>
  129. </sql>
  130. <select id="get" resultMap="impPblmInfoResultMap" parameterType="String">
  131. select
  132. <include refid="table_columns"/>
  133. from IMP_PBLM_INFO where ID = #{id}
  134. </select>
  135. <select id="getBy" resultMap="impPblmInfoResultMap">
  136. select
  137. <include refid="table_columns"/>
  138. from IMP_PBLM_INFO
  139. <include refid="page_where"/>
  140. </select>
  141. <select id="findAll" resultMap="impPblmInfoResultMap">
  142. select
  143. <include refid="table_columns"/>
  144. from IMP_PBLM_INFO
  145. </select>
  146. <select id="findList" resultMap="impPblmInfoResultMap">
  147. select
  148. <include refid="table_columns"/>
  149. from IMP_PBLM_INFO
  150. <include refid="page_where"/>
  151. </select>
  152. <select id="selectCount" resultType="int">
  153. select count(ID) from IMP_PBLM_INFO
  154. <include refid="page_where"/>
  155. </select>
  156. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.ImpPblmInfo">
  157. insert into IMP_PBLM_INFO(
  158. <include refid="table_columns"/>
  159. )
  160. values (
  161. <include refid="entity_properties"/>
  162. )
  163. </insert>
  164. <delete id="delete" parameterType="java.lang.String">
  165. delete from IMP_PBLM_INFO where ID = #{id}
  166. </delete>
  167. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.ImpPblmInfo">
  168. delete from IMP_PBLM_INFO
  169. <include refid="page_where"/>
  170. </delete>
  171. <update id="deleteInFlag" parameterType="java.lang.String">
  172. update IMP_PBLM_INFO set flag_valid = 0 where ID = #{id}
  173. </update>
  174. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.ImpPblmInfo">
  175. update IMP_PBLM_INFO
  176. <trim prefix="set" suffixOverrides=",">
  177. <if test="sn != null and sn != ''">SN = #{sn},</if>
  178. <if test="proCode != null and proCode != ''">PRO_CODE = #{proCode},</if>
  179. <if test="proName != null and proName != ''">PRO_NAME = #{proName},</if>
  180. <if test="cityCode != null and cityCode != ''">CITY_CODE = #{cityCode},</if>
  181. <if test="cityName != null and cityName != ''">CITY_NAME = #{cityName},</if>
  182. <if test="countyCode != null and countyCode != ''">COUNTY_CODE = #{countyCode},</if>
  183. <if test="countyName != null and countyName != ''">COUNTY_NAME = #{countyName},</if>
  184. <if test="rsCode != null and rsCode != ''">RS_CODE = #{rsCode},</if>
  185. <if test="rsName != null and rsName != ''">RS_NAME = #{rsName},</if>
  186. <if test="engScal != null and engScal != ''">ENG_SCAL = #{engScal},</if>
  187. <if test="unit != null and unit != ''">UNIT = #{unit},</if>
  188. <if test="pblmType != null and pblmType != ''">PBLM_TYPE = #{pblmType},</if>
  189. <if test="pblmOption != null and pblmOption != ''">PBLM_OPTION = #{pblmOption},</if>
  190. <if test="pblmDesc != null and pblmDesc != ''">PBLM_DESC = #{pblmDesc},</if>
  191. <if test="pblmLevl != null and pblmLevl != ''">PBLM_LEVL = #{pblmLevl},</if>
  192. <if test="attach != null and attach != ''">ATTACH = #{attach},</if>
  193. <if test="pblmSn != null and pblmSn != ''">PBLM_SN = #{pblmSn},</if>
  194. <if test="pblmId != null and pblmId != ''">PBLM_ID = #{pblmId},</if>
  195. <if test="mnth != null and mnth != ''">MNTH = #{mnth},</if>
  196. <if test="oldGroupId != null and oldGroupId != ''">OLD_GROUP_ID = #{oldGroupId},</if>
  197. <if test="groupId != null and groupId != ''">GROUP_ID = #{groupId},</if>
  198. <if test="groupNm != null and groupNm != ''">GROUP_NM = #{groupNm},</if>
  199. <if test="regId != null and regId != ''">REG_ID = #{regId},</if>
  200. <if test="objId != null and objId != ''">OBJ_ID = #{objId},</if>
  201. <if test="note != null and note != ''">NOTE = #{note},</if>
  202. <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
  203. <if test="orgNm != null and orgNm != ''">ORG_NM = #{orgNm},</if>
  204. <if test="pblmTypeId != null and pblmTypeId != ''">PBLMS_TYPE_ID = #{pblmTypeId},</if>
  205. </trim>
  206. <where>ID = #{id}</where>
  207. </update>
  208. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.ImpPblmInfo">
  209. update IMP_PBLM_INFO
  210. <trim prefix="set" suffixOverrides=",">
  211. <if test="sn != null and sn != ''">SN = #{sn},</if>
  212. <if test="proCode != null and proCode != ''">PRO_CODE = #{proCode},</if>
  213. <if test="proName != null and proName != ''">PRO_NAME = #{proName},</if>
  214. <if test="cityCode != null and cityCode != ''">CITY_CODE = #{cityCode},</if>
  215. <if test="cityName != null and cityName != ''">CITY_NAME = #{cityName},</if>
  216. <if test="countyCode != null and countyCode != ''">COUNTY_CODE = #{countyCode},</if>
  217. <if test="countyName != null and countyName != ''">COUNTY_NAME = #{countyName},</if>
  218. <if test="rsCode != null and rsCode != ''">RS_CODE = #{rsCode},</if>
  219. <if test="rsName != null and rsName != ''">RS_NAME = #{rsName},</if>
  220. <if test="engScal != null and engScal != ''">ENG_SCAL = #{engScal},</if>
  221. <if test="unit != null and unit != ''">UNIT = #{unit},</if>
  222. <if test="pblmType != null and pblmType != ''">PBLM_TYPE = #{pblmType},</if>
  223. <if test="pblmOption != null and pblmOption != ''">PBLM_OPTION = #{pblmOption},</if>
  224. <if test="pblmDesc != null and pblmDesc != ''">PBLM_DESC = #{pblmDesc},</if>
  225. <if test="pblmLevl != null and pblmLevl != ''">PBLM_LEVL = #{pblmLevl},</if>
  226. <if test="attach != null and attach != ''">ATTACH = #{attach},</if>
  227. <if test="pblmSn != null and pblmSn != ''">PBLM_SN = #{pblmSn},</if>
  228. <if test="pblmId != null and pblmId != ''">PBLM_ID = #{pblmId},</if>
  229. <if test="mnth != null and mnth != ''">MNTH = #{mnth},</if>
  230. <if test="oldGroupId != null and oldGroupId != ''">OLD_GROUP_ID = #{oldGroupId},</if>
  231. <if test="groupId != null and groupId != ''">GROUP_ID = #{groupId},</if>
  232. <if test="groupNm != null and groupNm != ''">GROUP_NM = #{groupNm},</if>
  233. <if test="regId != null and regId != ''">REG_ID = #{regId},</if>
  234. <if test="objId != null and objId != ''">OBJ_ID = #{objId},</if>
  235. <if test="note != null and note != ''">NOTE = #{note},</if>
  236. <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
  237. <if test="orgNm != null and orgNm != ''">ORG_NM = #{orgNm},</if>
  238. <if test="pblmTypeId != null and pblmTypeId != ''">PBLMS_TYPE_ID = #{pblmTypeId},</if>
  239. </trim>
  240. <include refid="page_where"/>
  241. </update>
  242. <!-- 其他自定义SQL -->
  243. </mapper>