f25caa2d15b4e4b6abc512a4ad611c9f996b7e39.svn-base 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  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.TacObjPblmstbHbDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.TacObjPblmstbHb" id="tacObjPblmstbHbResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="spfsnlType" column="SPFSNL_TYPE"/>
  7. <result property="genus" column="GENUS"/>
  8. <result property="focPblm" column="FOC_PBLM"/>
  9. <result property="chkItem" column="CHK_ITEM"/>
  10. <result property="chkGist" column="CHK_GIST"/>
  11. <result property="chkFrp" column="CHK_FRP"/>
  12. <result property="pblmsDesc" column="PBLMS_DESC"/>
  13. <result property="pblmsCode" column="PBLMS_CODE"/>
  14. <result property="pblmsId" column="PBLMS_ID"/>
  15. <result property="ordr" column="ORDR"/>
  16. <result property="scale" column="SCALE"/>
  17. <result property="ptype" column="PTYPE"/>
  18. <result property="cate" column="CATE"/>
  19. <result property="stage" column="STAGE"/>
  20. <result property="persId" column="PERS_ID"/>
  21. <result property="intm" column="INTM"/>
  22. <result property="uptm" column="UPTM"/>
  23. <result property="dataStat" column="DATA_STAT"/>
  24. <result property="class1Name" column="CLASS1_NAME"/>
  25. <result property="pblmPasi" column="PBLM_PASI"/>
  26. <result property="isPblm" column="IS_PBLM"/>
  27. <result property="pblmNt" column="PBLM_NT"/>
  28. <result property="nt" column="NT"/>
  29. <result property="subjectNames" column="SUBJECT_NAMES"/>
  30. <result property="pblmDesc" column="PBLM_DESC"/>
  31. <result property="pblmId" column="PBLM_ID"/>
  32. </resultMap>
  33. <sql id="table_columns">
  34. ID,
  35. SPFSNL_TYPE,
  36. GENUS,
  37. FOC_PBLM,
  38. CHK_ITEM,
  39. CHK_GIST,
  40. CHK_FRP,
  41. PBLMS_DESC,
  42. PBLMS_CODE,
  43. PBLMS_ID,
  44. ORDR,
  45. SCALE,
  46. PTYPE,
  47. CATE,
  48. STAGE,
  49. PERS_ID,
  50. INTM,
  51. UPTM,
  52. DATA_STAT
  53. </sql>
  54. <sql id="entity_properties">
  55. #{id},
  56. #{spfsnlType},
  57. #{genus},
  58. #{focPblm},
  59. #{chkItem},
  60. #{chkGist},
  61. #{chkFrp},
  62. #{pblmsDesc},
  63. #{pblmsCode},
  64. #{pblmsId},
  65. #{ordr},
  66. #{scale},
  67. #{ptype},
  68. #{cate},
  69. #{stage},
  70. #{persId},
  71. #{intm},
  72. #{uptm},
  73. #{dataStat}
  74. </sql>
  75. <sql id="table_columns2">
  76. ID,
  77. IS_PBLM,
  78. PBLM_NT,
  79. PBLMSTB_HB_ID,
  80. NT
  81. </sql>
  82. <sql id="entity_properties2">
  83. #{id2},
  84. #{isPblm},
  85. #{pblmNt},
  86. #{id},
  87. #{nt}
  88. </sql>
  89. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  90. <sql id="page_where">
  91. <trim prefix="where" prefixOverrides="and | or ">
  92. <if test="spfsnlType != null and spfsnlType != ''">and SPFSNL_TYPE = #{spfsnlType}</if>
  93. <if test="genus != null and genus != ''">and GENUS = #{genus}</if>
  94. <if test="focPblm != null and focPblm != ''">and FOC_PBLM = #{focPblm}</if>
  95. <if test="chkItem != null and chkItem != ''">and CHK_ITEM = #{chkItem}</if>
  96. <if test="chkGist != null and chkGist != ''">and CHK_GIST = #{chkGist}</if>
  97. <if test="chkFrp != null and chkFrp != ''">and CHK_FRP = #{chkFrp}</if>
  98. <if test="pblmsDesc != null and pblmsDesc != ''">and PBLMS_DESC = #{pblmsDesc}</if>
  99. <if test="pblmsCode != null and pblmsCode != ''">and PBLMS_CODE = #{pblmsCode}</if>
  100. <if test="pblmsId != null and pblmsId != ''">and PBLMS_ID = #{pblmsId}</if>
  101. <if test="ordr != null and ordr != ''">and ORDR = #{ordr}</if>
  102. <if test="scale != null and scale != ''">and SCALE = #{scale}</if>
  103. <if test="ptype != null and ptype != ''">and PTYPE = #{ptype}</if>
  104. <if test="cate != null and cate != ''">and CATE = #{cate}</if>
  105. <if test="stage != null and stage != ''">and STAGE = #{stage}</if>
  106. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  107. <if test="intm != null">and INTM = #{intm}</if>
  108. <if test="uptm != null">and UPTM = #{uptm}</if>
  109. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  110. </trim>
  111. </sql>
  112. <select id="get" resultMap="tacObjPblmstbHbResultMap" parameterType="String" >
  113. select <include refid="table_columns" /> from TAC_OBJ_PBLMSTB_HB where ID = #{id}
  114. </select>
  115. <!--<select id="getfile" resultMap="tacObjPblmstbHbResultMap" parameterType="String" >
  116. select <include refid="table_columns" /> from TAC_OBJ_PBLMSTB_HB where ID = #{id}
  117. </select>-->
  118. <select id="getBy" resultMap="tacObjPblmstbHbResultMap">
  119. select <include refid="table_columns" /> from TAC_OBJ_PBLMSTB_HB <include refid="page_where" />
  120. </select>
  121. <select id="findAll" resultMap="tacObjPblmstbHbResultMap">
  122. select <include refid="table_columns" /> from TAC_OBJ_PBLMSTB_HB
  123. </select>
  124. <select id="findList" resultMap="tacObjPblmstbHbResultMap">
  125. select <include refid="table_columns" /> from TAC_OBJ_PBLMSTB_HB <include refid="page_where" />
  126. </select>
  127. <select id="selectCount" resultType="int" >
  128. select count(ID) from TAC_OBJ_PBLMSTB_HB <include refid="page_where" />
  129. </select>
  130. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.TacObjPblmstbHb">
  131. insert into TAC_OBJ_PBLMSTB_HB( <include refid="table_columns" /> )
  132. values ( <include refid="entity_properties" /> )
  133. </insert>
  134. <!--<insert id="insert2" parameterType="cn.com.goldenwater.dcproj.model.TacObjPblmstbHb">
  135. insert into TAC_OBJ_PBLM_HB( <include refid="table_columns2" /> )
  136. values ( <include refid="entity_properties2" /> )
  137. </insert>-->
  138. <delete id="delete" parameterType="java.lang.String">
  139. update TAC_OBJ_PBLMSTB_HB set DATA_STAT='9' where ID = #{id}
  140. </delete>
  141. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.TacObjPblmstbHb">
  142. delete from TAC_OBJ_PBLMSTB_HB <include refid="page_where" />
  143. </delete>
  144. <!--<update id="deleteInFlag" parameterType="java.lang.String">
  145. update TAC_OBJ_PBLMSTB_HB set flag_valid = 0 where ID = #{id}
  146. </update>-->
  147. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.TacObjPblmstbHb">
  148. update TAC_OBJ_PBLMSTB_HB
  149. <trim prefix="set" suffixOverrides=",">
  150. <if test="spfsnlType != null and spfsnlType != ''">SPFSNL_TYPE = #{spfsnlType},</if>
  151. <if test="genus != null and genus != ''">GENUS = #{genus},</if>
  152. <if test="focPblm != null and focPblm != ''">FOC_PBLM = #{focPblm},</if>
  153. <if test="chkItem != null and chkItem != ''">CHK_ITEM = #{chkItem},</if>
  154. <if test="chkGist != null and chkGist != ''">CHK_GIST = #{chkGist},</if>
  155. <if test="chkFrp != null and chkFrp != ''">CHK_FRP = #{chkFrp},</if>
  156. <if test="pblmsDesc != null and pblmsDesc != ''">PBLMS_DESC = #{pblmsDesc},</if>
  157. <if test="pblmsCode != null and pblmsCode != ''">PBLMS_CODE = #{pblmsCode},</if>
  158. <if test="pblmsId != null and pblmsId != ''">PBLMS_ID = #{pblmsId},</if>
  159. <if test="ordr != null and ordr != ''">ORDR = #{ordr},</if>
  160. <if test="scale != null and scale != ''">SCALE = #{scale},</if>
  161. <if test="ptype != null and ptype != ''">PTYPE = #{ptype},</if>
  162. <if test="cate != null and cate != ''">CATE = #{cate},</if>
  163. <if test="stage != null and stage != ''">STAGE = #{stage},</if>
  164. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  165. <if test="intm != null">INTM = #{intm},</if>
  166. <if test="uptm != null">UPTM = #{uptm},</if>
  167. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  168. <!--<if test="class1Name != null and class1Name != ''">CLASS1_NAME = #{class1Name},</if>
  169. <if test="pblmPasi != null and pblmPasi != ''">PBLM_PASI = #{pblmPasi},</if>
  170. <if test="subjectNames != null and subjectNames != ''">SUBJECT_NAMES = #{subjectNames},</if>
  171. <if test="pblmDesc != null and pblmDesc != ''">PBLM_DESC = #{pblmDesc},</if>-->
  172. </trim>
  173. <where>ID = #{id}</where>
  174. </update>
  175. <!--<update id="updateSecond" parameterType="cn.com.goldenwater.dcproj.model.TacObjPblmstbHb">
  176. update TAC_OBJ_PBLM_HB set IS_PBLM = #{isPblm}
  177. <if test="pblmNt != null and pblmNt != ''">,PBLM_NT = #{pblmNt}</if>
  178. <if test="nt != null and nt != ''">,NT = #{nt}</if>
  179. <if test="pblmId != null and pblmId != ''">,PBLM_ID = #{pblmId}</if>
  180. where PBLMSTB_HB_ID = #{id}
  181. </update>-->
  182. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.TacObjPblmstbHb">
  183. update TAC_OBJ_PBLMSTB_HB
  184. <trim prefix="set" suffixOverrides=",">
  185. <if test="spfsnlType != null and spfsnlType != ''">SPFSNL_TYPE = #{spfsnlType},</if>
  186. <if test="genus != null and genus != ''">GENUS = #{genus},</if>
  187. <if test="focPblm != null and focPblm != ''">FOC_PBLM = #{focPblm},</if>
  188. <if test="chkItem != null and chkItem != ''">CHK_ITEM = #{chkItem},</if>
  189. <if test="chkGist != null and chkGist != ''">CHK_GIST = #{chkGist},</if>
  190. <if test="chkFrp != null and chkFrp != ''">CHK_FRP = #{chkFrp},</if>
  191. <if test="pblmsDesc != null and pblmsDesc != ''">PBLMS_DESC = #{pblmsDesc},</if>
  192. <if test="pblmsCode != null and pblmsCode != ''">PBLMS_CODE = #{pblmsCode},</if>
  193. <if test="pblmsId != null and pblmsId != ''">PBLMS_ID = #{pblmsId},</if>
  194. <if test="ordr != null and ordr != ''">ORDR = #{ordr},</if>
  195. <if test="scale != null and scale != ''">SCALE = #{scale},</if>
  196. <if test="ptype != null and ptype != ''">PTYPE = #{ptype},</if>
  197. <if test="cate != null and cate != ''">CATE = #{cate},</if>
  198. <if test="stage != null and stage != ''">STAGE = #{stage},</if>
  199. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  200. <if test="intm != null">INTM = #{intm},</if>
  201. <if test="uptm != null">UPTM = #{uptm},</if>
  202. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  203. </trim>
  204. <include refid="page_where" />
  205. </update>
  206. <!-- 其他自定义SQL -->
  207. <select id="findPblmstbHbList" resultMap="tacObjPblmstbHbResultMap">
  208. select A.*,B.CLASS1_NAME from TAC_OBJ_PBLMSTB_HB A LEFT JOIN TAC_OBJ_PBLMSTB B ON A.PBLMS_ID = B.ID
  209. where 1=1
  210. <if test="spfsnlType != null and spfsnlType != ''"> and A.SPFSNL_TYPE like concat(concat('%',#{spfsnlType}),'%')</if>
  211. <if test="genus != null and genus != ''"> and A.GENUS like concat(concat('%',#{genus}),'%')</if>
  212. <if test="scale != null and scale != ''"> and A.SCALE like concat(concat('%',#{scale}),'%')</if>
  213. <if test="ptype != null and ptype != ''"> and A.PTYPE like concat(concat('%',#{ptype}),'%')</if>
  214. <if test="cate != null and cate != ''"> and A.CATE like concat(concat('%',#{cate}),'%')</if>
  215. <if test="stage != null and stage != ''"> and A.STAGE like concat(concat('%',#{stage}),'%')</if>
  216. AND a.data_stat = '0' order by A.SPFSNL_TYPE
  217. </select>
  218. <!--<select id="findPblmstbHbListGl" resultMap="tacObjPblmstbHbResultMap">
  219. select a.*,b.IS_PBLM,b.PBLM_NT,b.NT ,c.PBLM_PASI,c.SUBJECT_NAMES,c.PBLM_DESC,d.class1_name ,b.pblm_id ,e.group_id from TAC_OBJ_PBLMSTB_HB a
  220. left join TAC_OBJ_PBLM_HB b on a.id = b.PBLMSTB_HB_ID
  221. left join TAC_PBLM_INFO c on b.PBLM_ID = c.id
  222. left join TAC_OBJ_PBLMSTB d on a.PBLMS_ID = d.ID
  223. left join tac_pawp_rgstr e on b.OBJ_ID = e.OBJ_ID
  224. where 1=1
  225. <if test="spfsnlType != null and spfsnlType != ''"> and A.SPFSNL_TYPE like concat(concat('%',#{spfsnlType}),'%')</if>
  226. <if test="genus != null and genus != ''"> and A.GENUS like concat(concat('%',#{genus}),'%')</if>
  227. <if test="scale != null and scale != ''"> and A.SCALE like concat(concat('%',#{scale}),'%')</if>
  228. <if test="ptype != null and ptype != ''"> and A.PTYPE like concat(concat('%',#{ptype}),'%')</if>
  229. <if test="cate != null and cate != ''"> and A.CATE like concat(concat('%',#{cate}),'%')</if>
  230. <if test="stage != null and stage != ''"> and A.STAGE like concat(concat('%',#{stage}),'%')</if>
  231. AND a.data_stat = '0'
  232. </select>-->
  233. <select id="findPblmstbHbListGl" resultMap="tacObjPblmstbHbResultMap">
  234. select a.* from TAC_OBJ_PBLMSTB_HB a
  235. where 1=1
  236. <if test="spfsnlType != null and spfsnlType != ''"> and A.SPFSNL_TYPE like concat(concat('%',#{spfsnlType}),'%')</if>
  237. <if test="genus != null and genus != ''"> and A.GENUS like concat(concat('%',#{genus}),'%')</if>
  238. <if test="scale != null and scale != ''"> and A.SCALE like concat(concat('%',#{scale}),'%')</if>
  239. <if test="ptype != null and ptype != ''"> and A.PTYPE like concat(concat('%',#{ptype}),'%')</if>
  240. <if test="cate != null and cate != ''"> and A.CATE like concat(concat('%',#{cate}),'%')</if>
  241. <if test="stage != null and stage != ''"> and A.STAGE like concat(concat('%',#{stage}),'%')</if>
  242. AND a.data_stat = '0' order by A.SPFSNL_TYPE
  243. </select>
  244. </mapper>