BisInspWtgthRgstrDrainDao.xml 5.3 KB

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