TacProvincePlanProcessDao.xml 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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.TacProvincePlanProcessDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.TacProvincePlanProcess" id="tacProvincePlanProcessResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="adCode" column="AD_CODE"/>
  7. <result property="persId" column="PERS_ID"/>
  8. <result property="intm" column="INTM"/>
  9. <result property="uptm" column="UPTM"/>
  10. <result property="note" column="NOTE"/>
  11. <result property="dataStat" column="DATA_STAT"/>
  12. <result property="orgId" column="ORG_ID"/>
  13. <result property="sortNo" column="SORT_NO"/>
  14. <result property="orgName" column="ORG_NAME"/>
  15. <result property="prvId" column="PRV_ID"/>
  16. <result property="nextId" column="NEXT_ID"/>
  17. <result property="nowId" column="NOW_ID"/>
  18. <result property="prvStep" column="PRV_STEP"/>
  19. <result property="nextStep" column="NEXT_STEP"/>
  20. <result property="nowStep" column="NOW_STEP"/>
  21. <result property="isRevision" column="IS_REVISION"/>
  22. <result property="isExamine" column="IS_EXAMINE"/>
  23. </resultMap>
  24. <sql id="table_columns">
  25. ID,
  26. AD_CODE,
  27. PERS_ID,
  28. INTM,
  29. UPTM,
  30. NOTE,
  31. DATA_STAT,
  32. ORG_ID,
  33. SORT_NO,
  34. ORG_NAME,
  35. PRV_ID,
  36. NEXT_ID,
  37. NOW_ID,
  38. PRV_STEP,
  39. NEXT_STEP,
  40. NOW_STEP,
  41. IS_REVISION,
  42. IS_EXAMINE
  43. </sql>
  44. <sql id="entity_properties">
  45. #{id},
  46. #{adCode},
  47. #{persId},
  48. #{intm},
  49. #{uptm},
  50. #{note},
  51. #{dataStat},
  52. #{orgId},
  53. #{sortNo},
  54. #{orgName},
  55. #{prvId},
  56. #{nextId},
  57. #{nowId},
  58. #{prvStep},
  59. #{nextStep},
  60. #{nowStep},
  61. #{isRevision},
  62. #{isExamine}
  63. </sql>
  64. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  65. <sql id="page_where">
  66. <trim prefix="where" prefixOverrides="and | or ">
  67. <if test="adCode != null and adCode != ''">and AD_CODE = #{adCode}</if>
  68. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  69. <if test="intm != null">and INTM = #{intm}</if>
  70. <if test="uptm != null">and UPTM = #{uptm}</if>
  71. <if test="note != null and note != ''">and NOTE = #{note}</if>
  72. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  73. <if test="orgId != null and orgId != ''">and ORG_ID = #{orgId}</if>
  74. <if test="sortNo != null and sortNo != ''">and SORT_NO = #{sortNo}</if>
  75. <if test="orgName != null and orgName != ''">and ORG_NAME = #{orgName}</if>
  76. <if test="prvId != null and prvId != ''">and PRV_ID = #{prvId}</if>
  77. <if test="nextId != null and nextId != ''">and NEXT_ID = #{nextId}</if>
  78. <if test="nowId != null and nowId != ''">and NOW_ID = #{nowId}</if>
  79. <if test="prvStep != null and prvStep != ''">and PRV_STEP = #{prvStep}</if>
  80. <if test="nextStep != null and nextStep != ''">and NEXT_STEP = #{nextStep}</if>
  81. <if test="nowStep != null and nowStep != ''">and NOW_STEP = #{nowStep}</if>
  82. <if test="isRevision != null and isRevision != ''">and IS_REVISION = #{isRevision}</if>
  83. <if test="isExamine != null and isExamine != ''">and IS_EXAMINE = #{isExamine}</if>
  84. </trim>
  85. </sql>
  86. <select id="getMaxSortNo" resultType="int" parameterType="String">
  87. select NVL(MAX(sort_no), 0) as sort_no from TAC_PROVINCE_PLAN_PROCESS
  88. where org_id=#{orgId} and ad_code=#{adCode}
  89. </select>
  90. <select id="get" resultMap="tacProvincePlanProcessResultMap" parameterType="String" >
  91. select <include refid="table_columns" /> from TAC_PROVINCE_PLAN_PROCESS where ID = #{id}
  92. </select>
  93. <select id="getBy" resultMap="tacProvincePlanProcessResultMap">
  94. select <include refid="table_columns" /> from TAC_PROVINCE_PLAN_PROCESS <include refid="page_where" />
  95. </select>
  96. <select id="findAll" resultMap="tacProvincePlanProcessResultMap">
  97. select <include refid="table_columns" /> from TAC_PROVINCE_PLAN_PROCESS
  98. </select>
  99. <select id="findList" resultMap="tacProvincePlanProcessResultMap">
  100. select <include refid="table_columns" /> from TAC_PROVINCE_PLAN_PROCESS <include refid="page_where" />
  101. order by SORT_NO asc
  102. </select>
  103. <select id="selectCount" resultType="int" >
  104. select count(ID) from TAC_PROVINCE_PLAN_PROCESS <include refid="page_where" />
  105. </select>
  106. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.TacProvincePlanProcess">
  107. insert into TAC_PROVINCE_PLAN_PROCESS( <include refid="table_columns" /> )
  108. values ( <include refid="entity_properties" /> )
  109. </insert>
  110. <delete id="delete" parameterType="java.lang.String">
  111. delete from TAC_PROVINCE_PLAN_PROCESS where ID = #{id}
  112. </delete>
  113. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.TacProvincePlanProcess">
  114. delete from TAC_PROVINCE_PLAN_PROCESS <include refid="page_where" />
  115. </delete>
  116. <update id="deleteInFlag" parameterType="java.lang.String">
  117. update TAC_PROVINCE_PLAN_PROCESS set flag_valid = 0 where ID = #{id}
  118. </update>
  119. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.TacProvincePlanProcess">
  120. update TAC_PROVINCE_PLAN_PROCESS
  121. <trim prefix="set" suffixOverrides=",">
  122. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  123. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  124. <if test="intm != null">INTM = #{intm},</if>
  125. <if test="uptm != null">UPTM = #{uptm},</if>
  126. <if test="note != null and note != ''">NOTE = #{note},</if>
  127. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  128. <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
  129. <if test="sortNo != null and sortNo != ''">SORT_NO = #{sortNo},</if>
  130. <if test="orgName != null and orgName != ''">ORG_NAME = #{orgName},</if>
  131. <if test="prvId != null and prvId != ''">PRV_ID = #{prvId},</if>
  132. <if test="nextId != null and nextId != ''">NEXT_ID = #{nextId},</if>
  133. <if test="nowId != null and nowId != ''">NOW_ID = #{nowId},</if>
  134. <if test="prvStep != null and prvStep != ''">PRV_STEP = #{prvStep},</if>
  135. <if test="nextStep != null and nextStep != ''">NEXT_STEP = #{nextStep},</if>
  136. <if test="nowStep != null and nowStep != ''">NOW_STEP = #{nowStep},</if>
  137. <if test="isRevision != null and isRevision != ''">IS_REVISION = #{isRevision},</if>
  138. <if test="isExamine != null and isExamine != ''">IS_EXAMINE = #{isExamine},</if>
  139. </trim>
  140. <where>ID = #{id}</where>
  141. </update>
  142. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.TacProvincePlanProcess">
  143. update TAC_PROVINCE_PLAN_PROCESS
  144. <trim prefix="set" suffixOverrides=",">
  145. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  146. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  147. <if test="intm != null">INTM = #{intm},</if>
  148. <if test="uptm != null">UPTM = #{uptm},</if>
  149. <if test="note != null and note != ''">NOTE = #{note},</if>
  150. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  151. <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
  152. <if test="sortNo != null and sortNo != ''">SORT_NO = #{sortNo},</if>
  153. <if test="orgName != null and orgName != ''">ORG_NAME = #{orgName},</if>
  154. <if test="prvId != null and prvId != ''">PRV_ID = #{prvId},</if>
  155. <if test="nextId != null and nextId != ''">NEXT_ID = #{nextId},</if>
  156. <if test="nowId != null and nowId != ''">NOW_ID = #{nowId},</if>
  157. <if test="prvStep != null and prvStep != ''">PRV_STEP = #{prvStep},</if>
  158. <if test="nextStep != null and nextStep != ''">NEXT_STEP = #{nextStep},</if>
  159. <if test="nowStep != null and nowStep != ''">NOW_STEP = #{nowStep},</if>
  160. <if test="isRevision != null and isRevision != ''">IS_REVISION = #{isRevision},</if>
  161. <if test="isExamine != null and isExamine != ''">IS_EXAMINE = #{isExamine},</if>
  162. </trim>
  163. <include refid="page_where" />
  164. </update>
  165. <!-- 其他自定义SQL -->
  166. </mapper>