BdglFlatMapper.xml 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.supervision.barracksManagement.mapper.BdglFlatMapper">
  6. <resultMap type="BdglFlat" id="BdglFlatResult">
  7. <result property="id" column="id" />
  8. <result property="number" column="number" />
  9. <result property="number1" column="number1" />
  10. <result property="name" column="name" />
  11. <result property="behoof" column="behoof" />
  12. <result property="statusQuo" column="status_quo" />
  13. <result property="period" column="period" />
  14. <result property="area" column="area" />
  15. <result property="remark" column="remark" />
  16. <result property="createtime" column="createtime" />
  17. <result property="updatetime" column="updatetime" />
  18. <result property="tier" column="tier" />
  19. <result property="roomNumber" column="room_number" />
  20. <result property="element" column="element" />
  21. <result property="xingMing" column="xing_ming" />
  22. <result property="usageArea" column="usage_area" />
  23. <result property="propertyFeeStandard" column="property_fee_standard" />
  24. <result property="rentStandard" column="rent_standard" />
  25. <result property="waterBil" column="water_bil" />
  26. <result property="monthlyRent" column="monthly_rent" />
  27. <result property="monthlyPropertyFee" column="monthly_property_fee" />
  28. <result property="totalAmount" column="total_amount" />
  29. </resultMap>
  30. <sql id="selectBdglFlatVo">
  31. select id, number, number1, name, behoof, status_quo, period, area, remark, createtime, updatetime, tier, room_number, element, xing_ming, usage_area, property_fee_standard, rent_standard, water_bil, monthly_rent, monthly_property_fee, total_amount from bdgl_flat
  32. </sql>
  33. <select id="selectBdglFlatList" parameterType="BdglFlat" resultMap="BdglFlatResult">
  34. <include refid="selectBdglFlatVo"/>
  35. <where>
  36. <if test="number != null and number != ''"> and number = #{number}</if>
  37. <if test="number1 != null and number1 != ''"> and number1 = #{number1}</if>
  38. <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
  39. <if test="behoof != null and behoof != ''"> and behoof = #{behoof}</if>
  40. <if test="statusQuo != null and statusQuo != ''"> and status_quo = #{statusQuo}</if>
  41. <if test="period != null and period != ''"> and period = #{period}</if>
  42. <if test="area != null and area != ''"> and area = #{area}</if>
  43. <if test="createtime != null and createtime != ''"> and createtime = #{createtime}</if>
  44. <if test="updatetime != null and updatetime != ''"> and updatetime = #{updatetime}</if>
  45. <if test="tier != null and tier != ''"> and tier = #{tier}</if>
  46. <if test="roomNumber != null "> and room_number = #{roomNumber}</if>
  47. <if test="element != null and element != ''"> and element = #{element}</if>
  48. <if test="xingMing != null and xingMing != ''"> and xing_ming = #{xingMing}</if>
  49. <if test="usageArea != null "> and usage_area = #{usageArea}</if>
  50. <if test="propertyFeeStandard != null "> and property_fee_standard = #{propertyFeeStandard}</if>
  51. <if test="rentStandard != null "> and rent_standard = #{rentStandard}</if>
  52. <if test="waterBil != null "> and water_bil = #{waterBil}</if>
  53. <if test="monthlyRent != null "> and monthly_rent = #{monthlyRent}</if>
  54. <if test="monthlyPropertyFee != null "> and monthly_property_fee = #{monthlyPropertyFee}</if>
  55. <if test="totalAmount != null "> and total_amount = #{totalAmount}</if>
  56. </where>
  57. order by id desc
  58. </select>
  59. <select id="selectBdglFlatById" parameterType="Integer" resultMap="BdglFlatResult">
  60. <include refid="selectBdglFlatVo"/>
  61. where id = #{id}
  62. </select>
  63. <insert id="insertBdglFlat" parameterType="BdglFlat" useGeneratedKeys="true" keyProperty="id">
  64. insert into bdgl_flat
  65. <trim prefix="(" suffix=")" suffixOverrides=",">
  66. <if test="number != null">number,</if>
  67. <if test="number1 != null">number1,</if>
  68. <if test="name != null">name,</if>
  69. <if test="behoof != null">behoof,</if>
  70. <if test="statusQuo != null">status_quo,</if>
  71. <if test="period != null">period,</if>
  72. <if test="area != null">area,</if>
  73. <if test="remark != null">remark,</if>
  74. <if test="createtime != null">createtime,</if>
  75. <if test="updatetime != null">updatetime,</if>
  76. <if test="tier != null">tier,</if>
  77. <if test="roomNumber != null">room_number,</if>
  78. <if test="element != null">element,</if>
  79. <if test="xingMing != null">xing_ming,</if>
  80. <if test="usageArea != null">usage_area,</if>
  81. <if test="propertyFeeStandard != null">property_fee_standard,</if>
  82. <if test="rentStandard != null">rent_standard,</if>
  83. <if test="waterBil != null">water_bil,</if>
  84. <if test="monthlyRent != null">monthly_rent,</if>
  85. <if test="monthlyPropertyFee != null">monthly_property_fee,</if>
  86. <if test="totalAmount != null">total_amount,</if>
  87. </trim>
  88. <trim prefix="values (" suffix=")" suffixOverrides=",">
  89. <if test="number != null">#{number},</if>
  90. <if test="number1 != null">#{number1},</if>
  91. <if test="name != null">#{name},</if>
  92. <if test="behoof != null">#{behoof},</if>
  93. <if test="statusQuo != null">#{statusQuo},</if>
  94. <if test="period != null">#{period},</if>
  95. <if test="area != null">#{area},</if>
  96. <if test="remark != null">#{remark},</if>
  97. <if test="createtime != null">#{createtime},</if>
  98. <if test="updatetime != null">#{updatetime},</if>
  99. <if test="tier != null">#{tier},</if>
  100. <if test="roomNumber != null">#{roomNumber},</if>
  101. <if test="element != null">#{element},</if>
  102. <if test="xingMing != null">#{xingMing},</if>
  103. <if test="usageArea != null">#{usageArea},</if>
  104. <if test="propertyFeeStandard != null">#{propertyFeeStandard},</if>
  105. <if test="rentStandard != null">#{rentStandard},</if>
  106. <if test="waterBil != null">#{waterBil},</if>
  107. <if test="monthlyRent != null">#{monthlyRent},</if>
  108. <if test="monthlyPropertyFee != null">#{monthlyPropertyFee},</if>
  109. <if test="totalAmount != null">#{totalAmount},</if>
  110. </trim>
  111. </insert>
  112. <update id="updateBdglFlat" parameterType="BdglFlat">
  113. update bdgl_flat
  114. <trim prefix="SET" suffixOverrides=",">
  115. <if test="number != null">number = #{number},</if>
  116. <if test="number1 != null">number1 = #{number1},</if>
  117. <if test="name != null">name = #{name},</if>
  118. <if test="behoof != null">behoof = #{behoof},</if>
  119. <if test="statusQuo != null">status_quo = #{statusQuo},</if>
  120. <if test="period != null">period = #{period},</if>
  121. <if test="area != null">area = #{area},</if>
  122. <if test="remark != null">remark = #{remark},</if>
  123. <if test="createtime != null">createtime = #{createtime},</if>
  124. <if test="updatetime != null">updatetime = #{updatetime},</if>
  125. <if test="tier != null">tier = #{tier},</if>
  126. <if test="roomNumber != null">room_number = #{roomNumber},</if>
  127. <if test="element != null">element = #{element},</if>
  128. <if test="xingMing != null">xing_ming = #{xingMing},</if>
  129. <if test="usageArea != null">usage_area = #{usageArea},</if>
  130. <if test="propertyFeeStandard != null">property_fee_standard = #{propertyFeeStandard},</if>
  131. <if test="rentStandard != null">rent_standard = #{rentStandard},</if>
  132. <if test="waterBil != null">water_bil = #{waterBil},</if>
  133. <if test="monthlyRent != null">monthly_rent = #{monthlyRent},</if>
  134. <if test="monthlyPropertyFee != null">monthly_property_fee = #{monthlyPropertyFee},</if>
  135. <if test="totalAmount != null">total_amount = #{totalAmount},</if>
  136. </trim>
  137. where id = #{id}
  138. </update>
  139. <delete id="deleteBdglFlatById" parameterType="Integer">
  140. delete from bdgl_flat where id = #{id}
  141. </delete>
  142. <delete id="deleteBdglFlatByIds" parameterType="String">
  143. delete from bdgl_flat where id in
  144. <foreach item="id" collection="array" open="(" separator="," close=")">
  145. #{id}
  146. </foreach>
  147. </delete>
  148. </mapper>