TacObjPblmHbDao.xml 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  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.TacObjPblmHbDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.TacObjPblmHb" id="tacObjPblmHbResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="objId" column="OBJ_ID"/>
  7. <result property="listType" column="LIST_TYPE"/>
  8. <result property="pblmstbHbId" column="PBLMSTB_HB_ID"/>
  9. <result property="isPblm" column="IS_PBLM"/>
  10. <result property="pblmNt" column="PBLM_NT"/>
  11. <result property="nt" column="NT"/>
  12. <result property="pblmId" column="PBLM_ID"/>
  13. <result property="state" column="STATE"/>
  14. <result property="persId" column="PERS_ID"/>
  15. <result property="intm" column="INTM"/>
  16. <result property="uptm" column="UPTM"/>
  17. <result property="dataStat" column="DATA_STAT"/>
  18. <result property="spfsnlType" column="SPFSNL_TYPE"/>
  19. <result property="genus" column="GENUS"/>
  20. <result property="focPblm" column="FOC_PBLM"/>
  21. <result property="chkItem" column="CHK_ITEM"/>
  22. <result property="chkGist" column="CHK_GIST"/>
  23. <result property="chkFrp" column="CHK_FRP"/>
  24. <result property="pblmDesc" column="PBLM_DESC"/>
  25. <result property="pblmNm" column="PBLM_NM"/>
  26. <result property="pblmPasi" column="PBLM_PASI"/>
  27. <result property="subjectIds" column="SUBJECT_IDS"/>
  28. <result property="subjectNames" column="SUBJECT_NAMES"/>
  29. <result property="sn" column="SN"/>
  30. <result property="pblmMasteryLevel" column="PBLM_MASTERY_LEVEL"/>
  31. </resultMap>
  32. <sql id="table_columns">
  33. ID,
  34. OBJ_ID,
  35. LIST_TYPE,
  36. PBLMSTB_HB_ID,
  37. IS_PBLM,
  38. PBLM_NT,
  39. NT,
  40. PBLM_ID,
  41. STATE,
  42. PERS_ID,
  43. INTM,
  44. UPTM,
  45. DATA_STAT
  46. </sql>
  47. <sql id="entity_properties">
  48. #{id},
  49. #{objId},
  50. #{listType},
  51. #{pblmstbHbId},
  52. #{isPblm},
  53. #{pblmNt},
  54. #{nt},
  55. #{pblmId},
  56. #{state},
  57. #{persId},
  58. #{intm},
  59. #{uptm},
  60. #{dataStat}
  61. </sql>
  62. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  63. <sql id="page_where">
  64. <trim prefix="where" prefixOverrides="and | or ">
  65. <if test="objId != null and objId != ''">and OBJ_ID = #{objId}</if>
  66. <if test="listType != null and listType != ''">and LIST_TYPE = #{listType}</if>
  67. <if test="pblmstbHbId != null and pblmstbHbId != ''">and PBLMSTB_HB_ID = #{pblmstbHbId}</if>
  68. <if test="isPblm != null and isPblm != ''">and IS_PBLM = #{isPblm}</if>
  69. <if test="pblmNt != null and pblmNt != ''">and PBLM_NT = #{pblmNt}</if>
  70. <if test="nt != null and nt != ''">and NT = #{nt}</if>
  71. <if test="pblmId != null and pblmId != ''">and PBLM_ID = #{pblmId}</if>
  72. <if test="state != null and state != ''">and STATE = #{state}</if>
  73. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  74. <if test="intm != null">and INTM = #{intm}</if>
  75. <if test="uptm != null">and UPTM = #{uptm}</if>
  76. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  77. </trim>
  78. </sql>
  79. <!-- <select id="findPblmHbList" resultMap="tacObjPblmHbResultMap">-->
  80. <!-- select t.*,r.name,r.location,r.ad_code from TAC_OBJ_PBLM_HB t ,tac_pawp_rgstr r where t.obj_id=r.obj_id-->
  81. <!-- and 1=1-->
  82. <!-- <if test="spfsnlType != null and spfsnlType != ''"> and t.SPFSNL_TYPE like concat(concat('%',#{spfsnlType}),'%')</if>-->
  83. <!-- <if test="objId != null and objId != ''"> and t.OBJ_ID like concat(concat('%',#{objId}),'%')</if>-->
  84. <!-- </select>-->
  85. <!-- <select id="findPblmHbList" resultMap="tacObjPblmHbResultMap">-->
  86. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.TacObjPblmHb">
  87. INSERT INTO TAC_OBJ_PBLM_HB (
  88. ID,
  89. OBJ_ID,
  90. LIST_TYPE,
  91. PBLMSTB_HB_ID,
  92. IS_PBLM,
  93. PBLM_NT,
  94. NT,
  95. PBLM_ID,
  96. STATE,
  97. PERS_ID,
  98. INTM,
  99. UPTM,
  100. DATA_STAT
  101. )
  102. SELECT
  103. UUID() AS ID,
  104. #{objId} AS OBJ_ID,
  105. '' AS LIST_TYPE,
  106. id AS PBLMSTB_HB_ID,
  107. '' AS IS_PBLM,
  108. '' AS PBLM_NT,
  109. '' AS NT,
  110. '' AS PBLM_ID,
  111. '' AS STATE,
  112. #{persId} AS PERS_ID,
  113. now() AS INTM,
  114. now() AS UPTM,
  115. '0' AS DATA_STAT
  116. FROM TAC_OBJ_PBLMSTB_HB
  117. </insert>
  118. <select id="findPblmHbList" resultMap="tacObjPblmHbResultMap" >
  119. SELECT t.*, r.name, r.location, r.ad_code,
  120. tt.genus, tt.foc_pblm, tt.chk_item, tt.chk_gist,
  121. tt.SPFSNL_TYPE, tt.CHK_FRP, tt.PBLMS_DESC,tt.PBLM_MASTERY_LEVEL
  122. FROM TAC_OBJ_PBLM_HB t
  123. LEFT JOIN tac_pawp_rgstr r ON t.obj_id = r.obj_id
  124. LEFT JOIN TAC_OBJ_PBLMstb_HB tt ON tt.id = t.PBLMSTB_HB_ID
  125. WHERE 1=1
  126. AND t.data_stat = '0' AND tt.data_stat = '0'
  127. <if test="spfsnlType != null and spfsnlType != ''">
  128. AND tt.SPFSNL_TYPE LIKE CONCAT('%', #{spfsnlType}, '%')
  129. </if>
  130. <if test="objId != null and objId != ''">
  131. AND t.OBJ_ID LIKE CONCAT('%', #{objId}, '%')
  132. </if>
  133. <if test='isPblm == "1".toString()'>
  134. AND (t.is_pblm = '0' OR t.is_pblm = '1')
  135. </if>
  136. <if test='isPblm == "0".toString()'>
  137. AND t.is_pblm IS NULL
  138. </if>
  139. ORDER BY tt.genus,tt.foc_pblm
  140. </select>
  141. <select id="getListData" resultMap="tacObjPblmHbResultMap">
  142. select t.*,r.name,r.location,r.ad_code ,tt.genus,tt.foc_pblm,tt.chk_item,tt.chk_gist ,tt.SPFSNL_TYPE,tt.CHK_FRP,tt.PBLMS_DESC,tt.PBLM_MASTERY_LEVEL,ttt.sn
  143. from TAC_OBJ_PBLM_HB t left join tac_pawp_rgstr r on t.obj_id=r.obj_id
  144. left join TAC_OBJ_PBLMstb_HB tt on tt.id = t.PBLMSTB_HB_ID
  145. left join TAC_OBJ_PBLMSTB ttt on ttt.id = tt.pblms_id
  146. where 1=1
  147. <if test="spfsnlType != null and spfsnlType != ''"> and tt.SPFSNL_TYPE like concat(concat('%',#{spfsnlType}),'%')</if>
  148. <if test="objId != null and objId != ''"> and t.OBJ_ID like concat(concat('%',#{objId}),'%')</if>
  149. and t.data_stat = '0'
  150. </select>
  151. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.TacObjPblmHb">
  152. update TAC_OBJ_PBLM_HB
  153. set IS_PBLM = #{isPblm},NT = #{nt},PBLM_ID = #{pblmId}
  154. <!--<trim prefix="set" suffixOverrides=",">
  155. <if test="isPblm != null">IS_PBLM = #{isPblm},</if>
  156. <if test="nt != null and nt != ''">NT = #{nt}</if>
  157. &lt;!&ndash;<if test="class1Name != null and class1Name != ''">CLASS1_NAME = #{class1Name},</if>
  158. <if test="pblmPasi != null and pblmPasi != ''">PBLM_PASI = #{pblmPasi},</if>
  159. <if test="subjectNames != null and subjectNames != ''">SUBJECT_NAMES = #{subjectNames},</if>
  160. <if test="pblmDesc != null and pblmDesc != ''">PBLM_DESC = #{pblmDesc},</if>&ndash;&gt;
  161. </trim>-->
  162. <where>ID = #{id}</where>
  163. </update>
  164. <delete id="delete" parameterType="java.lang.String">
  165. update TAC_OBJ_PBLM_HB set DATA_STAT='9' where ID = #{id}
  166. </delete>
  167. <select id="findPblmHbList1" resultMap="tacObjPblmHbResultMap">
  168. SELECT t.*, r.name, r.location, r.ad_code,
  169. tt.genus, tt.foc_pblm, tt.chk_item, tt.chk_gist,
  170. tt.SPFSNL_TYPE, tt.CHK_FRP, tt.PBLMS_DESC, tt.PBLM_MASTERY_LEVEL
  171. FROM TAC_OBJ_PBLM_HB t
  172. LEFT JOIN tac_pawp_rgstr r ON t.obj_id = r.obj_id
  173. LEFT JOIN TAC_OBJ_PBLMstb_HB tt ON tt.id = t.PBLMSTB_HB_ID
  174. WHERE 1=1
  175. <if test="spfsnlType != null and spfsnlType != ''">
  176. AND tt.SPFSNL_TYPE LIKE CONCAT('%', #{spfsnlType}, '%')
  177. </if>
  178. <if test="objId != null and objId != ''">
  179. AND t.OBJ_ID LIKE CONCAT('%', #{objId}, '%')
  180. </if>
  181. <if test='isPblm == "1".toString()'>
  182. AND (t.is_pblm = '0' OR t.is_pblm = '1')
  183. </if>
  184. <if test='isPblm == "0".toString()'>
  185. AND t.is_pblm IS NULL
  186. </if>
  187. AND t.data_stat = '0' AND tt.data_stat = '0'
  188. ORDER BY tt.genus,tt.foc_pblm
  189. </select>
  190. <select id="get" resultMap="tacObjPblmHbResultMap" parameterType="String" >
  191. select a.ID,
  192. a.OBJ_ID,
  193. a.LIST_TYPE,
  194. a.PBLMSTB_HB_ID,
  195. a.IS_PBLM,
  196. a.PBLM_NT,
  197. a.NT,
  198. a.PBLM_ID,
  199. a.STATE,
  200. a.PERS_ID,
  201. a.INTM,
  202. a.UPTM,
  203. a.DATA_STAT ,b.* ,c.* from TAC_OBJ_PBLM_HB a left join TAC_OBJ_PBLMstb_HB b on b.id = a.PBLMSTB_HB_ID
  204. LEFT JOIN TAC_PBLM_INFO c on a.obj_id = c.obj_id and a.pblm_id = c.id
  205. where a.ID = #{id}
  206. </select>
  207. <select id="getfile" resultMap="tacObjPblmHbResultMap" parameterType="String" >
  208. select a.ID,
  209. a.OBJ_ID,
  210. a.LIST_TYPE,
  211. a.PBLMSTB_HB_ID,
  212. a.IS_PBLM,
  213. a.PBLM_NT,
  214. a.NT,
  215. a.PBLM_ID,
  216. a.STATE,
  217. a.PERS_ID,
  218. a.INTM,
  219. a.UPTM,
  220. a.DATA_STAT ,b.* ,c.* from TAC_OBJ_PBLM_HB a left join TAC_OBJ_PBLMstb_HB b on b.id = a.PBLMSTB_HB_ID
  221. LEFT JOIN TAC_PBLM_INFO c on a.obj_id = c.obj_id and a.pblm_id = c.id
  222. where a.ID = #{id}
  223. </select>
  224. </mapper>