9e82c83e56886c730c2d8f4dae6f4e7e2f4fe369.svn-base 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  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.TacInspPersAreaPrisDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.TacInspPersAreaPris" id="tacInspPersAreaPrisResultMap">
  5. <result property="avoidYrSize" column="AVOID_YR_SIZE"/>
  6. <result property="siSaPersNum" column="SI_SA_PERS_NUM"/>
  7. <result property="siNvPersNum" column="SI_NV_PERS_NUM"/>
  8. <result property="siBadPersNum" column="SI_BAD_PERS_NUM"/>
  9. <result property="siGoodPersNum" column="SI_GOOD_PERS_NUM"/>
  10. <result property="id" column="ID"/>
  11. <result property="yearBatchId" column="YEAR_BATCH_ID"/>
  12. <result property="year" column="YEAR"/>
  13. <result property="batch" column="BATCH"/>
  14. <result property="isCommon" column="IS_COMMON"/>
  15. <result property="isProbation" column="IS_PROBATION"/>
  16. <result property="isPick" column="IS_PICK"/>
  17. <result property="isFit" column="IS_FIT"/>
  18. <result property="isA" column="IS_A"/>
  19. <result property="isB" column="IS_B"/>
  20. <result property="isC" column="IS_C"/>
  21. <result property="isD" column="IS_D"/>
  22. <result property="isE" column="IS_E"/>
  23. <result property="isNew" column="IS_NEW"/>
  24. <result property="newSize" column="NEW_SIZE"/>
  25. <result property="isReason" column="IS_REASON"/>
  26. <result property="avoidSize" column="AVOID_SIZE"/>
  27. <result property="isArea" column="IS_AREA"/>
  28. <result property="isPorc" column="IS_PORC"/>
  29. <result property="persId" column="PERS_ID"/>
  30. <result property="inTm" column="IN_TM"/>
  31. <result property="upTm" column="UP_TM"/>
  32. <result property="dataStat" column="DATA_STAT"/>
  33. </resultMap>
  34. <sql id="table_columns">
  35. AVOID_YR_SIZE,
  36. SI_SA_PERS_NUM,
  37. SI_NV_PERS_NUM,
  38. SI_BAD_PERS_NUM,
  39. SI_GOOD_PERS_NUM,
  40. ID,
  41. YEAR_BATCH_ID,
  42. YEAR,
  43. BATCH,
  44. IS_COMMON,
  45. IS_PROBATION,
  46. IS_PICK,
  47. IS_FIT,
  48. IS_A,
  49. IS_B,
  50. IS_C,
  51. IS_D,
  52. IS_E,
  53. IS_NEW,
  54. NEW_SIZE,
  55. IS_REASON,
  56. AVOID_SIZE,
  57. IS_AREA,
  58. IS_PORC,
  59. PERS_ID,
  60. IN_TM,
  61. UP_TM,
  62. DATA_STAT
  63. </sql>
  64. <sql id="entity_properties">
  65. #{avoidYrSize},
  66. #{siSaPersNum},
  67. #{siNvPersNum},
  68. #{siBadPersNum},
  69. #{siGoodPersNum},
  70. #{id},
  71. #{yearBatchId},
  72. #{year},
  73. #{batch},
  74. #{isCommon},
  75. #{isProbation},
  76. #{isPick},
  77. #{isFit},
  78. #{isA},
  79. #{isB},
  80. #{isC},
  81. #{isD},
  82. #{isE},
  83. #{isNew},
  84. #{newSize},
  85. #{isReason},
  86. #{avoidSize},
  87. #{isArea},
  88. #{isPorc},
  89. #{persId},
  90. #{inTm},
  91. #{upTm},
  92. #{dataStat}
  93. </sql>
  94. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  95. <sql id="page_where">
  96. <trim prefix="where" prefixOverrides="and | or ">
  97. <if test="siSaPersNum != null and siSaPersNum != ''">and SI_SA_PERS_NUM = #{siSaPersNum}</if>
  98. <if test="siNvPersNum != null and siNvPersNum != ''">and SI_NV_PERS_NUM = #{siNvPersNum}</if>
  99. <if test="siBadPersNum != null and siBadPersNum != ''">and SI_BAD_PERS_NUM = #{siBadPersNum}</if>
  100. <if test="siGoodPersNum != null and siGoodPersNum != ''">and SI_GOOD_PERS_NUM = #{siGoodPersNum}</if>
  101. <if test="id != null and id != ''">and ID = #{id}</if>
  102. <if test="yearBatchId != null and yearBatchId != ''">and YEAR_BATCH_ID = #{yearBatchId}</if>
  103. <if test="year != null and year != ''">and YEAR = #{year}</if>
  104. <if test="batch != null and batch != ''">and BATCH = #{batch}</if>
  105. <if test="isCommon != null and isCommon != ''">and IS_COMMON = #{isCommon}</if>
  106. <if test="isProbation != null and isProbation != ''">and IS_PROBATION = #{isProbation}</if>
  107. <if test="isPick != null and isPick != ''">and IS_PICK = #{isPick}</if>
  108. <if test="isFit != null and isFit != ''">and IS_FIT = #{isFit}</if>
  109. <if test="isA != null and isA != ''">and IS_A = #{isA}</if>
  110. <if test="isB != null and isB != ''">and IS_B = #{isB}</if>
  111. <if test="isC != null and isC != ''">and IS_C = #{isC}</if>
  112. <if test="isD != null and isD != ''">and IS_D = #{isD}</if>
  113. <if test="isE != null and isE != ''">and IS_E = #{isE}</if>
  114. <if test="isNew != null and isNew != ''">and IS_NEW = #{isNew}</if>
  115. <if test="newSize != null and newSize != ''">and NEW_SIZE = #{newSize}</if>
  116. <if test="isReason != null and isReason != ''">and IS_REASON = #{isReason}</if>
  117. <if test="avoidSize != null and avoidSize != ''">and AVOID_SIZE = #{avoidSize}</if>
  118. <if test="isArea != null and isArea != ''">and IS_AREA = #{isArea}</if>
  119. <if test="isPorc != null and isPorc != ''">and IS_PORC = #{isPorc}</if>
  120. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  121. <if test="inTm != null">and IN_TM = #{inTm}</if>
  122. <if test="upTm != null">and UP_TM = #{upTm}</if>
  123. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  124. </trim>
  125. </sql>
  126. <select id="get" resultMap="tacInspPersAreaPrisResultMap" parameterType="String" >
  127. select <include refid="table_columns" /> from TAC_INSP_PERS_AREA_PRIS where ID = #{id}
  128. </select>
  129. <select id="getBy" resultMap="tacInspPersAreaPrisResultMap">
  130. select <include refid="table_columns" /> from TAC_INSP_PERS_AREA_PRIS <include refid="page_where" />
  131. </select>
  132. <select id="findAll" resultMap="tacInspPersAreaPrisResultMap">
  133. select <include refid="table_columns" /> from TAC_INSP_PERS_AREA_PRIS
  134. </select>
  135. <select id="findList" resultMap="tacInspPersAreaPrisResultMap">
  136. select <include refid="table_columns" /> from TAC_INSP_PERS_AREA_PRIS <include refid="page_where" />
  137. </select>
  138. <select id="selectCount" resultType="int" >
  139. select count(ID) from TAC_INSP_PERS_AREA_PRIS <include refid="page_where" />
  140. </select>
  141. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.TacInspPersAreaPris">
  142. insert into TAC_INSP_PERS_AREA_PRIS( <include refid="table_columns" /> )
  143. values ( <include refid="entity_properties" /> )
  144. </insert>
  145. <delete id="delete" parameterType="java.lang.String">
  146. delete from TAC_INSP_PERS_AREA_PRIS where ID = #{id}
  147. </delete>
  148. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.TacInspPersAreaPris">
  149. delete from TAC_INSP_PERS_AREA_PRIS <include refid="page_where" />
  150. </delete>
  151. <update id="deleteInFlag" parameterType="java.lang.String">
  152. update TAC_INSP_PERS_AREA_PRIS set flag_valid = 0 where ID = #{id}
  153. </update>
  154. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.TacInspPersAreaPris">
  155. update TAC_INSP_PERS_AREA_PRIS
  156. <trim prefix="set" suffixOverrides=",">
  157. SI_SA_PERS_NUM = #{siSaPersNum},
  158. SI_NV_PERS_NUM = #{siNvPersNum},
  159. SI_BAD_PERS_NUM = #{siBadPersNum},
  160. SI_GOOD_PERS_NUM = #{siGoodPersNum},
  161. <if test="id != null and id != ''">ID = #{id},</if>
  162. <if test="yearBatchId != null and yearBatchId != ''">YEAR_BATCH_ID = #{yearBatchId},</if>
  163. <if test="year != null and year != ''">YEAR = #{year},</if>
  164. <if test="batch != null and batch != ''">BATCH = #{batch},</if>
  165. <if test="isCommon != null and isCommon != ''">IS_COMMON = #{isCommon},</if>
  166. <if test="isProbation != null and isProbation != ''">IS_PROBATION = #{isProbation},</if>
  167. <if test="isPick != null and isPick != ''">IS_PICK = #{isPick},</if>
  168. <if test="isFit != null and isFit != ''">IS_FIT = #{isFit},</if>
  169. <if test="isA != null and isA != ''">IS_A = #{isA},</if>
  170. <if test="isB != null and isB != ''">IS_B = #{isB},</if>
  171. <if test="isC != null and isC != ''">IS_C = #{isC},</if>
  172. <if test="isD != null and isD != ''">IS_D = #{isD},</if>
  173. <if test="isE != null and isE != ''">IS_E = #{isE},</if>
  174. <if test="isNew != null and isNew != ''">IS_NEW = #{isNew},</if>
  175. NEW_SIZE = #{newSize},
  176. <if test="isReason != null and isReason != ''">IS_REASON = #{isReason},</if>
  177. AVOID_SIZE = #{avoidSize},
  178. <if test="isArea != null and isArea != ''">IS_AREA = #{isArea},</if>
  179. <if test="isPorc != null and isPorc != ''">IS_PORC = #{isPorc},</if>
  180. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  181. <if test="inTm != null">IN_TM = #{inTm},</if>
  182. <if test="upTm != null">UP_TM = #{upTm},</if>
  183. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  184. </trim>
  185. <where>ID = #{id}</where>
  186. </update>
  187. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.TacInspPersAreaPris">
  188. update TAC_INSP_PERS_AREA_PRIS
  189. <trim prefix="set" suffixOverrides=",">
  190. SI_SA_PERS_NUM = #{siSaPersNum},
  191. SI_NV_PERS_NUM = #{siNvPersNum},
  192. SI_BAD_PERS_NUM = #{siBadPersNum},
  193. SI_GOOD_PERS_NUM = #{siGoodPersNum},
  194. <if test="id != null and id != ''">ID = #{id},</if>
  195. <if test="yearBatchId != null and yearBatchId != ''">YEAR_BATCH_ID = #{yearBatchId},</if>
  196. <if test="year != null and year != ''">YEAR = #{year},</if>
  197. <if test="batch != null and batch != ''">BATCH = #{batch},</if>
  198. <if test="isCommon != null and isCommon != ''">IS_COMMON = #{isCommon},</if>
  199. <if test="isProbation != null and isProbation != ''">IS_PROBATION = #{isProbation},</if>
  200. <if test="isPick != null and isPick != ''">IS_PICK = #{isPick},</if>
  201. <if test="isFit != null and isFit != ''">IS_FIT = #{isFit},</if>
  202. <if test="isA != null and isA != ''">IS_A = #{isA},</if>
  203. <if test="isB != null and isB != ''">IS_B = #{isB},</if>
  204. <if test="isC != null and isC != ''">IS_C = #{isC},</if>
  205. <if test="isD != null and isD != ''">IS_D = #{isD},</if>
  206. <if test="isE != null and isE != ''">IS_E = #{isE},</if>
  207. <if test="isNew != null and isNew != ''">IS_NEW = #{isNew},</if>
  208. NEW_SIZE = #{newSize},
  209. <if test="isReason != null and isReason != ''">IS_REASON = #{isReason},</if>
  210. AVOID_SIZE = #{avoidSize},
  211. <if test="isArea != null and isArea != ''">IS_AREA = #{isArea},</if>
  212. <if test="isPorc != null and isPorc != ''">IS_PORC = #{isPorc},</if>
  213. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  214. <if test="inTm != null">IN_TM = #{inTm},</if>
  215. <if test="upTm != null">UP_TM = #{upTm},</if>
  216. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  217. </trim>
  218. <include refid="page_where" />
  219. </update>
  220. <!-- 其他自定义SQL -->
  221. </mapper>