TacYearLotDao.xml 7.7 KB

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