882e247855afaec85dfd99f06a48f0e4ee69756d.svn-base 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  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.BisInspPlanYearDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspPlanYear" id="bisInspPlanYearResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="adCode" column="AD_CODE"/>
  7. <result property="chkYear" column="CHK_YEAR"/>
  8. <result property="chkName" column="CHK_NAME"/>
  9. <result property="chkType" column="CHK_TYPE"/>
  10. <result property="planSttm" column="PLAN_STTM"/>
  11. <result property="planEntm" column="PLAN_ENTM"/>
  12. <result property="leadDep" column="LEAD_DEP"/>
  13. <result property="joinDep" column="JOIN_DEP"/>
  14. <result property="chkForm" column="CHK_FORM"/>
  15. <result property="chkScope" column="CHK_SCOPE"/>
  16. <result property="chkRly" column="CHK_RLY"/>
  17. <result property="note" column="NOTE"/>
  18. <result property="persId" column="PERS_ID"/>
  19. <result property="intm" column="INTM"/>
  20. <result property="uptm" column="UPTM"/>
  21. <result property="dataStat" column="DATA_STAT"/>
  22. <result property="state" column="STATE"/>
  23. <result property="ordr" column="ORDR"/>
  24. <result property="objType" column="OBJ_TYPE"/>
  25. <result property="objName" column="OBJ_NAME"/>
  26. <result property="leadDepId" column="LEAD_DEP_ID"/>
  27. <result property="chkContent" column="CHK_CONTENT"/>
  28. </resultMap>
  29. <sql id="table_columns">
  30. ID,
  31. AD_CODE,
  32. CHK_YEAR,
  33. CHK_NAME,
  34. CHK_TYPE,
  35. PLAN_STTM,
  36. PLAN_ENTM,
  37. LEAD_DEP,
  38. JOIN_DEP,
  39. CHK_FORM,
  40. CHK_SCOPE,
  41. CHK_RLY,
  42. NOTE,
  43. PERS_ID,
  44. INTM,
  45. UPTM,
  46. DATA_STAT,
  47. STATE,
  48. ORDR,
  49. OBJ_TYPE,
  50. OBJ_NAME,
  51. LEAD_DEP_ID,
  52. CHK_CONTENT
  53. </sql>
  54. <sql id="entity_properties">
  55. #{id},
  56. #{adCode},
  57. #{chkYear},
  58. #{chkName},
  59. #{chkType},
  60. #{planSttm},
  61. #{planEntm},
  62. #{leadDep},
  63. #{joinDep},
  64. #{chkForm},
  65. #{chkScope},
  66. #{chkRly},
  67. #{note},
  68. #{persId},
  69. #{intm},
  70. #{uptm},
  71. #{dataStat},
  72. #{state},
  73. #{ordr},
  74. #{objType},
  75. #{objName},
  76. #{leadDepId},
  77. #{chkContent}
  78. </sql>
  79. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  80. <sql id="page_where">
  81. <trim prefix="where" prefixOverrides="and | or ">
  82. <if test="adCode != null and adCode != ''">and AD_CODE LIKE '${adCode}%'</if>
  83. <if test="adGrad != null and adGrad != ''">and AD_CODE in (select AD_CODE from ATT_AD_BASE where AD_GRAD = #{adGrad})</if>
  84. <if test="chkName != null and chkName != ''">and CHK_NAME like '%${chkName}%'</if>
  85. <if test="chkType != null and chkType != ''">and CHK_TYPE like '%${chkType}%'</if>
  86. <if test="chkYear != null">
  87. and (to_char(PLAN_STTM,'yyyy') = #{chkYear} or to_char(PLAN_ENTM,'yyyy') = #{chkYear})
  88. </if>
  89. <if test="leadDep != null and leadDep != ''">and LEAD_DEP like '%${leadDep}%'</if>
  90. <if test='leadDepId != null and ""!=leadDepId '>and LEAD_DEP_ID = #{leadDepId} </if>
  91. <if test="joinDep != null and joinDep != ''">and JOIN_DEP = #{joinDep}</if>
  92. <if test="chkForm != null and chkForm != ''">and CHK_FORM = #{chkForm}</if>
  93. <if test="chkScope != null and chkScope != ''">and CHK_SCOPE = #{chkScope}</if>
  94. <if test="chkRly != null and chkRly != ''">and CHK_RLY = #{chkRly}</if>
  95. <if test="note != null and note != ''">and NOTE = #{note}</if>
  96. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  97. <if test="intm != null">and INTM = #{intm}</if>
  98. <if test="uptm != null">and UPTM = #{uptm}</if>
  99. <if test="state != null">and STATE = #{state}</if>
  100. <if test='planDpId != null and null !=planDpId '>
  101. AND (ID IN (SELECT DISTINCT PLAN_ID FROM BIS_INSP_PLANDP_RL WHERE PLAN_DP_ID = #{planDpId})
  102. OR LEAD_DEP_ID = #{planDpId})
  103. </if>
  104. <if test='chkContent != null and "" != chkContent '>and CHK_CONTENT like '%${chkContent}%' </if>
  105. and DATA_STAT = '0'
  106. </trim>
  107. </sql>
  108. <select id="get" resultMap="bisInspPlanYearResultMap" parameterType="String" >
  109. select <include refid="table_columns" /> from BIS_INSP_PLAN_YEAR where ID = #{id}
  110. </select>
  111. <select id="getBy" resultMap="bisInspPlanYearResultMap">
  112. select <include refid="table_columns" /> from BIS_INSP_PLAN_YEAR <include refid="page_where" />
  113. </select>
  114. <select id="findAll" resultMap="bisInspPlanYearResultMap">
  115. select <include refid="table_columns" /> from BIS_INSP_PLAN_YEAR
  116. </select>
  117. <select id="findList" resultMap="bisInspPlanYearResultMap">
  118. select <include refid="table_columns" /> from BIS_INSP_PLAN_YEAR <include refid="page_where" />
  119. order by ORDR ASC
  120. </select>
  121. <select id="selectCount" resultType="int" >
  122. select count(ID) from BIS_INSP_PLAN_YEAR <include refid="page_where" />
  123. </select>
  124. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspPlanYear">
  125. insert into BIS_INSP_PLAN_YEAR( <include refid="table_columns" /> )
  126. values ( <include refid="entity_properties" /> )
  127. </insert>
  128. <delete id="delete" parameterType="java.lang.String">
  129. update BIS_INSP_PLAN_YEAR set DATA_STAT='9' where ID = #{id}
  130. </delete>
  131. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspPlanYear">
  132. delete from BIS_INSP_PLAN_YEAR <include refid="page_where" />
  133. </delete>
  134. <update id="deleteInFlag" parameterType="java.lang.String">
  135. update BIS_INSP_PLAN_YEAR set flag_valid = 0 where ID = #{id}
  136. </update>
  137. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspPlanYear">
  138. update BIS_INSP_PLAN_YEAR
  139. <trim prefix="set" suffixOverrides=",">
  140. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  141. <if test="chkYear != null and chkYear != ''">CHK_YEAR = #{chkYear},</if>
  142. <if test="chkName != null and chkName != ''">CHK_NAME = #{chkName},</if>
  143. <if test="chkType != null and chkType != ''">CHK_TYPE = #{chkType},</if>
  144. <if test="planSttm != null">PLAN_STTM = #{planSttm},</if>
  145. <if test="planEntm != null">PLAN_ENTM = #{planEntm},</if>
  146. <if test="leadDep != null and leadDep != ''">LEAD_DEP = #{leadDep},</if>
  147. <if test="joinDep != null and joinDep != ''">JOIN_DEP = #{joinDep},</if>
  148. <if test="chkForm != null and chkForm != ''">CHK_FORM = #{chkForm},</if>
  149. <if test="chkScope != null and chkScope != ''">CHK_SCOPE = #{chkScope},</if>
  150. <if test="chkRly != null and chkRly != ''">CHK_RLY = #{chkRly},</if>
  151. <if test="note != null and note != ''">NOTE = #{note},</if>
  152. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  153. <if test="intm != null">INTM = #{intm},</if>
  154. <if test="uptm != null">UPTM = #{uptm},</if>
  155. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  156. <if test="state != null and state != ''">STATE = #{state},</if>
  157. <if test="ordr != null and ordr != ''">ORDR = #{ordr},</if>
  158. <if test="objType != null and objType != ''">OBJ_TYPE = #{objType},</if>
  159. <if test="objName != null and objName != ''">OBJ_NAME = #{objName},</if>
  160. <if test="leadDepId != null and leadDepId != ''">LEAD_DEP_ID = #{leadDepId},</if>
  161. <if test='chkContent != null and "" != chkContent ' >CHK_CONTENT = #{chkContent},</if>
  162. </trim>
  163. <where>ID = #{id}</where>
  164. </update>
  165. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspPlanYear">
  166. update BIS_INSP_PLAN_YEAR
  167. <trim prefix="set" suffixOverrides=",">
  168. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  169. <if test="chkYear != null and chkYear != ''">CHK_YEAR = #{chkYear},</if>
  170. <if test="chkName != null and chkName != ''">CHK_NAME = #{chkName},</if>
  171. <if test="chkType != null and chkType != ''">CHK_TYPE = #{chkType},</if>
  172. <if test="planSttm != null">PLAN_STTM = #{planSttm},</if>
  173. <if test="planEntm != null">PLAN_ENTM = #{planEntm},</if>
  174. <if test="leadDep != null and leadDep != ''">LEAD_DEP = #{leadDep},</if>
  175. <if test="joinDep != null and joinDep != ''">JOIN_DEP = #{joinDep},</if>
  176. <if test="chkForm != null and chkForm != ''">CHK_FORM = #{chkForm},</if>
  177. <if test="chkScope != null and chkScope != ''">CHK_SCOPE = #{chkScope},</if>
  178. <if test="chkRly != null and chkRly != ''">CHK_RLY = #{chkRly},</if>
  179. <if test="note != null and note != ''">NOTE = #{note},</if>
  180. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  181. <if test="intm != null">INTM = #{intm},</if>
  182. <if test="uptm != null">UPTM = #{uptm},</if>
  183. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  184. <if test="state != null and state != ''">STATE = #{dataStat},</if>
  185. <if test="ordr != null and ordr != ''">ORDR = #{ordr},</if>
  186. <if test="objType != null and objType != ''">OBJ_TYPE = #{objType},</if>
  187. <if test="objName != null and objName != ''">OBJ_NAME = #{objName},</if>
  188. <if test="leadDepId != null and leadDepId != ''">LEAD_DEP_ID = #{leadDepId},</if>
  189. <if test='chkContent != null and "" != chkContent ' >CHK_CONTENT = #{chkContent},</if>
  190. </trim>
  191. <include refid="page_where" />
  192. </update>
  193. <!-- 其他自定义SQL -->
  194. </mapper>