TacPawpDrmDao.xml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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. id in (${inIdsSql}) AND ID LIKE '008%')
  52. </if>
  53. <if test="estTm != null and estTm != ''">and EST_TM = #{estTm}</if>
  54. <if test="estUnit != null and estUnit != ''">and EST_UNIT like '%${estUnit}%'</if>
  55. <if test="intm != null">and INTM = #{intm}</if>
  56. <if test="uptm != null">and UPTM = #{uptm}</if>
  57. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  58. </trim>
  59. </sql>
  60. <select id="get" resultMap="tacPawpDrmResultMap" parameterType="String">
  61. select
  62. <include refid="table_columns"/>
  63. from TAC_PAWP_DRM where ID = #{id}
  64. </select>
  65. <select id="getBy" resultMap="tacPawpDrmResultMap">
  66. select
  67. <include refid="table_columns"/>
  68. from TAC_PAWP_DRM
  69. <include refid="page_where"/>
  70. </select>
  71. <select id="findAll" resultMap="tacPawpDrmResultMap">
  72. select
  73. <include refid="table_columns"/>
  74. from TAC_PAWP_DRM
  75. </select>
  76. <select id="findList" resultMap="tacPawpDrmResultMap">
  77. select
  78. <include refid="table_columns"/>
  79. from TAC_PAWP_DRM
  80. <include refid="page_where"/>
  81. </select>
  82. <select id="selectCount" resultType="int">
  83. select count(ID) from TAC_PAWP_DRM
  84. <include refid="page_where"/>
  85. </select>
  86. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.TacPawpDrm">
  87. insert into TAC_PAWP_DRM(
  88. <include refid="table_columns"/>
  89. )
  90. values (
  91. <include refid="entity_properties"/>
  92. )
  93. </insert>
  94. <delete id="delete" parameterType="java.lang.String">
  95. delete from TAC_PAWP_DRM where ID = #{id}
  96. </delete>
  97. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.TacPawpDrm">
  98. delete from TAC_PAWP_DRM
  99. <include refid="page_where"/>
  100. </delete>
  101. <update id="deleteInFlag" parameterType="java.lang.String">
  102. update TAC_PAWP_DRM set flag_valid = 0 where ID = #{id}
  103. </update>
  104. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.TacPawpDrm">
  105. update TAC_PAWP_DRM
  106. <trim prefix="set" suffixOverrides=",">
  107. <if test="listId != null and listId != ''">LIST_ID = #{listId},</if>
  108. <if test="catalogType != null">CATALOG_TYPE = #{catalogType},</if>
  109. <if test="catalogSn != null">CATALOG_SN = #{catalogSn},</if>
  110. <if test="catalogName != null">CATALOG_NAME = #{catalogName},</if>
  111. <if test="note != null">NOTE = #{note},</if>
  112. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  113. <if test="estTm != null">EST_TM = #{estTm},</if>
  114. <if test="estUnit != null">EST_UNIT = #{estUnit},</if>
  115. <if test="intm != null">INTM = #{intm},</if>
  116. <if test="uptm != null">UPTM = #{uptm},</if>
  117. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  118. </trim>
  119. <where>ID = #{id}</where>
  120. </update>
  121. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.TacPawpDrm">
  122. update TAC_PAWP_DRM
  123. <trim prefix="set" suffixOverrides=",">
  124. <if test="listId != null and listId != ''">LIST_ID = #{listId},</if>
  125. <if test="catalogType != null">CATALOG_TYPE = #{catalogType},</if>
  126. <if test="catalogSn != null">CATALOG_SN = #{catalogSn},</if>
  127. <if test="catalogName != null">CATALOG_NAME = #{catalogName},</if>
  128. <if test="note != null">NOTE = #{note},</if>
  129. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  130. <if test="estTm != null">EST_TM = #{estTm},</if>
  131. <if test="estUnit != null">EST_UNIT = #{estUnit},</if>
  132. <if test="intm != null">INTM = #{intm},</if>
  133. <if test="uptm != null">UPTM = #{uptm},</if>
  134. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  135. </trim>
  136. <include refid="page_where"/>
  137. </update>
  138. <!-- 其他自定义SQL -->
  139. </mapper>