BisInspBidProDao.xml 4.9 KB

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