BisInspKeyRegSecUnitDao.xml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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.BisInspKeyRegSecUnitDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspKeyRegSecUnit" id="bisInspKeyRegSecUnitResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="secId" column="SEC_ID"/>
  7. <result property="nm" column="NM"/>
  8. <result property="nature" column="NATURE"/>
  9. <result property="government" column="GOVERNMENT"/>
  10. <result property="persId" column="PERS_ID"/>
  11. <result property="intm" jdbcType="TIMESTAMP" column="INTM"/>
  12. <result property="uptm" jdbcType="TIMESTAMP" column="UPTM"/>
  13. <result property="objId" column="OBJ_ID"/>
  14. </resultMap>
  15. <sql id="table_columns">
  16. ID,
  17. SEC_ID,
  18. NM,
  19. NATURE,
  20. GOVERNMENT,
  21. PERS_ID,
  22. INTM,
  23. UPTM,OBJ_ID
  24. </sql>
  25. <sql id="entity_properties">
  26. #{id},
  27. #{secId},
  28. #{nm},
  29. #{nature},
  30. #{government},
  31. #{persId},
  32. #{intm},
  33. #{uptm},#{objId}
  34. </sql>
  35. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  36. <sql id="page_where">
  37. <trim prefix="where" prefixOverrides="and | or ">
  38. <if test="secId != null and secId != ''">and SEC_ID = #{secId}</if>
  39. <if test="nm != null and nm != ''">and NM = #{nm}</if>
  40. <if test="nature != null and nature != ''">and NATURE = #{nature}</if>
  41. <if test="government != null and government != ''">and GOVERNMENT = #{government}</if>
  42. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  43. <if test="intm != null">and INTM = #{intm}</if>
  44. <if test="uptm != null">and UPTM = #{uptm}</if>
  45. <if test="objId != null and objId != ''">and obj_Id = #{objId}</if>
  46. </trim>
  47. </sql>
  48. <select id="get" resultMap="bisInspKeyRegSecUnitResultMap" parameterType="String">
  49. select
  50. <include refid="table_columns"/>
  51. from BIS_INSP_KEY_REG_SEC_UNIT where ID = #{id}
  52. </select>
  53. <select id="getBy" resultMap="bisInspKeyRegSecUnitResultMap">
  54. select
  55. <include refid="table_columns"/>
  56. from BIS_INSP_KEY_REG_SEC_UNIT
  57. <include refid="page_where"/>
  58. </select>
  59. <select id="findAll" resultMap="bisInspKeyRegSecUnitResultMap">
  60. select
  61. <include refid="table_columns"/>
  62. from BIS_INSP_KEY_REG_SEC_UNIT
  63. </select>
  64. <select id="findList" resultMap="bisInspKeyRegSecUnitResultMap">
  65. select
  66. <include refid="table_columns"/>
  67. from BIS_INSP_KEY_REG_SEC_UNIT
  68. <include refid="page_where"/>
  69. </select>
  70. <select id="selectCount" resultType="int">
  71. select count(ID) from BIS_INSP_KEY_REG_SEC_UNIT
  72. <include refid="page_where"/>
  73. </select>
  74. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspKeyRegSecUnit">
  75. insert into BIS_INSP_KEY_REG_SEC_UNIT(
  76. <include refid="table_columns"/>
  77. )
  78. values (
  79. <include refid="entity_properties"/>
  80. )
  81. </insert>
  82. <delete id="delete" parameterType="java.lang.String">
  83. delete from BIS_INSP_KEY_REG_SEC_UNIT where ID = #{id}
  84. </delete>
  85. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspKeyRegSecUnit">
  86. delete from BIS_INSP_KEY_REG_SEC_UNIT
  87. <include refid="page_where"/>
  88. </delete>
  89. <update id="deleteInFlag" parameterType="java.lang.String">
  90. update BIS_INSP_KEY_REG_SEC_UNIT set flag_valid = 0 where ID = #{id}
  91. </update>
  92. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspKeyRegSecUnit">
  93. update BIS_INSP_KEY_REG_SEC_UNIT
  94. <trim prefix="set" suffixOverrides=",">
  95. <if test="secId != null and secId != ''">SEC_ID = #{secId},</if>
  96. <if test="nm != null and nm != ''">NM = #{nm},</if>
  97. <if test="nature != null and nature != ''">NATURE = #{nature},</if>
  98. <if test="government != null and government != ''">GOVERNMENT = #{government},</if>
  99. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  100. <if test="intm != null">INTM = #{intm},</if>
  101. <if test="uptm != null">UPTM = #{uptm},</if>
  102. <if test="objId != null and objId != ''">obj_Id = #{objId},</if>
  103. </trim>
  104. <where>ID = #{id}</where>
  105. </update>
  106. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspKeyRegSecUnit">
  107. update BIS_INSP_KEY_REG_SEC_UNIT
  108. <trim prefix="set" suffixOverrides=",">
  109. <if test="secId != null and secId != ''">SEC_ID = #{secId},</if>
  110. <if test="nm != null and nm != ''">NM = #{nm},</if>
  111. <if test="nature != null and nature != ''">NATURE = #{nature},</if>
  112. <if test="government != null and government != ''">GOVERNMENT = #{government},</if>
  113. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  114. <if test="intm != null">INTM = #{intm},</if>
  115. <if test="uptm != null">UPTM = #{uptm},</if>
  116. <if test="objId != null and objId != ''">obj_Id = #{objId},</if>
  117. </trim>
  118. <include refid="page_where"/>
  119. </update>
  120. <!-- 其他自定义SQL -->
  121. <select id="getBySecId" resultMap="bisInspKeyRegSecUnitResultMap">
  122. select
  123. <include refid="table_columns"/>
  124. from BIS_INSP_KEY_REG_SEC_UNIT where sec_id=#{secId}
  125. </select>
  126. </mapper>