PosFreightMapper.xml 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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.ruoyi.system.mapper.PosFreightMapper">
  6. <resultMap type="PosFreight" id="PosFreightResult">
  7. <result property="id" column="id" />
  8. <result property="startTime" column="start_time" />
  9. <result property="endTime" column="end_time" />
  10. <result property="freight" column="freight" />
  11. <result property="distance" column="distance" />
  12. <result property="startingFare" column="starting_fare" />
  13. <result property="startingDistance" column="starting_distance" />
  14. </resultMap>
  15. <sql id="selectPosFreightVo">
  16. select id, start_time, end_time, freight, distance,starting_fare,starting_distance from pos_freight
  17. </sql>
  18. <select id="selectPosFreightList" parameterType="PosFreight" resultMap="PosFreightResult">
  19. <include refid="selectPosFreightVo"/>
  20. <where>
  21. <if test="freight != null "> and freight = #{freight}</if>
  22. </where>
  23. order by id desc
  24. </select>
  25. <select id="selectPosFreightById" parameterType="Long" resultMap="PosFreightResult">
  26. <include refid="selectPosFreightVo"/>
  27. where id = #{id}
  28. </select>
  29. <insert id="insertPosFreight" parameterType="PosFreight" useGeneratedKeys="true" keyProperty="id">
  30. insert into pos_freight
  31. <trim prefix="(" suffix=")" suffixOverrides=",">
  32. <if test="startTime != null">start_time,</if>
  33. <if test="endTime != null">end_time,</if>
  34. <if test="freight != null">freight,</if>
  35. <if test="distance != null">distance,</if>
  36. <if test="startingFare != null">starting_fare,</if>
  37. <if test="startingDistance != null">starting_distance,</if>
  38. </trim>
  39. <trim prefix="values (" suffix=")" suffixOverrides=",">
  40. <if test="startTime != null">#{startTime},</if>
  41. <if test="endTime != null">#{endTime},</if>
  42. <if test="freight != null">#{freight},</if>
  43. <if test="distance != null">#{distance},</if>
  44. <if test="startingFare != null">#{startingFare},</if>
  45. <if test="startingDistance != null">#{startingDistance},</if>
  46. </trim>
  47. </insert>
  48. <update id="updatePosFreight" parameterType="PosFreight">
  49. update pos_freight
  50. <trim prefix="SET" suffixOverrides=",">
  51. <if test="startTime != null">start_time = #{startTime},</if>
  52. <if test="endTime != null">end_time = #{endTime},</if>
  53. <if test="freight != null">freight = #{freight},</if>
  54. <if test="distance != null">distance = #{distance},</if>
  55. <if test="startingFare != null">starting_fare = #{startingFare},</if>
  56. <if test="startingDistance != null">starting_distance = #{startingDistance},</if>
  57. </trim>
  58. where id = #{id}
  59. </update>
  60. <delete id="deletePosFreightById" parameterType="Long">
  61. delete from pos_freight where id = #{id}
  62. </delete>
  63. <delete id="deletePosFreightByIds" parameterType="String">
  64. delete from pos_freight where id in
  65. <foreach item="id" collection="array" open="(" separator="," close=")">
  66. #{id}
  67. </foreach>
  68. </delete>
  69. </mapper>