TacPawpBitopqPeqaaUnitDao.xml 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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.TacPawpBitopqPeqaaUnitDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.TacPawpBitopqPeqaaUnit" id="tacPawpBitopqPeqaaUnitResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="peqaaId" column="PEQAA_ID"/>
  7. <result property="unitType" column="UNIT_TYPE"/>
  8. <result property="unitId" column="UNIT_ID"/>
  9. <result property="unitNm" column="UNIT_NM"/>
  10. <result property="unitQlctn" column="UNIT_QLCTN"/>
  11. <result property="unitDfNum" column="UNIT_DF_NUM"/>
  12. <result property="unitCncltn" column="UNIT_CNCLTN"/>
  13. <result property="note" column="NOTE"/>
  14. <result property="persId" column="PERS_ID"/>
  15. <result property="intm" column="INTM"/>
  16. <result property="uptm" column="UPTM"/>
  17. <result property="dataStat" column="DATA_STAT"/>
  18. <result property="subName" column="sub_name"/>
  19. </resultMap>
  20. <sql id="table_columns">
  21. ID,
  22. PEQAA_ID,
  23. UNIT_TYPE,
  24. UNIT_ID,
  25. UNIT_NM,
  26. UNIT_QLCTN,
  27. UNIT_DF_NUM,
  28. UNIT_CNCLTN,
  29. NOTE,
  30. PERS_ID,
  31. INTM,
  32. UPTM,
  33. DATA_STAT
  34. </sql>
  35. <sql id="entity_properties">
  36. #{id},
  37. #{peqaaId},
  38. #{unitType},
  39. #{unitId},
  40. #{unitNm},
  41. #{unitQlctn},
  42. #{unitDfNum},
  43. #{unitCncltn},
  44. #{note},
  45. #{persId},
  46. #{intm},
  47. #{uptm},
  48. #{dataStat}
  49. </sql>
  50. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  51. <sql id="page_where">
  52. <trim prefix="where" prefixOverrides="and | or ">
  53. <if test="peqaaId != null and peqaaId != ''">and PEQAA_ID = #{peqaaId}</if>
  54. <if test="unitType != null and unitType != ''">and UNIT_TYPE = #{unitType}</if>
  55. <if test="unitId != null and unitId != ''">and UNIT_ID = #{unitId}</if>
  56. <if test="unitNm != null and unitNm != ''">and UNIT_NM like '%${unitNm}%'</if>
  57. <if test="unitQlctn != null and unitQlctn != ''">and UNIT_QLCTN = #{unitQlctn}</if>
  58. <if test="unitDfNum != null and unitDfNum != ''">and UNIT_DF_NUM = #{unitDfNum}</if>
  59. <if test="unitCncltn != null and unitCncltn != ''">and UNIT_CNCLTN = #{unitCncltn}</if>
  60. <if test="note != null and note != ''">and NOTE = #{note}</if>
  61. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  62. <if test="intm != null">and INTM = #{intm}</if>
  63. <if test="uptm != null">and UPTM = #{uptm}</if>
  64. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  65. </trim>
  66. </sql>
  67. <select id="get" resultMap="tacPawpBitopqPeqaaUnitResultMap" parameterType="String">
  68. select
  69. <include refid="table_columns"/>
  70. from TAC_PAWP_BITOPQ_PEQAA_UNIT where ID = #{id}
  71. </select>
  72. <select id="getBy" resultMap="tacPawpBitopqPeqaaUnitResultMap">
  73. select
  74. <include refid="table_columns"/>
  75. from TAC_PAWP_BITOPQ_PEQAA_UNIT
  76. <include refid="page_where"/>
  77. </select>
  78. <select id="findAll" resultMap="tacPawpBitopqPeqaaUnitResultMap">
  79. select
  80. <include refid="table_columns"/>
  81. from TAC_PAWP_BITOPQ_PEQAA_UNIT
  82. </select>
  83. <select id="findList" resultMap="tacPawpBitopqPeqaaUnitResultMap">
  84. select t.*,o.sub_name from TAC_PAWP_BITOPQ_PEQAA_UNIT t ,TAC_OBJ_SUBJECT o where t.unit_type=o.id
  85. <if test="peqaaId != null and peqaaId != ''">and t.PEQAA_ID = #{peqaaId}</if>
  86. <if test="unitType != null and unitType != ''">and t.UNIT_TYPE = #{unitType}</if>
  87. <if test="unitId != null and unitId != ''">and t.UNIT_ID = #{unitId}</if>
  88. <if test="unitNm != null and unitNm != ''">and t.UNIT_NM = #{unitNm}</if>
  89. <if test="unitQlctn != null and unitQlctn != ''">and t.UNIT_QLCTN = #{unitQlctn}</if>
  90. <if test="unitDfNum != null and unitDfNum != ''">and t.UNIT_DF_NUM = #{unitDfNum}</if>
  91. <if test="unitCncltn != null and unitCncltn != ''">and t.UNIT_CNCLTN = #{unitCncltn}</if>
  92. <if test="note != null and note != ''">and t.NOTE = #{note}</if>
  93. <if test="persId != null and persId != ''">and t.PERS_ID = #{persId}</if>
  94. <if test="intm != null">and t.INTM = #{intm}</if>
  95. <if test="uptm != null">and t.UPTM = #{uptm}</if>
  96. <if test="dataStat != null and dataStat != ''">and t.DATA_STAT = #{dataStat}</if>
  97. <if test="subName != null and subName != ''">and t.sub_name = #{subName}</if>
  98. </select>
  99. <select id="selectCount" resultType="int">
  100. select count(ID) from TAC_PAWP_BITOPQ_PEQAA_UNIT
  101. <include refid="page_where"/>
  102. </select>
  103. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.TacPawpBitopqPeqaaUnit">
  104. insert into TAC_PAWP_BITOPQ_PEQAA_UNIT(
  105. <include refid="table_columns"/>
  106. )
  107. values (
  108. <include refid="entity_properties"/>
  109. )
  110. </insert>
  111. <delete id="delete" parameterType="java.lang.String">
  112. delete from TAC_PAWP_BITOPQ_PEQAA_UNIT where ID = #{id}
  113. </delete>
  114. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.TacPawpBitopqPeqaaUnit">
  115. delete from TAC_PAWP_BITOPQ_PEQAA_UNIT
  116. <include refid="page_where"/>
  117. </delete>
  118. <update id="deleteInFlag" parameterType="java.lang.String">
  119. update TAC_PAWP_BITOPQ_PEQAA_UNIT set flag_valid = 0 where ID = #{id}
  120. </update>
  121. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.TacPawpBitopqPeqaaUnit">
  122. update TAC_PAWP_BITOPQ_PEQAA_UNIT
  123. <trim prefix="set" suffixOverrides=",">
  124. <if test="peqaaId != null and peqaaId != ''">PEQAA_ID = #{peqaaId},</if>
  125. <if test="unitType != null and unitType != ''">UNIT_TYPE = #{unitType},</if>
  126. <if test="unitId != null and unitId != ''">UNIT_ID = #{unitId},</if>
  127. <if test="unitNm != null and unitNm != ''">UNIT_NM = #{unitNm},</if>
  128. <if test="unitQlctn != null and unitQlctn != ''">UNIT_QLCTN = #{unitQlctn},</if>
  129. <if test="unitDfNum != null and unitDfNum != ''">UNIT_DF_NUM = #{unitDfNum},</if>
  130. <if test="unitCncltn != null and unitCncltn != ''">UNIT_CNCLTN = #{unitCncltn},</if>
  131. <if test="note != null">NOTE = #{note},</if>
  132. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  133. <if test="intm != null">INTM = #{intm},</if>
  134. <if test="uptm != null">UPTM = #{uptm},</if>
  135. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  136. </trim>
  137. <where>ID = #{id}</where>
  138. </update>
  139. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.TacPawpBitopqPeqaaUnit">
  140. update TAC_PAWP_BITOPQ_PEQAA_UNIT
  141. <trim prefix="set" suffixOverrides=",">
  142. <if test="peqaaId != null and peqaaId != ''">PEQAA_ID = #{peqaaId},</if>
  143. <if test="unitType != null and unitType != ''">UNIT_TYPE = #{unitType},</if>
  144. <if test="unitId != null and unitId != ''">UNIT_ID = #{unitId},</if>
  145. <if test="unitNm != null and unitNm != ''">UNIT_NM = #{unitNm},</if>
  146. <if test="unitQlctn != null and unitQlctn != ''">UNIT_QLCTN = #{unitQlctn},</if>
  147. <if test="unitDfNum != null and unitDfNum != ''">UNIT_DF_NUM = #{unitDfNum},</if>
  148. <if test="unitCncltn != null and unitCncltn != ''">UNIT_CNCLTN = #{unitCncltn},</if>
  149. <if test="note != null">NOTE = #{note},</if>
  150. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  151. <if test="intm != null">INTM = #{intm},</if>
  152. <if test="uptm != null">UPTM = #{uptm},</if>
  153. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  154. </trim>
  155. <include refid="page_where"/>
  156. </update>
  157. <!-- 其他自定义SQL -->
  158. </mapper>