TacObjPblmstbHbDao.xml 12 KB

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