TacObjPblmHbDao.xml 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  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. </resultMap>
  31. <sql id="table_columns">
  32. ID,
  33. OBJ_ID,
  34. LIST_TYPE,
  35. PBLMSTB_HB_ID,
  36. IS_PBLM,
  37. PBLM_NT,
  38. NT,
  39. PBLM_ID,
  40. STATE,
  41. PERS_ID,
  42. INTM,
  43. UPTM,
  44. DATA_STAT
  45. </sql>
  46. <sql id="entity_properties">
  47. #{id},
  48. #{objId},
  49. #{listType},
  50. #{pblmstbHbId},
  51. #{isPblm},
  52. #{pblmNt},
  53. #{nt},
  54. #{pblmId},
  55. #{state},
  56. #{persId},
  57. #{intm},
  58. #{uptm},
  59. #{dataStat}
  60. </sql>
  61. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  62. <sql id="page_where">
  63. <trim prefix="where" prefixOverrides="and | or ">
  64. <if test="objId != null and objId != ''">and OBJ_ID = #{objId}</if>
  65. <if test="listType != null and listType != ''">and LIST_TYPE = #{listType}</if>
  66. <if test="pblmstbHbId != null and pblmstbHbId != ''">and PBLMSTB_HB_ID = #{pblmstbHbId}</if>
  67. <if test="isPblm != null and isPblm != ''">and IS_PBLM = #{isPblm}</if>
  68. <if test="pblmNt != null and pblmNt != ''">and PBLM_NT = #{pblmNt}</if>
  69. <if test="nt != null and nt != ''">and NT = #{nt}</if>
  70. <if test="pblmId != null and pblmId != ''">and PBLM_ID = #{pblmId}</if>
  71. <if test="state != null and state != ''">and STATE = #{state}</if>
  72. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  73. <if test="intm != null">and INTM = #{intm}</if>
  74. <if test="uptm != null">and UPTM = #{uptm}</if>
  75. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  76. </trim>
  77. </sql>
  78. <!-- <select id="findPblmHbList" resultMap="tacObjPblmHbResultMap">-->
  79. <!-- 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-->
  80. <!-- and 1=1-->
  81. <!-- <if test="spfsnlType != null and spfsnlType != ''"> and t.SPFSNL_TYPE like concat(concat('%',#{spfsnlType}),'%')</if>-->
  82. <!-- <if test="objId != null and objId != ''"> and t.OBJ_ID like concat(concat('%',#{objId}),'%')</if>-->
  83. <!-- </select>-->
  84. <!-- <select id="findPblmHbList" resultMap="tacObjPblmHbResultMap">-->
  85. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.TacObjPblmHb">
  86. insert into TAC_OBJ_PBLM_HB (
  87. ID,
  88. OBJ_ID,
  89. LIST_TYPE,
  90. PBLMSTB_HB_ID,
  91. IS_PBLM,
  92. PBLM_NT,
  93. NT,
  94. PBLM_ID,
  95. STATE,
  96. PERS_ID,
  97. INTM,
  98. UPTM,
  99. DATA_STAT)
  100. select sys_guid(),
  101. #{objId},
  102. '',
  103. id AS pblmstbHbId ,
  104. '',
  105. '',
  106. '',
  107. '',
  108. '',
  109. #{persId},
  110. '',
  111. '',
  112. '0' from TAC_OBJ_PBLMSTB_HB
  113. </insert>
  114. <select id="findPblmHbList" resultMap="tacObjPblmHbResultMap" >
  115. 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,ttt.sn
  116. ,
  117. TO_NUMBER(REGEXP_SUBSTR(tt.foc_pblm, '\d+', 1, 1)) AS major_version,
  118. TO_NUMBER(REGEXP_SUBSTR(tt.foc_pblm, '\d+', 1, 2)) AS minor_version,
  119. TO_NUMBER(REGEXP_SUBSTR(tt.foc_pblm, '\d+', 1, 3)) AS patch_version
  120. from TAC_OBJ_PBLM_HB t left join tac_pawp_rgstr r on t.obj_id=r.obj_id
  121. left join TAC_OBJ_PBLMstb_HB tt on tt.id = t.PBLMSTB_HB_ID
  122. left join TAC_OBJ_PBLMSTB ttt on ttt.id = tt.pblms_id
  123. where 1=1
  124. <if test="spfsnlType != null and spfsnlType != ''"> and tt.SPFSNL_TYPE like concat(concat('%',#{spfsnlType}),'%')</if>
  125. <if test="objId != null and objId != ''"> and t.OBJ_ID like concat(concat('%',#{objId}),'%')</if>
  126. <if test='isPblm == "1".toString()'>
  127. and (t.is_pblm ='0' or t.is_pblm ='1')
  128. </if>
  129. <if test='isPblm == "0".toString()'>
  130. and t.is_pblm is null
  131. </if>
  132. and t.data_stat = '0' ORDER BY major_version, minor_version, patch_version,tt.chk_item
  133. </select>
  134. <select id="getListData" resultMap="tacObjPblmHbResultMap">
  135. 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,ttt.sn
  136. from TAC_OBJ_PBLM_HB t left join tac_pawp_rgstr r on t.obj_id=r.obj_id
  137. left join TAC_OBJ_PBLMstb_HB tt on tt.id = t.PBLMSTB_HB_ID
  138. left join TAC_OBJ_PBLMSTB ttt on ttt.id = tt.pblms_id
  139. where 1=1
  140. <if test="spfsnlType != null and spfsnlType != ''"> and tt.SPFSNL_TYPE like concat(concat('%',#{spfsnlType}),'%')</if>
  141. <if test="objId != null and objId != ''"> and t.OBJ_ID like concat(concat('%',#{objId}),'%')</if>
  142. and t.data_stat = '0'
  143. </select>
  144. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.TacObjPblmHb">
  145. update TAC_OBJ_PBLM_HB
  146. set IS_PBLM = #{isPblm},NT = #{nt},PBLM_ID = #{pblmId}
  147. <!--<trim prefix="set" suffixOverrides=",">
  148. <if test="isPblm != null">IS_PBLM = #{isPblm},</if>
  149. <if test="nt != null and nt != ''">NT = #{nt}</if>
  150. &lt;!&ndash;<if test="class1Name != null and class1Name != ''">CLASS1_NAME = #{class1Name},</if>
  151. <if test="pblmPasi != null and pblmPasi != ''">PBLM_PASI = #{pblmPasi},</if>
  152. <if test="subjectNames != null and subjectNames != ''">SUBJECT_NAMES = #{subjectNames},</if>
  153. <if test="pblmDesc != null and pblmDesc != ''">PBLM_DESC = #{pblmDesc},</if>&ndash;&gt;
  154. </trim>-->
  155. <where>ID = #{id}</where>
  156. </update>
  157. <delete id="delete" parameterType="java.lang.String">
  158. update TAC_OBJ_PBLM_HB set DATA_STAT='9' where ID = #{id}
  159. </delete>
  160. <select id="findPblmHbList1" resultMap="tacObjPblmHbResultMap">
  161. 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,ttt.sn
  162. ,
  163. TO_NUMBER(REGEXP_SUBSTR(tt.foc_pblm, '\d+', 1, 1)) AS major_version,
  164. TO_NUMBER(REGEXP_SUBSTR(tt.foc_pblm, '\d+', 1, 2)) AS minor_version,
  165. TO_NUMBER(REGEXP_SUBSTR(tt.foc_pblm, '\d+', 1, 3)) AS patch_version
  166. from TAC_OBJ_PBLM_HB t left join tac_pawp_rgstr r on t.obj_id=r.obj_id
  167. left join TAC_OBJ_PBLMstb_HB tt on tt.id = t.PBLMSTB_HB_ID
  168. LEFT JOIN TAC_OBJ_PBLMSTB ttt on ttt.id = tt.PBLMS_ID
  169. where 1=1
  170. <if test="spfsnlType != null and spfsnlType != ''"> and tt.SPFSNL_TYPE like concat(concat('%',#{spfsnlType}),'%')</if>
  171. <if test="objId != null and objId != ''"> and t.OBJ_ID like concat(concat('%',#{objId}),'%')</if>
  172. <if test='isPblm == "1".toString()'>
  173. and (t.is_pblm ='0' or t.is_pblm ='1')
  174. </if>
  175. <if test='isPblm == "0".toString()'>
  176. and t.is_pblm is null
  177. </if>
  178. and t.data_stat = '0' ORDER BY major_version, minor_version, patch_version,tt.chk_item
  179. </select>
  180. <select id="get" resultMap="tacObjPblmHbResultMap" parameterType="String" >
  181. select a.ID,
  182. a.OBJ_ID,
  183. a.LIST_TYPE,
  184. a.PBLMSTB_HB_ID,
  185. a.IS_PBLM,
  186. a.PBLM_NT,
  187. a.NT,
  188. a.PBLM_ID,
  189. a.STATE,
  190. a.PERS_ID,
  191. a.INTM,
  192. a.UPTM,
  193. 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
  194. LEFT JOIN TAC_PBLM_INFO c on a.obj_id = c.obj_id and a.pblm_id = c.id
  195. where a.ID = #{id}
  196. </select>
  197. <select id="getfile" resultMap="tacObjPblmHbResultMap" parameterType="String" >
  198. select a.ID,
  199. a.OBJ_ID,
  200. a.LIST_TYPE,
  201. a.PBLMSTB_HB_ID,
  202. a.IS_PBLM,
  203. a.PBLM_NT,
  204. a.NT,
  205. a.PBLM_ID,
  206. a.STATE,
  207. a.PERS_ID,
  208. a.INTM,
  209. a.UPTM,
  210. 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
  211. LEFT JOIN TAC_PBLM_INFO c on a.obj_id = c.obj_id and a.pblm_id = c.id
  212. where a.ID = #{id}
  213. </select>
  214. </mapper>