6b37175dff68e7cdced6eda9df18c2e9153dea2a.svn-base 3.4 KB

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