BdglThebusAccessLogMapper.xml 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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.BdglThebusAccessLogMapper">
  6. <resultMap type="BdglThebusAccessLog" id="BdglThebusAccessLogResult">
  7. <result property="id" column="id" />
  8. <result property="thebusId" column="thebus_id" />
  9. <result property="vehiclenumber" column="vehiclenumber" />
  10. <result property="vehiclemodel" column="vehiclemodel" />
  11. <result property="parkingspacenumber" column="parkingspacenumber" />
  12. <result property="vehiclecolor" column="vehiclecolor" />
  13. <result property="unitId" column="unit_id" />
  14. <result property="driverId" column="driver_id" />
  15. <result property="driverName" column="driver_name" />
  16. <result property="contactnumber" column="contactnumber" />
  17. <result property="waichushijian" column="waichushijian" />
  18. <result property="fanhuishijian" column="fanhuishijian" />
  19. <result property="adminId" column="admin_id" />
  20. <result property="createtime" column="createtime" />
  21. <result property="updatetime" column="updatetime" />
  22. <result property="unitName" column="unit_name" />
  23. <result property="cutoffTime" column="cutoff_time" />
  24. <result property="outType" column="out_type" />
  25. <result property="remark" column="remark" />
  26. </resultMap>
  27. <sql id="selectBdglThebusAccessLogVo">
  28. select id, thebus_id, vehiclenumber, vehiclemodel, parkingspacenumber, vehiclecolor, unit_id, driver_id, driver_name, contactnumber, waichushijian, fanhuishijian, admin_id, createtime, updatetime, unit_name, cutoff_time, out_type,remark from bdgl_thebus_access_log
  29. </sql>
  30. <select id="selectBdglThebusAccessLogList" parameterType="BdglThebusAccessLog" resultMap="BdglThebusAccessLogResult">
  31. <include refid="selectBdglThebusAccessLogVo"/>
  32. <where>
  33. <if test="thebusId != null "> and thebus_id = #{thebusId}</if>
  34. <if test="vehiclenumber != null and vehiclenumber != ''"> and vehiclenumber like concat('%', #{vehiclenumber}, '%')</if>
  35. <if test="vehiclemodel != null and vehiclemodel != ''"> and vehiclemodel = #{vehiclemodel}</if>
  36. <if test="parkingspacenumber != null and parkingspacenumber != ''"> and parkingspacenumber = #{parkingspacenumber}</if>
  37. <if test="vehiclecolor != null and vehiclecolor != ''"> and vehiclecolor = #{vehiclecolor}</if>
  38. <if test="unitId != null "> and unit_id = #{unitId}</if>
  39. <if test="driverId != null "> and driver_id = #{driverId}</if>
  40. <if test="driverName != null and driverName != ''"> and driver_name like concat('%', #{driverName}, '%')</if>
  41. <if test="contactnumber != null and contactnumber != ''"> and contactnumber = #{contactnumber}</if>
  42. <if test="waichushijian != null "> and waichushijian like concat('%', #{waichushijian}, '%')</if>
  43. <if test="fanhuishijian != null "> and fanhuishijian = #{fanhuishijian}</if>
  44. <if test="adminId != null "> and admin_id = #{adminId}</if>
  45. <if test="createtime != null "> and createtime = #{createtime}</if>
  46. <if test="updatetime != null "> and updatetime = #{updatetime}</if>
  47. <if test="unitName != null and unitName != ''"> and unit_name like concat('%', #{unitName}, '%')</if>
  48. <if test="cutoffTime != null "> and cutoff_time = #{cutoffTime}</if>
  49. <if test="outType != null and outType != ''"> and out_type = #{outType}</if>
  50. <if test="remark != null and remark != ''"> and remark = #{remark}</if>
  51. </where>
  52. order by waichushijian DESC
  53. </select>
  54. <select id="selectBdglThebusAccessLogById" parameterType="Integer" resultMap="BdglThebusAccessLogResult">
  55. <include refid="selectBdglThebusAccessLogVo"/>
  56. where id = #{id}
  57. </select>
  58. <select id="selectBdglThebusAccessLogLists" resultMap="BdglThebusAccessLogResult">
  59. select * from bdgl_thebus_access_log where waichushijian is not null and waichushijian like concat('%', #{waichushijian}, '%') group by vehiclenumber
  60. </select>
  61. <insert id="insertBdglThebusAccessLog" parameterType="BdglThebusAccessLog" useGeneratedKeys="true" keyProperty="id">
  62. insert into bdgl_thebus_access_log
  63. <trim prefix="(" suffix=")" suffixOverrides=",">
  64. <if test="thebusId != null">thebus_id,</if>
  65. <if test="vehiclenumber != null">vehiclenumber,</if>
  66. <if test="vehiclemodel != null">vehiclemodel,</if>
  67. <if test="parkingspacenumber != null">parkingspacenumber,</if>
  68. <if test="vehiclecolor != null">vehiclecolor,</if>
  69. <if test="unitId != null">unit_id,</if>
  70. <if test="driverId != null">driver_id,</if>
  71. <if test="driverName != null">driver_name,</if>
  72. <if test="contactnumber != null">contactnumber,</if>
  73. <if test="waichushijian != null">waichushijian,</if>
  74. <if test="fanhuishijian != null">fanhuishijian,</if>
  75. <if test="adminId != null">admin_id,</if>
  76. <if test="createtime != null">createtime,</if>
  77. <if test="updatetime != null">updatetime,</if>
  78. <if test="unitName != null">unit_name,</if>
  79. <if test="cutoffTime != null">cutoff_time,</if>
  80. <if test="outType != null">out_type,</if>
  81. <if test="remark != null">remark,</if>
  82. </trim>
  83. <trim prefix="values (" suffix=")" suffixOverrides=",">
  84. <if test="thebusId != null">#{thebusId},</if>
  85. <if test="vehiclenumber != null">#{vehiclenumber},</if>
  86. <if test="vehiclemodel != null">#{vehiclemodel},</if>
  87. <if test="parkingspacenumber != null">#{parkingspacenumber},</if>
  88. <if test="vehiclecolor != null">#{vehiclecolor},</if>
  89. <if test="unitId != null">#{unitId},</if>
  90. <if test="driverId != null">#{driverId},</if>
  91. <if test="driverName != null">#{driverName},</if>
  92. <if test="contactnumber != null">#{contactnumber},</if>
  93. <if test="waichushijian != null">#{waichushijian},</if>
  94. <if test="fanhuishijian != null">#{fanhuishijian},</if>
  95. <if test="adminId != null">#{adminId},</if>
  96. <if test="createtime != null">#{createtime},</if>
  97. <if test="updatetime != null">#{updatetime},</if>
  98. <if test="unitName != null">#{unitName},</if>
  99. <if test="cutoffTime != null">#{cutoffTime},</if>
  100. <if test="outType != null">#{outType},</if>
  101. <if test="remark != null">#{remark},</if>
  102. </trim>
  103. </insert>
  104. <update id="updateBdglThebusAccessLog" parameterType="BdglThebusAccessLog">
  105. update bdgl_thebus_access_log
  106. <trim prefix="SET" suffixOverrides=",">
  107. <if test="thebusId != null">thebus_id = #{thebusId},</if>
  108. <if test="vehiclenumber != null">vehiclenumber = #{vehiclenumber},</if>
  109. <if test="vehiclemodel != null">vehiclemodel = #{vehiclemodel},</if>
  110. <if test="parkingspacenumber != null">parkingspacenumber = #{parkingspacenumber},</if>
  111. <if test="vehiclecolor != null">vehiclecolor = #{vehiclecolor},</if>
  112. <if test="unitId != null">unit_id = #{unitId},</if>
  113. <if test="driverId != null">driver_id = #{driverId},</if>
  114. <if test="driverName != null">driver_name = #{driverName},</if>
  115. <if test="contactnumber != null">contactnumber = #{contactnumber},</if>
  116. <if test="waichushijian != null">waichushijian = #{waichushijian},</if>
  117. <if test="fanhuishijian != null">fanhuishijian = #{fanhuishijian},</if>
  118. <if test="adminId != null">admin_id = #{adminId},</if>
  119. <if test="createtime != null">createtime = #{createtime},</if>
  120. <if test="updatetime != null">updatetime = #{updatetime},</if>
  121. <if test="unitName != null">unit_name = #{unitName},</if>
  122. <if test="cutoffTime != null">cutoff_time = #{cutoffTime},</if>
  123. <if test="outType != null">out_type = #{outType},</if>
  124. <if test="remark != null">remark = #{remark},</if>
  125. </trim>
  126. where id = #{id}
  127. </update>
  128. <delete id="deleteBdglThebusAccessLogById" parameterType="Integer">
  129. delete from bdgl_thebus_access_log where id = #{id}
  130. </delete>
  131. <delete id="deleteBdglThebusAccessLogByIds" parameterType="String">
  132. delete from bdgl_thebus_access_log where id in
  133. <foreach item="id" collection="array" open="(" separator="," close=")">
  134. #{id}
  135. </foreach>
  136. </delete>
  137. </mapper>