BasicVehicleMapper.xml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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.miniapp.bus.mapper.BasicVehicleMapper">
  6. <resultMap type="com.miniapp.bus.domain.BasicVehicle" id="BasicVehicleResult">
  7. <result property="id" column="id" />
  8. <result property="carnumber" column="carnumber" />
  9. <result property="vehicleType" column="vehicle_type" />
  10. <result property="deadweight" column="deadweight" />
  11. <result property="contact" column="contact" />
  12. <result property="telephone" column="telephone" />
  13. <result property="bow" column="bow" />
  14. <result property="certificate" column="certificate" />
  15. <result property="deltag" column="deltag" />
  16. <result property="filepath" column="filepath" />
  17. <result property="createBy" column="create_by" />
  18. <result property="createTime" column="create_time" />
  19. <result property="updateBy" column="update_by" />
  20. <result property="updateTime" column="update_time" />
  21. <result property="remark" column="remark" />
  22. </resultMap>
  23. <sql id="selectBasicVehicleVo">
  24. select id, carnumber, vehicle_type, deadweight, contact, telephone, bow, certificate, deltag, filepath, create_by, create_time, update_by, update_time, remark from basic_vehicle
  25. </sql>
  26. <select id="selectBasicVehicleList" parameterType="BasicVehicle" resultMap="BasicVehicleResult">
  27. <include refid="selectBasicVehicleVo"/>
  28. <where>
  29. <if test="carnumber != null and carnumber != ''"> and carnumber = #{carnumber}</if>
  30. <if test="vehicleType != null and vehicleType != ''"> and vehicle_type = #{vehicleType}</if>
  31. <if test="deadweight != null "> and deadweight = #{deadweight}</if>
  32. <if test="contact != null and contact != ''"> and contact = #{contact}</if>
  33. <if test="telephone != null and telephone != ''"> and telephone = #{telephone}</if>
  34. <if test="bow != null and bow != ''"> and bow = #{bow}</if>
  35. <if test="certificate != null and certificate != ''"> and certificate = #{certificate}</if>
  36. <if test="deltag != null and deltag != ''"> and deltag = #{deltag}</if>
  37. <if test="filepath != null and filepath != ''"> and filepath = #{filepath}</if>
  38. </where>
  39. </select>
  40. <select id="selectBasicVehicleById" parameterType="Long" resultMap="BasicVehicleResult">
  41. <include refid="selectBasicVehicleVo"/>
  42. where id = #{id}
  43. </select>
  44. <insert id="insertBasicVehicle" parameterType="BasicVehicle" useGeneratedKeys="true" keyProperty="id">
  45. insert into basic_vehicle
  46. <trim prefix="(" suffix=")" suffixOverrides=",">
  47. <if test="carnumber != null">carnumber,</if>
  48. <if test="vehicleType != null">vehicle_type,</if>
  49. <if test="deadweight != null">deadweight,</if>
  50. <if test="contact != null">contact,</if>
  51. <if test="telephone != null">telephone,</if>
  52. <if test="bow != null">bow,</if>
  53. <if test="certificate != null">certificate,</if>
  54. <if test="deltag != null">deltag,</if>
  55. <if test="filepath != null">filepath,</if>
  56. <if test="createBy != null">create_by,</if>
  57. <if test="createTime != null">create_time,</if>
  58. <if test="updateBy != null">update_by,</if>
  59. <if test="updateTime != null">update_time,</if>
  60. <if test="remark != null">remark,</if>
  61. </trim>
  62. <trim prefix="values (" suffix=")" suffixOverrides=",">
  63. <if test="carnumber != null">#{carnumber},</if>
  64. <if test="vehicleType != null">#{vehicleType},</if>
  65. <if test="deadweight != null">#{deadweight},</if>
  66. <if test="contact != null">#{contact},</if>
  67. <if test="telephone != null">#{telephone},</if>
  68. <if test="bow != null">#{bow},</if>
  69. <if test="certificate != null">#{certificate},</if>
  70. <if test="deltag != null">#{deltag},</if>
  71. <if test="filepath != null">#{filepath},</if>
  72. <if test="createBy != null">#{createBy},</if>
  73. <if test="createTime != null">#{createTime},</if>
  74. <if test="updateBy != null">#{updateBy},</if>
  75. <if test="updateTime != null">#{updateTime},</if>
  76. <if test="remark != null">#{remark},</if>
  77. </trim>
  78. </insert>
  79. <update id="updateBasicVehicle" parameterType="BasicVehicle">
  80. update basic_vehicle
  81. <trim prefix="SET" suffixOverrides=",">
  82. <if test="carnumber != null">carnumber = #{carnumber},</if>
  83. <if test="vehicleType != null">vehicle_type = #{vehicleType},</if>
  84. <if test="deadweight != null">deadweight = #{deadweight},</if>
  85. <if test="contact != null">contact = #{contact},</if>
  86. <if test="telephone != null">telephone = #{telephone},</if>
  87. <if test="bow != null">bow = #{bow},</if>
  88. <if test="certificate != null">certificate = #{certificate},</if>
  89. <if test="deltag != null">deltag = #{deltag},</if>
  90. <if test="filepath != null">filepath = #{filepath},</if>
  91. <if test="createBy != null">create_by = #{createBy},</if>
  92. <if test="createTime != null">create_time = #{createTime},</if>
  93. <if test="updateBy != null">update_by = #{updateBy},</if>
  94. <if test="updateTime != null">update_time = #{updateTime},</if>
  95. <if test="remark != null">remark = #{remark},</if>
  96. </trim>
  97. where id = #{id}
  98. </update>
  99. <delete id="deleteBasicVehicleById" parameterType="Long">
  100. delete from basic_vehicle where id = #{id}
  101. </delete>
  102. <delete id="deleteBasicVehicleByIds" parameterType="String">
  103. delete from basic_vehicle where id in
  104. <foreach item="id" collection="array" open="(" separator="," close=")">
  105. #{id}
  106. </foreach>
  107. </delete>
  108. </mapper>