TacUnitEvaluationDao.xml 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  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.TacUnitEvaluationDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.TacUnitEvaluation" id="tacUnitEvaluationResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="yearBatchId" column="YEAR_BATCH_ID"/>
  7. <result property="year" column="YEAR"/>
  8. <result property="batch" column="BATCH"/>
  9. <result property="groupId" column="GROUP_ID"/>
  10. <result property="groupNm" column="GROUP_NM"/>
  11. <result property="persId" column="PERS_ID"/>
  12. <result property="roleType" column="ROLE_TYPE"/>
  13. <result property="workKap" column="WORK_KAP"/>
  14. <result property="bizAb" column="BIZ_AB"/>
  15. <result property="workQu" column="WORK_QU"/>
  16. <result property="scoreA" column="SCORE_A"/>
  17. <result property="synLot" column="SYN_LOT"/>
  18. <result property="scoreB" column="SCORE_B"/>
  19. <result property="scoreTot" column="SCORE_TOT"/>
  20. <result property="isWorkHard" column="IS_WORK_HARD"/>
  21. <result property="isHonest" column="IS_HONEST"/>
  22. <result property="lotWorkId" column="LOT_WORK_ID"/>
  23. <result property="lotWorkRole" column="LOT_WORK_ROLE"/>
  24. <result property="note" column="NOTE"/>
  25. <result property="ctPersId" column="CT_PERS_ID"/>
  26. <result property="inTm" column="IN_TM"/>
  27. <result property="upTm" column="UP_TM"/>
  28. <result property="dataStat" column="DATA_STAT"/>
  29. </resultMap>
  30. <sql id="table_columns">
  31. ID,
  32. YEAR_BATCH_ID,
  33. YEAR,
  34. BATCH,
  35. GROUP_ID,
  36. GROUP_NM,
  37. PERS_ID,
  38. ROLE_TYPE,
  39. WORK_KAP,
  40. BIZ_AB,
  41. WORK_QU,
  42. SCORE_A,
  43. SYN_LOT,
  44. SCORE_B,
  45. SCORE_TOT,
  46. IS_WORK_HARD,
  47. IS_HONEST,
  48. LOT_WORK_ID,
  49. LOT_WORK_ROLE,
  50. NOTE,
  51. CT_PERS_ID,
  52. IN_TM,
  53. UP_TM,
  54. DATA_STAT
  55. </sql>
  56. <sql id="entity_properties">
  57. #{id},
  58. #{yearBatchId},
  59. #{year},
  60. #{batch},
  61. #{groupId},
  62. #{groupNm},
  63. #{persId},
  64. #{roleType},
  65. #{workKap},
  66. #{bizAb},
  67. #{workQu},
  68. #{scoreA},
  69. #{synLot},
  70. #{scoreB},
  71. #{scoreTot},
  72. #{isWorkHard},
  73. #{isHonest},
  74. #{lotWorkId},
  75. #{lotWorkRole},
  76. #{note},
  77. #{ctPersId},
  78. #{inTm},
  79. #{upTm},
  80. #{dataStat}
  81. </sql>
  82. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  83. <sql id="page_where">
  84. <trim prefix="where" prefixOverrides="and | or ">
  85. <if test="yearBatchId != null and yearBatchId != ''">and YEAR_BATCH_ID = #{yearBatchId}</if>
  86. <if test="year != null and year != ''">and YEAR = #{year}</if>
  87. <if test="batch != null and batch != ''">and BATCH = #{batch}</if>
  88. <if test="groupId != null and groupId != ''">and GROUP_ID = #{groupId}</if>
  89. <if test="groupNm != null and groupNm != ''">and GROUP_NM = #{groupNm}</if>
  90. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  91. <if test="roleType != null and roleType != ''">and ROLE_TYPE = #{roleType}</if>
  92. <if test="workKap != null and workKap != ''">and WORK_KAP = #{workKap}</if>
  93. <if test="bizAb != null and bizAb != ''">and BIZ_AB = #{bizAb}</if>
  94. <if test="workQu != null and workQu != ''">and WORK_QU = #{workQu}</if>
  95. <if test="scoreA != null and scoreA != ''">and SCORE_A = #{scoreA}</if>
  96. <if test="synLot != null and synLot != ''">and SYN_LOT = #{synLot}</if>
  97. <if test="scoreB != null and scoreB != ''">and SCORE_B = #{scoreB}</if>
  98. <if test="scoreTot != null and scoreTot != ''">and SCORE_TOT = #{scoreTot}</if>
  99. <if test="isWorkHard != null and isWorkHard != ''">and IS_WORK_HARD = #{isWorkHard}</if>
  100. <if test="isHonest != null and isHonest != ''">and IS_HONEST = #{isHonest}</if>
  101. <if test="lotWorkId != null and lotWorkId != ''">and LOT_WORK_ID = #{lotWorkId}</if>
  102. <if test="lotWorkRole != null and lotWorkRole != ''">and LOT_WORK_ROLE = #{lotWorkRole}</if>
  103. <if test="note != null and note != ''">and NOTE = #{note}</if>
  104. <if test="ctPersId != null and ctPersId != ''">and CT_PERS_ID = #{ctPersId}</if>
  105. <if test="inTm != null">and IN_TM = #{inTm}</if>
  106. <if test="upTm != null">and UP_TM = #{upTm}</if>
  107. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  108. </trim>
  109. </sql>
  110. <select id="get" resultMap="tacUnitEvaluationResultMap" parameterType="String" >
  111. select <include refid="table_columns" /> from TAC_UNIT_EVALUATION where ID = #{id}
  112. </select>
  113. <select id="getBy" resultMap="tacUnitEvaluationResultMap">
  114. select <include refid="table_columns" /> from TAC_UNIT_EVALUATION <include refid="page_where" />
  115. </select>
  116. <select id="findAll" resultMap="tacUnitEvaluationResultMap">
  117. select <include refid="table_columns" /> from TAC_UNIT_EVALUATION
  118. </select>
  119. <select id="findList" resultMap="tacUnitEvaluationResultMap">
  120. select <include refid="table_columns" /> from TAC_UNIT_EVALUATION <include refid="page_where" />
  121. </select>
  122. <select id="selectCount" resultType="int" >
  123. select count(ID) from TAC_UNIT_EVALUATION <include refid="page_where" />
  124. </select>
  125. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.TacUnitEvaluation">
  126. insert into TAC_UNIT_EVALUATION( <include refid="table_columns" /> )
  127. values ( <include refid="entity_properties" /> )
  128. </insert>
  129. <delete id="delete" parameterType="java.lang.String">
  130. delete from TAC_UNIT_EVALUATION where ID = #{id}
  131. </delete>
  132. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.TacUnitEvaluation">
  133. delete from TAC_UNIT_EVALUATION <include refid="page_where" />
  134. </delete>
  135. <update id="deleteInFlag" parameterType="java.lang.String">
  136. update TAC_UNIT_EVALUATION set flag_valid = 0 where ID = #{id}
  137. </update>
  138. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.TacUnitEvaluation">
  139. update TAC_UNIT_EVALUATION
  140. <trim prefix="set" suffixOverrides=",">
  141. <if test="yearBatchId != null and yearBatchId != ''">YEAR_BATCH_ID = #{yearBatchId},</if>
  142. <if test="year != null and year != ''">YEAR = #{year},</if>
  143. <if test="batch != null and batch != ''">BATCH = #{batch},</if>
  144. <if test="groupId != null and groupId != ''">GROUP_ID = #{groupId},</if>
  145. <if test="groupNm != null and groupNm != ''">GROUP_NM = #{groupNm},</if>
  146. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  147. <if test="roleType != null and roleType != ''">ROLE_TYPE = #{roleType},</if>
  148. <if test="workKap != null and workKap != ''">WORK_KAP = #{workKap},</if>
  149. <if test="bizAb != null and bizAb != ''">BIZ_AB = #{bizAb},</if>
  150. <if test="workQu != null and workQu != ''">WORK_QU = #{workQu},</if>
  151. <if test="scoreA != null and scoreA != ''">SCORE_A = #{scoreA},</if>
  152. <if test="synLot != null and synLot != ''">SYN_LOT = #{synLot},</if>
  153. <if test="scoreB != null and scoreB != ''">SCORE_B = #{scoreB},</if>
  154. <if test="scoreTot != null and scoreTot != ''">SCORE_TOT = #{scoreTot},</if>
  155. <if test="isWorkHard != null and isWorkHard != ''">IS_WORK_HARD = #{isWorkHard},</if>
  156. <if test="isHonest != null and isHonest != ''">IS_HONEST = #{isHonest},</if>
  157. <if test="lotWorkId != null and lotWorkId != ''">LOT_WORK_ID = #{lotWorkId},</if>
  158. <if test="lotWorkRole != null and lotWorkRole != ''">LOT_WORK_ROLE = #{lotWorkRole},</if>
  159. <if test="note != null and note != ''">NOTE = #{note},</if>
  160. <if test="ctPersId != null and ctPersId != ''">CT_PERS_ID = #{ctPersId},</if>
  161. <if test="inTm != null">IN_TM = #{inTm},</if>
  162. <if test="upTm != null">UP_TM = #{upTm},</if>
  163. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  164. </trim>
  165. <where>ID = #{id}</where>
  166. </update>
  167. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.TacUnitEvaluation">
  168. update TAC_UNIT_EVALUATION
  169. <trim prefix="set" suffixOverrides=",">
  170. <if test="yearBatchId != null and yearBatchId != ''">YEAR_BATCH_ID = #{yearBatchId},</if>
  171. <if test="year != null and year != ''">YEAR = #{year},</if>
  172. <if test="batch != null and batch != ''">BATCH = #{batch},</if>
  173. <if test="groupId != null and groupId != ''">GROUP_ID = #{groupId},</if>
  174. <if test="groupNm != null and groupNm != ''">GROUP_NM = #{groupNm},</if>
  175. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  176. <if test="roleType != null and roleType != ''">ROLE_TYPE = #{roleType},</if>
  177. <if test="workKap != null and workKap != ''">WORK_KAP = #{workKap},</if>
  178. <if test="bizAb != null and bizAb != ''">BIZ_AB = #{bizAb},</if>
  179. <if test="workQu != null and workQu != ''">WORK_QU = #{workQu},</if>
  180. <if test="scoreA != null and scoreA != ''">SCORE_A = #{scoreA},</if>
  181. <if test="synLot != null and synLot != ''">SYN_LOT = #{synLot},</if>
  182. <if test="scoreB != null and scoreB != ''">SCORE_B = #{scoreB},</if>
  183. <if test="scoreTot != null and scoreTot != ''">SCORE_TOT = #{scoreTot},</if>
  184. <if test="isWorkHard != null and isWorkHard != ''">IS_WORK_HARD = #{isWorkHard},</if>
  185. <if test="isHonest != null and isHonest != ''">IS_HONEST = #{isHonest},</if>
  186. <if test="lotWorkId != null and lotWorkId != ''">LOT_WORK_ID = #{lotWorkId},</if>
  187. <if test="lotWorkRole != null and lotWorkRole != ''">LOT_WORK_ROLE = #{lotWorkRole},</if>
  188. <if test="note != null and note != ''">NOTE = #{note},</if>
  189. <if test="ctPersId != null and ctPersId != ''">CT_PERS_ID = #{ctPersId},</if>
  190. <if test="inTm != null">IN_TM = #{inTm},</if>
  191. <if test="upTm != null">UP_TM = #{upTm},</if>
  192. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  193. </trim>
  194. <include refid="page_where" />
  195. </update>
  196. <!-- 其他自定义SQL -->
  197. </mapper>