TacPawpBstocmCmsPactListDao.xml 6.8 KB

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