bd1db862cd01f7ed55727f32a995cecc138ec8a1.svn-base 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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.TacPawpDrmDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.TacPawpDrm" id="tacPawpDrmResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="listId" column="LIST_ID"/>
  7. <result property="catalogType" column="CATALOG_TYPE"/>
  8. <result property="catalogSn" column="CATALOG_SN"/>
  9. <result property="catalogName" column="CATALOG_NAME"/>
  10. <result property="note" column="NOTE"/>
  11. <result property="persId" column="PERS_ID"/>
  12. <result property="estUnit" column="EST_UNIT"/>
  13. <result property="estTm" column="EST_TM"/>
  14. <result property="intm" column="INTM"/>
  15. <result property="uptm" column="UPTM"/>
  16. <result property="dataStat" column="DATA_STAT"/>
  17. </resultMap>
  18. <sql id="table_columns">
  19. ID,
  20. LIST_ID,
  21. CATALOG_TYPE,
  22. CATALOG_SN,
  23. CATALOG_NAME,
  24. NOTE,
  25. PERS_ID,
  26. INTM,
  27. UPTM,
  28. DATA_STAT,EST_UNIT,EST_TM
  29. </sql>
  30. <sql id="entity_properties">
  31. #{id},
  32. #{listId},
  33. #{catalogType},
  34. #{catalogSn},
  35. #{catalogName},
  36. #{note},
  37. #{persId},
  38. #{intm},
  39. #{uptm},
  40. #{dataStat},#{estUnit},#{estTm}
  41. </sql>
  42. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  43. <sql id="page_where">
  44. <trim prefix="where" prefixOverrides="and | or ">
  45. <if test="listId != null and listId != ''">and LIST_ID = #{listId}</if>
  46. <if test="catalogType != null and catalogType != ''">and CATALOG_TYPE like '%${catalogType}%'</if>
  47. <if test="catalogSn != null and catalogSn != ''">and CATALOG_SN = #{catalogSn}</if>
  48. <if test="catalogName != null and catalogName != ''">and CATALOG_NAME like '%${catalogName}%'</if>
  49. <if test="note != null and note != ''">and NOTE = #{note}</if>
  50. <if test="persId != null and persId != ''">and PERS_ID IN (SELECT PERSID FROM bis_insp_all_rlation WHERE
  51. REGEXP_LIKE(
  52. ID,'^('||
  53. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persId})>0 then
  54. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  55. id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persId})
  56. else (select 'non' from dual) end)
  57. ||')') AND ID LIKE '008%')
  58. </if>
  59. <if test="estTm != null and estTm != ''">and EST_TM = #{estTm}</if>
  60. <if test="estUnit != null and estUnit != ''">and EST_UNIT like '%${estUnit}%'</if>
  61. <if test="intm != null">and INTM = #{intm}</if>
  62. <if test="uptm != null">and UPTM = #{uptm}</if>
  63. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  64. </trim>
  65. </sql>
  66. <select id="get" resultMap="tacPawpDrmResultMap" parameterType="String">
  67. select
  68. <include refid="table_columns"/>
  69. from TAC_PAWP_DRM where ID = #{id}
  70. </select>
  71. <select id="getBy" resultMap="tacPawpDrmResultMap">
  72. select
  73. <include refid="table_columns"/>
  74. from TAC_PAWP_DRM
  75. <include refid="page_where"/>
  76. </select>
  77. <select id="findAll" resultMap="tacPawpDrmResultMap">
  78. select
  79. <include refid="table_columns"/>
  80. from TAC_PAWP_DRM
  81. </select>
  82. <select id="findList" resultMap="tacPawpDrmResultMap">
  83. select
  84. <include refid="table_columns"/>
  85. from TAC_PAWP_DRM
  86. <include refid="page_where"/>
  87. </select>
  88. <select id="selectCount" resultType="int">
  89. select count(ID) from TAC_PAWP_DRM
  90. <include refid="page_where"/>
  91. </select>
  92. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.TacPawpDrm">
  93. insert into TAC_PAWP_DRM(
  94. <include refid="table_columns"/>
  95. )
  96. values (
  97. <include refid="entity_properties"/>
  98. )
  99. </insert>
  100. <delete id="delete" parameterType="java.lang.String">
  101. delete from TAC_PAWP_DRM where ID = #{id}
  102. </delete>
  103. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.TacPawpDrm">
  104. delete from TAC_PAWP_DRM
  105. <include refid="page_where"/>
  106. </delete>
  107. <update id="deleteInFlag" parameterType="java.lang.String">
  108. update TAC_PAWP_DRM set flag_valid = 0 where ID = #{id}
  109. </update>
  110. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.TacPawpDrm">
  111. update TAC_PAWP_DRM
  112. <trim prefix="set" suffixOverrides=",">
  113. <if test="listId != null and listId != ''">LIST_ID = #{listId},</if>
  114. <if test="catalogType != null">CATALOG_TYPE = #{catalogType},</if>
  115. <if test="catalogSn != null">CATALOG_SN = #{catalogSn},</if>
  116. <if test="catalogName != null">CATALOG_NAME = #{catalogName},</if>
  117. <if test="note != null">NOTE = #{note},</if>
  118. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  119. <if test="estTm != null">EST_TM = #{estTm},</if>
  120. <if test="estUnit != null">EST_UNIT = #{estUnit},</if>
  121. <if test="intm != null">INTM = #{intm},</if>
  122. <if test="uptm != null">UPTM = #{uptm},</if>
  123. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  124. </trim>
  125. <where>ID = #{id}</where>
  126. </update>
  127. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.TacPawpDrm">
  128. update TAC_PAWP_DRM
  129. <trim prefix="set" suffixOverrides=",">
  130. <if test="listId != null and listId != ''">LIST_ID = #{listId},</if>
  131. <if test="catalogType != null">CATALOG_TYPE = #{catalogType},</if>
  132. <if test="catalogSn != null">CATALOG_SN = #{catalogSn},</if>
  133. <if test="catalogName != null">CATALOG_NAME = #{catalogName},</if>
  134. <if test="note != null">NOTE = #{note},</if>
  135. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  136. <if test="estTm != null">EST_TM = #{estTm},</if>
  137. <if test="estUnit != null">EST_UNIT = #{estUnit},</if>
  138. <if test="intm != null">INTM = #{intm},</if>
  139. <if test="uptm != null">UPTM = #{uptm},</if>
  140. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  141. </trim>
  142. <include refid="page_where"/>
  143. </update>
  144. <!-- 其他自定义SQL -->
  145. </mapper>