TacProvincePlanDictDao.xml 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  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.TacProvincePlanDictDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.TacProvincePlanDict" id="tacProvincePlanDictResultMap">
  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="state" column="STATE"/>
  13. <result property="orgId" column="ORG_ID"/>
  14. <result property="sortNo" column="SORT_NO"/>
  15. <result property="orgName" column="ORG_NAME"/>
  16. <result property="processName" column="PROCESS_NAME"/>
  17. <result property="processDesc" column="process_desc"/>
  18. </resultMap>
  19. <sql id="table_columns">
  20. ID,PROCESS_NAME,process_desc,
  21. AD_CODE,
  22. PERS_ID,
  23. INTM,
  24. UPTM,
  25. NOTE,
  26. DATA_STAT,
  27. STATE,
  28. ORG_ID,
  29. SORT_NO,
  30. ORG_NAME
  31. </sql>
  32. <sql id="entity_properties">
  33. #{id},#{processName},#{processDesc},
  34. #{adCode},
  35. #{persId},
  36. #{intm},
  37. #{uptm},
  38. #{note},
  39. #{dataStat},
  40. #{state},
  41. #{orgId},
  42. #{sortNo},
  43. #{orgName}
  44. </sql>
  45. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  46. <sql id="page_where">
  47. <trim prefix="where" prefixOverrides="and | or ">
  48. <if test="adCode != null and adCode != ''">and AD_CODE = #{adCode}</if>
  49. <if test="processName != null and processName != ''">and process_Name = #{processName}</if>
  50. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  51. <if test="intm != null">and INTM = #{intm}</if>
  52. <if test="uptm != null">and UPTM = #{uptm}</if>
  53. <if test="note != null and note != ''">and NOTE = #{note}</if>
  54. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  55. <if test="state != null and state != ''">and STATE = #{state}</if>
  56. <if test="orgId != null and orgId != ''">and ORG_ID = #{orgId}</if>
  57. <if test="sortNo != null and sortNo != ''">and SORT_NO = #{sortNo}</if>
  58. <if test="id != null and id != ''">and ID = #{id}</if>
  59. <if test="orgName != null and orgName != ''">and ORG_NAME = #{orgName}</if>
  60. <if test="processDesc != null and processDesc != ''">and process_Desc = #{processDesc}</if>
  61. </trim>
  62. </sql>
  63. <select id="findNotAddList" resultMap="tacProvincePlanDictResultMap">
  64. select
  65. <include refid="table_columns"/>
  66. from TAC_PROVINCE_PLAN_DICT t where t.org_id=#{orgId} and t.ID not in (
  67. select now_id from TAC_PROVINCE_PLAN_PROCESS s where s.org_id=#{orgId}
  68. )
  69. </select>
  70. <select id="get" resultMap="tacProvincePlanDictResultMap" parameterType="String">
  71. select
  72. <include refid="table_columns"/>
  73. from TAC_PROVINCE_PLAN_DICT where ID = #{id}
  74. </select>
  75. <select id="getMaxNextNo" resultType="int" parameterType="cn.com.goldenwater.dcproj.param.TacProvincePlanDictParam">
  76. select NVL(MAX(sort_no), 0) as sortNo from TAC_PROVINCE_PLAN_DICT
  77. <include refid="page_where"/>
  78. </select>
  79. <select id="getBy" resultMap="tacProvincePlanDictResultMap">
  80. select
  81. <include refid="table_columns"/>
  82. from TAC_PROVINCE_PLAN_DICT
  83. <include refid="page_where"/>
  84. </select>
  85. <select id="findAll" resultMap="tacProvincePlanDictResultMap">
  86. select
  87. <include refid="table_columns"/>
  88. from TAC_PROVINCE_PLAN_DICT
  89. </select>
  90. <select id="findList" resultMap="tacProvincePlanDictResultMap">
  91. select
  92. <include refid="table_columns"/>
  93. from TAC_PROVINCE_PLAN_DICT
  94. <include refid="page_where"/>
  95. order by sort_no asc
  96. </select>
  97. <select id="selectCount" resultType="int">
  98. select count(ID) from TAC_PROVINCE_PLAN_DICT
  99. <include refid="page_where"/>
  100. </select>
  101. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.TacProvincePlanDict">
  102. insert into TAC_PROVINCE_PLAN_DICT(
  103. <include refid="table_columns"/>
  104. )
  105. values (
  106. <include refid="entity_properties"/>
  107. )
  108. </insert>
  109. <delete id="delete" parameterType="java.lang.String">
  110. delete from TAC_PROVINCE_PLAN_DICT where ID = #{id}
  111. </delete>
  112. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.TacProvincePlanDict">
  113. delete from TAC_PROVINCE_PLAN_DICT
  114. <include refid="page_where"/>
  115. </delete>
  116. <update id="deleteInFlag" parameterType="java.lang.String">
  117. update TAC_PROVINCE_PLAN_DICT set flag_valid = 0 where ID = #{id}
  118. </update>
  119. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.TacProvincePlanDict">
  120. update TAC_PROVINCE_PLAN_DICT
  121. <trim prefix="set" suffixOverrides=",">
  122. <if test="processName != null and processName != ''">process_Name = #{processName},</if>
  123. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  124. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  125. <if test="intm != null">INTM = #{intm},</if>
  126. <if test="uptm != null">UPTM = #{uptm},</if>
  127. <if test="note != null and note != ''">NOTE = #{note},</if>
  128. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  129. <if test="state != null and state != ''">STATE = #{state},</if>
  130. <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
  131. <if test="sortNo != null and sortNo != ''">SORT_NO = #{sortNo},</if>
  132. <if test="orgName != null and orgName != ''">ORG_NAME = #{orgName},</if>
  133. <if test="processDesc != null and processDesc != ''">process_Desc = #{processDesc},</if>
  134. </trim>
  135. <where>ID = #{id}</where>
  136. </update>
  137. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.TacProvincePlanDict">
  138. update TAC_PROVINCE_PLAN_DICT
  139. <trim prefix="set" suffixOverrides=",">
  140. <if test="processName != null and processName != ''">process_Name = #{processName},</if>
  141. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  142. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  143. <if test="intm != null">INTM = #{intm},</if>
  144. <if test="uptm != null">UPTM = #{uptm},</if>
  145. <if test="note != null and note != ''">NOTE = #{note},</if>
  146. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  147. <if test="state != null and state != ''">STATE = #{state},</if>
  148. <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
  149. <if test="sortNo != null and sortNo != ''">SORT_NO = #{sortNo},</if>
  150. <if test="orgName != null and orgName != ''">ORG_NAME = #{orgName},</if>
  151. <if test="processDesc != null and processDesc != ''">process_Desc = #{processDesc},</if>
  152. </trim>
  153. <include refid="page_where"/>
  154. </update>
  155. <!-- 其他自定义SQL -->
  156. <select id="getJcStepId" resultType="String">
  157. SELECT NOW_ID
  158. FROM TAC_PROVINCE_PLAN_PROCESS
  159. WHERE NEXT_ID = '1'
  160. <if test="orgId != null and orgId != ''">AND ORG_ID = #{orgId}</if>
  161. <if test="province != null and province != ''">AND AD_CODE LIKE '${province}%'</if>
  162. </select>
  163. <!--获取浙江稽查最终阶段,浙江稽察最终阶段在最有一个阶段前,增加了整改数据推送阶段-->
  164. <select id="getJcStepIdZj" resultType="String">
  165. SELECT NOW_ID FROM TAC_PROVINCE_PLAN_PROCESS
  166. WHERE NEXT_ID=(
  167. SELECT NOW_ID FROM TAC_PROVINCE_PLAN_PROCESS
  168. WHERE NEXT_ID = '1'
  169. <if test="orgId != null and orgId != ''">AND ORG_ID = #{orgId}</if>
  170. <if test="province != null and province != ''">AND AD_CODE LIKE '${province}%'</if>
  171. )
  172. </select>
  173. </mapper>