BdglThebusMapper.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  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.militaryvehicleManagement.mapper.BdglThebusMapper">
  6. <resultMap type="BdglThebus" id="BdglThebusResult">
  7. <result property="id" column="id" />
  8. <result property="vehiclenumber" column="vehiclenumber" />
  9. <result property="vehiclemodel" column="vehiclemodel" />
  10. <result property="vehiclecolor" column="vehiclecolor" />
  11. <result property="parkingspacenumber" column="parkingspacenumber" />
  12. <result property="contactnumber" column="contactnumber" />
  13. <result property="remarks" column="remarks" />
  14. <result property="adminId" column="admin_id" />
  15. <result property="createtime" column="createtime" />
  16. <result property="updatetime" column="updatetime" />
  17. <result property="status" column="status" />
  18. <result property="unitId" column="unit_id" />
  19. <result property="peopleId" column="people_id" />
  20. <result property="engineNumber" column="engine_number" />
  21. <result property="frameNumber" column="frame_number" />
  22. <result property="source" column="source" />
  23. <result property="date1" column="date1" />
  24. <result property="etcBrand" column="etc_brand" />
  25. <result property="chelaingleibie" column="chelaingleibie" />
  26. <result property="etcNumber" column="etc_number" />
  27. <result property="position" column="position" />
  28. <result property="isListing" column="is_listing" />
  29. <result property="seatCount" column="seat_count" />
  30. <result property="unitName" column="unit_name" />
  31. <result property="shenhejieguo" column="shenhejieguo" />
  32. <result property="peopleNames" column="people_names" />
  33. <result property="orders" column="orders" />
  34. <result property="carUse" column="car_use" />
  35. </resultMap>
  36. <sql id="selectBdglThebusVo">
  37. select id, vehiclenumber, vehiclemodel, vehiclecolor, parkingspacenumber, contactnumber, remarks, admin_id, createtime, updatetime, status, unit_id, people_id, engine_number, frame_number, source, date1, etc_brand, chelaingleibie, etc_number, position, is_listing, seat_count, unit_name, shenhejieguo,people_names,orders,car_use from bdgl_thebus
  38. </sql>
  39. <select id="selectBdglThebusList" parameterType="BdglThebus" resultMap="BdglThebusResult">
  40. <include refid="selectBdglThebusVo"/>
  41. <where>
  42. <if test="vehiclenumber != null and vehiclenumber != ''"> vehiclenumber like concat('%', #{vehiclenumber}, '%')</if>
  43. <if test="vehiclemodel != null "> and vehiclemodel = #{vehiclemodel}</if>
  44. <if test="vehiclecolor != null and vehiclecolor != ''"> and vehiclecolor = #{vehiclecolor}</if>
  45. <if test="parkingspacenumber != null and parkingspacenumber != ''"> and parkingspacenumber = #{parkingspacenumber}</if>
  46. <if test="contactnumber != null and contactnumber != ''"> and contactnumber = #{contactnumber}</if>
  47. <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
  48. <if test="adminId != null "> and admin_id = #{adminId}</if>
  49. <if test="createtime != null and createtime != ''"> and createtime = #{createtime}</if>
  50. <if test="updatetime != null and updatetime != ''"> and updatetime = #{updatetime}</if>
  51. <if test="status != null "> and status = #{status}</if>
  52. <if test="unitId != null "> and unit_id = #{unitId}</if>
  53. <if test="peopleId != null "> and people_id = #{peopleId}</if>
  54. <if test="engineNumber != null and engineNumber != ''"> and engine_number = #{engineNumber}</if>
  55. <if test="frameNumber != null and frameNumber != ''"> and frame_number = #{frameNumber}</if>
  56. <if test="source != null and source != ''"> and source = #{source}</if>
  57. <if test="date1 != null "> and date1 = #{date1}</if>
  58. <if test="etcBrand != null and etcBrand != ''"> and etc_brand = #{etcBrand}</if>
  59. <if test="chelaingleibie != null and chelaingleibie != ''"> and chelaingleibie = #{chelaingleibie}</if>
  60. <if test="etcNumber != null and etcNumber != ''"> and etc_number = #{etcNumber}</if>
  61. <if test="position != null and position != ''"> and position = #{position}</if>
  62. <if test="isListing != null and isListing != ''"> and is_listing = #{isListing}</if>
  63. <if test="seatCount != null "> and seat_count = #{seatCount}</if>
  64. <if test="unitName != null and unitName != ''"> and unit_name like concat('%', #{unitName}, '%')</if>
  65. <if test="shenhejieguo != null and shenhejieguo != ''"> and shenhejieguo = #{shenhejieguo}</if>
  66. <if test="peopleNames != null and peopleNames != ''"> and peopleNames = #{people_names}</if>
  67. <if test="orders != null and orders != ''"> and orders = #{orders}</if>
  68. <if test="carUse != null and carUse != ''"> and car_use = #{carUse}</if>
  69. <if test="idList!=null and idList.size()>0">
  70. and id in
  71. <foreach collection="idList" item="id" open="(" separator="," close=")">
  72. #{id}
  73. </foreach>
  74. </if>
  75. </where>
  76. ORDER BY orders IS NULL, orders ASC,id DESC
  77. </select>
  78. <select id="selectBdglThebusById" parameterType="Long" resultMap="BdglThebusResult">
  79. <include refid="selectBdglThebusVo"/>
  80. where id = #{id}
  81. </select>
  82. <insert id="insertBdglThebus" parameterType="BdglThebus" useGeneratedKeys="true" keyProperty="id">
  83. insert into bdgl_thebus
  84. <trim prefix="(" suffix=")" suffixOverrides=",">
  85. <if test="vehiclenumber != null">vehiclenumber,</if>
  86. <if test="vehiclemodel != null">vehiclemodel,</if>
  87. <if test="vehiclecolor != null">vehiclecolor,</if>
  88. <if test="parkingspacenumber != null">parkingspacenumber,</if>
  89. <if test="contactnumber != null">contactnumber,</if>
  90. <if test="remarks != null">remarks,</if>
  91. <if test="adminId != null">admin_id,</if>
  92. <if test="createtime != null">createtime,</if>
  93. <if test="updatetime != null">updatetime,</if>
  94. <if test="status != null">status,</if>
  95. <if test="unitId != null">unit_id,</if>
  96. <if test="peopleId != null">people_id,</if>
  97. <if test="engineNumber != null">engine_number,</if>
  98. <if test="frameNumber != null">frame_number,</if>
  99. <if test="source != null">source,</if>
  100. <if test="date1 != null">date1,</if>
  101. <if test="etcBrand != null">etc_brand,</if>
  102. <if test="chelaingleibie != null">chelaingleibie,</if>
  103. <if test="etcNumber != null">etc_number,</if>
  104. <if test="position != null">position,</if>
  105. <if test="isListing != null">is_listing,</if>
  106. <if test="seatCount != null">seat_count,</if>
  107. <if test="unitName != null">unit_name,</if>
  108. <if test="shenhejieguo != null">shenhejieguo,</if>
  109. <if test="peopleNames != null "> people_names ,</if>
  110. <if test="orders != null "> orders ,</if>
  111. <if test="carUse != null "> car_use ,</if>
  112. </trim>
  113. <trim prefix="values (" suffix=")" suffixOverrides=",">
  114. <if test="vehiclenumber != null">#{vehiclenumber},</if>
  115. <if test="vehiclemodel != null">#{vehiclemodel},</if>
  116. <if test="vehiclecolor != null">#{vehiclecolor},</if>
  117. <if test="parkingspacenumber != null">#{parkingspacenumber},</if>
  118. <if test="contactnumber != null">#{contactnumber},</if>
  119. <if test="remarks != null">#{remarks},</if>
  120. <if test="adminId != null">#{adminId},</if>
  121. <if test="createtime != null">#{createtime},</if>
  122. <if test="updatetime != null">#{updatetime},</if>
  123. <if test="status != null">#{status},</if>
  124. <if test="unitId != null">#{unitId},</if>
  125. <if test="peopleId != null">#{peopleId},</if>
  126. <if test="engineNumber != null">#{engineNumber},</if>
  127. <if test="frameNumber != null">#{frameNumber},</if>
  128. <if test="source != null">#{source},</if>
  129. <if test="date1 != null">#{date1},</if>
  130. <if test="etcBrand != null">#{etcBrand},</if>
  131. <if test="chelaingleibie != null">#{chelaingleibie},</if>
  132. <if test="etcNumber != null">#{etcNumber},</if>
  133. <if test="position != null">#{position},</if>
  134. <if test="isListing != null">#{isListing},</if>
  135. <if test="seatCount != null">#{seatCount},</if>
  136. <if test="unitName != null">#{unitName},</if>
  137. <if test="shenhejieguo != null">#{shenhejieguo},</if>
  138. <if test="peopleNames != null "> #{peopleNames},</if>
  139. <if test="orders != null "> #{orders},</if>
  140. <if test="carUse != null "> #{carUse},</if>
  141. </trim>
  142. </insert>
  143. <update id="updateBdglThebus" parameterType="BdglThebus">
  144. update bdgl_thebus
  145. <trim prefix="SET" suffixOverrides=",">
  146. <if test="vehiclenumber != null">vehiclenumber = #{vehiclenumber},</if>
  147. <if test="vehiclemodel != null">vehiclemodel = #{vehiclemodel},</if>
  148. <if test="vehiclecolor != null">vehiclecolor = #{vehiclecolor},</if>
  149. <if test="parkingspacenumber != null">parkingspacenumber = #{parkingspacenumber},</if>
  150. <if test="contactnumber != null">contactnumber = #{contactnumber},</if>
  151. <if test="remarks != null">remarks = #{remarks},</if>
  152. <if test="adminId != null">admin_id = #{adminId},</if>
  153. <if test="createtime != null">createtime = #{createtime},</if>
  154. <if test="updatetime != null">updatetime = #{updatetime},</if>
  155. <if test="status != null">status = #{status},</if>
  156. <if test="unitId != null">unit_id = #{unitId},</if>
  157. <if test="peopleId != null">people_id = #{peopleId},</if>
  158. <if test="engineNumber != null">engine_number = #{engineNumber},</if>
  159. <if test="frameNumber != null">frame_number = #{frameNumber},</if>
  160. <if test="source != null">source = #{source},</if>
  161. <if test="date1 != null">date1 = #{date1},</if>
  162. <if test="etcBrand != null">etc_brand = #{etcBrand},</if>
  163. <if test="chelaingleibie != null">chelaingleibie = #{chelaingleibie},</if>
  164. <if test="etcNumber != null">etc_number = #{etcNumber},</if>
  165. <if test="position != null">position = #{position},</if>
  166. <if test="isListing != null">is_listing = #{isListing},</if>
  167. <if test="seatCount != null">seat_count = #{seatCount},</if>
  168. <if test="unitName != null">unit_name = #{unitName},</if>
  169. <if test="shenhejieguo != null">shenhejieguo = #{shenhejieguo},</if>
  170. <if test="peopleNames != null "> people_names = #{peopleNames},</if>
  171. <if test="orders != null "> orders = #{orders},</if>
  172. <if test="carUse != null and carUse != ''">car_use = #{carUse}</if>
  173. </trim>
  174. where id = #{id}
  175. </update>
  176. <delete id="deleteBdglThebusById" parameterType="Long">
  177. delete from bdgl_thebus where id = #{id}
  178. </delete>
  179. <delete id="deleteBdglThebusByIds" parameterType="String">
  180. delete from bdgl_thebus where id in
  181. <foreach item="id" collection="array" open="(" separator="," close=")">
  182. #{id}
  183. </foreach>
  184. </delete>
  185. <update id="updateBatchForStatusByIdList" parameterType="Long">
  186. update bdgl_thebus set `status`=1
  187. where id in
  188. <foreach collection="idList" item="id" open="(" separator="," close=")">
  189. #{id}
  190. </foreach>
  191. </update>
  192. </mapper>