b246a0b1e923ff2fb5b4e805962da4dddaefb07d.svn-base 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  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.BisInspAccuntDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspAccunt" id="bisInspAccuntResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="orgId" column="ORG_ID"/>
  7. <result property="province" column="PROVINCE"/>
  8. <result property="accuntPrp" column="ACCUNT_PRP"/>
  9. <result property="accuntMttr" column="ACCUNT_MTTR"/>
  10. <result property="accuntMprp" column="ACCUNT_MPRP"/>
  11. <result property="accuntName" column="ACCUNT_NAME"/>
  12. <result property="adCode" column="AD_CODE"/>
  13. <result property="adName" column="AD_NAME"/>
  14. <result property="loc" column="LOC"/>
  15. <result property="accuntItem" column="ACCUNT_ITEM"/>
  16. <result property="accuntKind" column="ACCUNT_KIND"/>
  17. <result property="accuntTm" column="ACCUNT_TM"/>
  18. <result property="accuntStat" column="ACCUNT_STAT"/>
  19. <result property="note" column="NOTE"/>
  20. <result property="persId" column="PERS_ID"/>
  21. <result property="intm" column="INTM"/>
  22. <result property="uptm" column="UPTM"/>
  23. <result property="unitName" column="UNIT_NAME"/>
  24. <result property="dataStat" column="DATA_STAT"/>
  25. </resultMap>
  26. <sql id="table_columns">
  27. ID,
  28. ORG_ID,
  29. PROVINCE,
  30. ACCUNT_PRP,
  31. ACCUNT_MTTR,
  32. ACCUNT_MPRP,
  33. ACCUNT_NAME,
  34. AD_CODE,
  35. AD_NAME,
  36. LOC,
  37. ACCUNT_ITEM,
  38. ACCUNT_KIND,
  39. ACCUNT_TM,
  40. ACCUNT_STAT,
  41. NOTE,
  42. PERS_ID,
  43. INTM,
  44. UPTM,
  45. UNIT_NAME,
  46. DATA_STAT
  47. </sql>
  48. <sql id="entity_properties">
  49. #{id},
  50. #{orgId},
  51. #{province},
  52. #{accuntPrp},
  53. #{accuntMttr},
  54. #{accuntMprp},
  55. #{accuntName},
  56. #{adCode},
  57. #{adName},
  58. #{loc},
  59. #{accuntItem},
  60. #{accuntKind},
  61. #{accuntTm},
  62. #{accuntStat},
  63. #{note},
  64. #{persId},
  65. #{intm},
  66. #{uptm},
  67. #{unitName},
  68. #{dataStat}
  69. </sql>
  70. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  71. <sql id="page_where">
  72. <trim prefix="where" prefixOverrides="and | or ">
  73. <if test="orgId != null and orgId != ''">and ORG_ID = #{orgId}</if>
  74. <if test="year != null and year != ''">and DATE_FORMAT(ACCUNT_TM,'%Y') = #{year}</if>
  75. <if test="province != null and province != ''">and PROVINCE like '%${province}%'</if>
  76. <if test="accuntPrp != null and accuntPrp != ''">and ACCUNT_PRP = #{accuntPrp}</if>
  77. <if test="accuntMttr != null and accuntMttr != ''">and ACCUNT_MTTR = #{accuntMttr}</if>
  78. <if test="accuntMprp != null and accuntMprp != ''">and ACCUNT_MPRP = #{accuntMprp}</if>
  79. <if test="accuntName != null and accuntName != ''">and ACCUNT_NAME = #{accuntName}</if>
  80. <if test="unitName != null and unitName != ''">and UNIT_NAME = #{unitName}</if>
  81. <if test="adCode != null and adCode != ''">and AD_CODE = #{adCode}</if>
  82. <if test="adName != null and adName != ''">and AD_NAME like '%${adName}%'</if>
  83. <if test="loc != null and loc != ''">and LOC = #{loc}</if>
  84. <if test="accuntItem != null and accuntItem != ''">and ACCUNT_ITEM = #{accuntItem}</if>
  85. <if test="accuntKind != null and accuntKind != ''">and ACCUNT_KIND like '%${accuntKind}%'</if>
  86. <if test="accuntTm != null">and ACCUNT_TM = #{accuntTm}</if>
  87. <if test="accuntStat != null and accuntStat != ''">and ACCUNT_STAT = #{accuntStat}</if>
  88. <if test="note != null and note != ''">and NOTE = #{note}</if>
  89. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  90. <if test="intm != null">and INTM = #{intm}</if>
  91. <if test="uptm != null">and UPTM = #{uptm}</if>
  92. and DATA_STAT ='0'
  93. </trim>
  94. </sql>
  95. <select id="get" resultMap="bisInspAccuntResultMap" parameterType="String">
  96. select
  97. <include refid="table_columns"/>
  98. from BIS_INSP_ACCUNT where ID = #{id}
  99. </select>
  100. <select id="getBy" resultMap="bisInspAccuntResultMap">
  101. select
  102. <include refid="table_columns"/>
  103. from BIS_INSP_ACCUNT
  104. <include refid="page_where"/>
  105. </select>
  106. <select id="findAll" resultMap="bisInspAccuntResultMap">
  107. select
  108. <include refid="table_columns"/>
  109. from BIS_INSP_ACCUNT
  110. </select>
  111. <select id="findList" resultMap="bisInspAccuntResultMap">
  112. select
  113. <include refid="table_columns"/>
  114. from BIS_INSP_ACCUNT
  115. <include refid="page_where"/>
  116. </select>
  117. <select id="selectCount" resultType="int">
  118. select count(ID) from BIS_INSP_ACCUNT
  119. <include refid="page_where"/>
  120. </select>
  121. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspAccunt">
  122. insert into BIS_INSP_ACCUNT(
  123. <include refid="table_columns"/>
  124. )
  125. values (
  126. <include refid="entity_properties"/>
  127. )
  128. </insert>
  129. <delete id="delete" parameterType="java.lang.String">
  130. update BIS_INSP_ACCUNT set DATA_STAT='9' where ID = #{id}
  131. </delete>
  132. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspAccunt">
  133. delete from BIS_INSP_ACCUNT
  134. <include refid="page_where"/>
  135. </delete>
  136. <update id="deleteInFlag" parameterType="java.lang.String">
  137. update BIS_INSP_ACCUNT set flag_valid = 0 where ID = #{id}
  138. </update>
  139. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspAccunt">
  140. update BIS_INSP_ACCUNT
  141. <trim prefix="set" suffixOverrides=",">
  142. <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
  143. <if test="province != null and province != ''">PROVINCE = #{province},</if>
  144. <if test="accuntPrp != null and accuntPrp != ''">ACCUNT_PRP = #{accuntPrp},</if>
  145. <if test="accuntMttr != null and accuntMttr != ''">ACCUNT_MTTR = #{accuntMttr},</if>
  146. <if test="accuntMprp != null and accuntMprp != ''">ACCUNT_MPRP = #{accuntMprp},</if>
  147. <if test="accuntName != null and accuntName != ''">ACCUNT_NAME = #{accuntName},</if>
  148. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  149. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  150. <if test="loc != null and loc != ''">LOC = #{loc},</if>
  151. <if test="accuntItem != null and accuntItem != ''">ACCUNT_ITEM = #{accuntItem},</if>
  152. <if test="accuntKind != null and accuntKind != ''">ACCUNT_KIND = #{accuntKind},</if>
  153. <if test="accuntTm != null">ACCUNT_TM = #{accuntTm},</if>
  154. <if test="accuntStat != null and accuntStat != ''">ACCUNT_STAT = #{accuntStat},</if>
  155. <if test="note != null and note != ''">NOTE = #{note},</if>
  156. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  157. <if test="intm != null">INTM = #{intm},</if>
  158. <if test="uptm != null">UPTM = #{uptm},</if>
  159. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  160. </trim>
  161. <where>ID = #{id}</where>
  162. </update>
  163. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspAccunt">
  164. update BIS_INSP_ACCUNT
  165. <trim prefix="set" suffixOverrides=",">
  166. <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
  167. <if test="province != null and province != ''">PROVINCE = #{province},</if>
  168. <if test="accuntPrp != null and accuntPrp != ''">ACCUNT_PRP = #{accuntPrp},</if>
  169. <if test="accuntMttr != null and accuntMttr != ''">ACCUNT_MTTR = #{accuntMttr},</if>
  170. <if test="accuntMprp != null and accuntMprp != ''">ACCUNT_MPRP = #{accuntMprp},</if>
  171. <if test="accuntName != null and accuntName != ''">ACCUNT_NAME = #{accuntName},</if>
  172. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  173. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  174. <if test="loc != null and loc != ''">LOC = #{loc},</if>
  175. <if test="accuntItem != null and accuntItem != ''">ACCUNT_ITEM = #{accuntItem},</if>
  176. <if test="accuntKind != null and accuntKind != ''">ACCUNT_KIND = #{accuntKind},</if>
  177. <if test="accuntTm != null">ACCUNT_TM = #{accuntTm},</if>
  178. <if test="accuntStat != null and accuntStat != ''">ACCUNT_STAT = #{accuntStat},</if>
  179. <if test="note != null and note != ''">NOTE = #{note},</if>
  180. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  181. <if test="intm != null">INTM = #{intm},</if>
  182. <if test="uptm != null">UPTM = #{uptm},</if>
  183. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  184. </trim>
  185. <include refid="page_where"/>
  186. </update>
  187. <!-- 其他自定义SQL -->
  188. </mapper>