72a453bdf7eb0bac1e382f736d0777b8347f6026.svn-base 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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.BisInspSwhsRgstrWaterDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspSwhsRgstrWater" id="bisInspSwhsRgstrWaterResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="rgstrId" column="RGSTR_ID"/>
  7. <result property="isBebwsar" column="IS_BEBWSAR"/>
  8. <result property="recPersId" column="REC_PERS_ID"/>
  9. <result property="inTm" column="IN_TM"/>
  10. <result property="upTm" column="UP_TM"/>
  11. <result property="dataStat" column="DATA_STAT"/>
  12. </resultMap>
  13. <sql id="table_columns">
  14. ID,
  15. RGSTR_ID,
  16. IS_BEBWSAR,
  17. REC_PERS_ID,
  18. IN_TM,
  19. UP_TM,
  20. DATA_STAT
  21. </sql>
  22. <sql id="entity_properties">
  23. #{id},
  24. #{rgstrId},
  25. #{isBebwsar},
  26. #{recPersId},
  27. #{inTm},
  28. #{upTm},
  29. #{dataStat}
  30. </sql>
  31. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  32. <sql id="page_where">
  33. <trim prefix="where" prefixOverrides="and | or ">
  34. <if test="rgstrId != null and rgstrId != ''">and RGSTR_ID = #{rgstrId}</if>
  35. <if test="isBebwsar != null and isBebwsar != ''">and IS_BEBWSAR = #{isBebwsar}</if>
  36. <if test="recPersId != null and recPersId != ''">and REC_PERS_ID = #{recPersId}</if>
  37. <if test="inTm != null">and IN_TM = #{inTm}</if>
  38. <if test="upTm != null">and UP_TM = #{upTm}</if>
  39. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  40. </trim>
  41. </sql>
  42. <select id="get" resultMap="bisInspSwhsRgstrWaterResultMap" parameterType="String" >
  43. select <include refid="table_columns" /> from BIS_INSP_SWHS_RGSTR_WATER where ID = #{id}
  44. </select>
  45. <select id="getBy" resultMap="bisInspSwhsRgstrWaterResultMap">
  46. select <include refid="table_columns" /> from BIS_INSP_SWHS_RGSTR_WATER <include refid="page_where" />
  47. </select>
  48. <select id="findAll" resultMap="bisInspSwhsRgstrWaterResultMap">
  49. select <include refid="table_columns" /> from BIS_INSP_SWHS_RGSTR_WATER
  50. </select>
  51. <select id="findList" resultMap="bisInspSwhsRgstrWaterResultMap">
  52. select <include refid="table_columns" /> from BIS_INSP_SWHS_RGSTR_WATER <include refid="page_where" />
  53. </select>
  54. <select id="selectCount" resultType="int" >
  55. select count(ID) from BIS_INSP_SWHS_RGSTR_WATER <include refid="page_where" />
  56. </select>
  57. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspSwhsRgstrWater">
  58. insert into BIS_INSP_SWHS_RGSTR_WATER( <include refid="table_columns" /> )
  59. values ( <include refid="entity_properties" /> )
  60. </insert>
  61. <delete id="delete" parameterType="java.lang.String">
  62. delete from BIS_INSP_SWHS_RGSTR_WATER where ID = #{id}
  63. </delete>
  64. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspSwhsRgstrWater">
  65. delete from BIS_INSP_SWHS_RGSTR_WATER <include refid="page_where" />
  66. </delete>
  67. <update id="deleteInFlag" parameterType="java.lang.String">
  68. update BIS_INSP_SWHS_RGSTR_WATER set flag_valid = 0 where ID = #{id}
  69. </update>
  70. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspSwhsRgstrWater">
  71. update BIS_INSP_SWHS_RGSTR_WATER
  72. <trim prefix="set" suffixOverrides=",">
  73. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID = #{rgstrId},</if>
  74. <if test="isBebwsar != null and isBebwsar != ''">IS_BEBWSAR = #{isBebwsar},</if>
  75. <if test="recPersId != null and recPersId != ''">REC_PERS_ID = #{recPersId},</if>
  76. <if test="inTm != null">IN_TM = #{inTm},</if>
  77. <if test="upTm != null">UP_TM = #{upTm},</if>
  78. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  79. </trim>
  80. <where>ID = #{id}</where>
  81. </update>
  82. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspSwhsRgstrWater">
  83. update BIS_INSP_SWHS_RGSTR_WATER
  84. <trim prefix="set" suffixOverrides=",">
  85. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID = #{rgstrId},</if>
  86. <if test="isBebwsar != null and isBebwsar != ''">IS_BEBWSAR = #{isBebwsar},</if>
  87. <if test="recPersId != null and recPersId != ''">REC_PERS_ID = #{recPersId},</if>
  88. <if test="inTm != null">IN_TM = #{inTm},</if>
  89. <if test="upTm != null">UP_TM = #{upTm},</if>
  90. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  91. </trim>
  92. <include refid="page_where" />
  93. </update>
  94. <!-- 其他自定义SQL -->
  95. </mapper>