BisZhejiangCheckPlanDao.xml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  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.BisZhejiangCheckPlanDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisZhejiangCheckPlan" id="bisZhejiangCheckPlanResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="workerNmDesc" column="WORKER_NM_DESC"/>
  7. <result property="wokerNm" column="WOKER_NM"/>
  8. <result property="content" column="CONTENT"/>
  9. <result property="checkWay" column="CHECK_WAY"/>
  10. <result property="persId" column="PERS_ID"/>
  11. <result property="checkEndDate" column="CHECK_END_DATE"/>
  12. <result property="checkSttdDate" column="CHECK_STTD_DATE"/>
  13. <result property="intm" column="INTM"/>
  14. <result property="uptm" column="UPTM"/>
  15. <result property="note" column="NOTE"/>
  16. <result property="dataStat" column="DATA_STAT"/>
  17. <result property="state" column="STATE"/>
  18. <result property="checkRelay" column="CHECK_RELAY"/>
  19. <result property="orgId" column="ORG_ID"/>
  20. <result property="departId" column="depart_Id"/>
  21. <result property="departNm" column="depart_Nm"/>
  22. <result property="year" column="YEAR"/>
  23. <result property="isSend" column="IS_SEND"/>
  24. <result property="fileState" column="FILE_STATE"/>
  25. <result property="persName" column="PERS_NAME"/>
  26. <result property="inspType" column="INSP_TYPE"/>
  27. <result property="inspName" column="INSP_Name"/>
  28. <result property="month" column="MONTH"/>
  29. </resultMap>
  30. <sql id="table_columns">
  31. ID,INSP_Name,MONTH,depart_Id,depart_Nm,
  32. WORKER_NM_DESC,
  33. WOKER_NM,
  34. CONTENT,
  35. CHECK_WAY,
  36. PERS_ID,
  37. CHECK_END_DATE,
  38. CHECK_STTD_DATE,
  39. INTM,
  40. UPTM,
  41. NOTE,
  42. DATA_STAT,
  43. STATE,
  44. CHECK_RELAY,
  45. ORG_ID,
  46. ORG_NAME,
  47. YEAR,
  48. IS_SEND,
  49. FILE_STATE,
  50. PERS_NAME,
  51. INSP_TYPE
  52. </sql>
  53. <sql id="entity_properties">
  54. #{id},#{inspName},#{month},#{departId},#{departNm},
  55. #{workerNmDesc},
  56. #{wokerNm},
  57. #{content},
  58. #{checkWay},
  59. #{persId},
  60. #{checkEndDate},
  61. #{checkSttdDate},
  62. #{intm},
  63. #{uptm},
  64. #{note},
  65. #{dataStat},
  66. #{state},
  67. #{checkRelay},
  68. #{orgId},
  69. #{orgName},
  70. #{year},
  71. #{isSend},
  72. #{fileState},
  73. #{persName},
  74. #{inspType}
  75. </sql>
  76. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  77. <sql id="page_where">
  78. <trim prefix="where" prefixOverrides="and | or ">
  79. <if test="workerNmDesc != null and workerNmDesc != ''">and WORKER_NM_DESC = #{workerNmDesc}</if>
  80. <if test="wokerNm != null and wokerNm != ''">and WOKER_NM like '%${wokerNm}%'</if>
  81. <if test="departId != null and departId != ''">and depart_Id = #{departId}</if>
  82. <if test="departNm != null and departNm != ''">and depart_Nm = #{departNm}</if>
  83. <if test="month != null and month != ''">and MONTH = #{month}</if>
  84. <if test="inspName != null and inspName != ''">and INSP_NAME = #{inspName}</if>
  85. <if test="content != null and content != ''">and CONTENT = #{content}</if>
  86. <if test="checkWay != null and checkWay != ''">and CHECK_WAY = #{checkWay}</if>
  87. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  88. <if test="checkEndDate != null and checkEndDate != ''">and CHECK_END_DATE = #{checkEndDate}</if>
  89. <if test="checkSttdDate != null and checkSttdDate != ''">and CHECK_STTD_DATE = #{checkSttdDate}</if>
  90. <if test="intm != null">and INTM = #{intm}</if>
  91. <if test="uptm != null">and UPTM = #{uptm}</if>
  92. <if test="note != null and note != ''">and NOTE = #{note}</if>
  93. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  94. <if test="state != null and state != ''">and STATE = #{state}</if>
  95. <if test="checkRelay != null and checkRelay != ''">and CHECK_RELAY = #{checkRelay}</if>
  96. <if test="orgId != null and orgId != ''">and ORG_ID = #{orgId}</if>
  97. <if test="orgName != null and orgName != ''">and ORG_NAME = #{orgName}</if>
  98. <if test="year != null and year != ''">and YEAR = #{year}</if>
  99. <if test="isSend != null and isSend != ''">and IS_SEND = #{isSend}</if>
  100. <if test="fileState != null and fileState != ''">and FILE_STATE = #{fileState}</if>
  101. <if test="persName != null and persName != ''">and PERS_NAME = #{persName}</if>
  102. <if test="inspType != null and inspType != ''">and INSP_TYPE = #{inspType}</if>
  103. </trim>
  104. </sql>
  105. <select id="get" resultMap="bisZhejiangCheckPlanResultMap" parameterType="String" >
  106. select <include refid="table_columns" /> from BIS_ZHEJIANG_CHECK_PLAN where ID = #{id}
  107. </select>
  108. <select id="getBy" resultMap="bisZhejiangCheckPlanResultMap">
  109. select <include refid="table_columns" /> from BIS_ZHEJIANG_CHECK_PLAN <include refid="page_where" />
  110. </select>
  111. <select id="findAll" resultMap="bisZhejiangCheckPlanResultMap">
  112. select <include refid="table_columns" /> from BIS_ZHEJIANG_CHECK_PLAN
  113. </select>
  114. <select id="findList" resultMap="bisZhejiangCheckPlanResultMap">
  115. select <include refid="table_columns" /> from BIS_ZHEJIANG_CHECK_PLAN <include refid="page_where" />
  116. order by CHECK_STTD_DATE desc
  117. </select>
  118. <select id="selectCount" resultType="int" >
  119. select count(ID) from BIS_ZHEJIANG_CHECK_PLAN <include refid="page_where" />
  120. </select>
  121. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisZhejiangCheckPlan">
  122. insert into BIS_ZHEJIANG_CHECK_PLAN( <include refid="table_columns" /> )
  123. values ( <include refid="entity_properties" /> )
  124. </insert>
  125. <delete id="delete" parameterType="java.lang.String">
  126. delete from BIS_ZHEJIANG_CHECK_PLAN where ID = #{id}
  127. </delete>
  128. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisZhejiangCheckPlan">
  129. delete from BIS_ZHEJIANG_CHECK_PLAN <include refid="page_where" />
  130. </delete>
  131. <update id="deleteInFlag" parameterType="java.lang.String">
  132. update BIS_ZHEJIANG_CHECK_PLAN set flag_valid = 0 where ID = #{id}
  133. </update>
  134. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisZhejiangCheckPlan">
  135. update BIS_ZHEJIANG_CHECK_PLAN
  136. <trim prefix="set" suffixOverrides=",">
  137. <if test="departId != null and departId != ''"> depart_Id = #{departId},</if>
  138. <if test="departNm != null and departNm != ''"> depart_Nm = #{departNm},</if>
  139. <if test="month != null and month != ''"> MONTH = #{month},</if>
  140. <if test="inspName != null and inspName != ''"> INSP_NAME = #{inspName},</if>
  141. <if test="workerNmDesc != null and workerNmDesc != ''">WORKER_NM_DESC = #{workerNmDesc},</if>
  142. <if test="wokerNm != null and wokerNm != ''">WOKER_NM = #{wokerNm},</if>
  143. <if test="content != null and content != ''">CONTENT = #{content},</if>
  144. <if test="checkWay != null and checkWay != ''">CHECK_WAY = #{checkWay},</if>
  145. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  146. <if test="checkEndDate != null and checkEndDate != ''">CHECK_END_DATE = #{checkEndDate},</if>
  147. <if test="checkSttdDate != null and checkSttdDate != ''">CHECK_STTD_DATE = #{checkSttdDate},</if>
  148. <if test="intm != null">INTM = #{intm},</if>
  149. <if test="uptm != null">UPTM = #{uptm},</if>
  150. <if test="note != null and note != ''">NOTE = #{note},</if>
  151. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  152. <if test="state != null and state != ''">STATE = #{state},</if>
  153. <if test="checkRelay != null and checkRelay != ''">CHECK_RELAY = #{checkRelay},</if>
  154. <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
  155. <if test="orgName != null and orgName != ''">ORG_NAME = #{orgName},</if>
  156. <if test="year != null and year != ''">YEAR = #{year},</if>
  157. <if test="isSend != null and isSend != ''">IS_SEND = #{isSend},</if>
  158. <if test="fileState != null and fileState != ''">FILE_STATE = #{fileState},</if>
  159. <if test="persName != null and persName != ''">PERS_NAME = #{persName},</if>
  160. <if test="inspType != null and inspType != ''">INSP_TYPE = #{inspType},</if>
  161. </trim>
  162. <where>ID = #{id}</where>
  163. </update>
  164. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisZhejiangCheckPlan">
  165. update BIS_ZHEJIANG_CHECK_PLAN
  166. <trim prefix="set" suffixOverrides=",">
  167. <if test="departId != null and departId != ''"> depart_Id = #{departId},</if>
  168. <if test="departNm != null and departNm != ''"> depart_Nm = #{departNm},</if>
  169. <if test="month != null and month != ''"> MONTH = #{month},</if>
  170. <if test="inspName != null and inspName != ''"> INSP_NAME = #{inspName},</if>
  171. <if test="workerNmDesc != null and workerNmDesc != ''">WORKER_NM_DESC = #{workerNmDesc},</if>
  172. <if test="wokerNm != null and wokerNm != ''">WOKER_NM = #{wokerNm},</if>
  173. <if test="content != null and content != ''">CONTENT = #{content},</if>
  174. <if test="checkWay != null and checkWay != ''">CHECK_WAY = #{checkWay},</if>
  175. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  176. <if test="checkEndDate != null and checkEndDate != ''">CHECK_END_DATE = #{checkEndDate},</if>
  177. <if test="checkSttdDate != null and checkSttdDate != ''">CHECK_STTD_DATE = #{checkSttdDate},</if>
  178. <if test="intm != null">INTM = #{intm},</if>
  179. <if test="uptm != null">UPTM = #{uptm},</if>
  180. <if test="note != null and note != ''">NOTE = #{note},</if>
  181. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  182. <if test="state != null and state != ''">STATE = #{state},</if>
  183. <if test="checkRelay != null and checkRelay != ''">CHECK_RELAY = #{checkRelay},</if>
  184. <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
  185. <if test="orgName != null and orgName != ''">ORG_NAME = #{orgName},</if>
  186. <if test="year != null and year != ''">YEAR = #{year},</if>
  187. <if test="isSend != null and isSend != ''">IS_SEND = #{isSend},</if>
  188. <if test="fileState != null and fileState != ''">FILE_STATE = #{fileState},</if>
  189. <if test="persName != null and persName != ''">PERS_NAME = #{persName},</if>
  190. <if test="inspType != null and inspType != ''">INSP_TYPE = #{inspType},</if>
  191. </trim>
  192. <include refid="page_where" />
  193. </update>
  194. <!-- 其他自定义SQL -->
  195. </mapper>