RiderPositionMapper.xml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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.RiderPositionMapper">
  6. <resultMap type="RiderPosition" id="RiderPositionResult">
  7. <result property="id" column="id" />
  8. <result property="riderId" column="rider_id" />
  9. <result property="longitude" column="longitude" />
  10. <result property="latitude" column="latitude" />
  11. <result property="notes" column="notes" />
  12. <result property="cid" column="cid" />
  13. </resultMap>
  14. <sql id="selectRiderPositionVo">
  15. select id, rider_id, longitude, latitude, notes,cid from rider_position
  16. </sql>
  17. <select id="selectRiderPositionList" parameterType="RiderPosition" resultMap="RiderPositionResult">
  18. <include refid="selectRiderPositionVo"/>
  19. <where>
  20. <if test="riderId != null "> and rider_id = #{riderId}</if>
  21. <if test="longitude != null "> and longitude = #{longitude}</if>
  22. <if test="latitude != null "> and latitude = #{latitude}</if>
  23. <if test="notes != null and notes != ''"> and notes = #{notes}</if>
  24. <if test="cid != null and cid != ''"> and cid = #{cid}</if>
  25. </where>
  26. </select>
  27. <select id="selectRiderPositionById" parameterType="Long" resultMap="RiderPositionResult">
  28. <include refid="selectRiderPositionVo"/>
  29. where id = #{id}
  30. </select>
  31. <insert id="insertRiderPosition" parameterType="RiderPosition">
  32. insert into rider_position
  33. <trim prefix="(" suffix=")" suffixOverrides=",">
  34. <if test="id != null">id,</if>
  35. <if test="riderId != null">rider_id,</if>
  36. <if test="longitude != null">longitude,</if>
  37. <if test="latitude != null">latitude,</if>
  38. <if test="notes != null">notes,</if>
  39. <if test="cid != null">cid,</if>
  40. </trim>
  41. <trim prefix="values (" suffix=")" suffixOverrides=",">
  42. <if test="id != null">#{id},</if>
  43. <if test="riderId != null">#{riderId},</if>
  44. <if test="longitude != null">#{longitude},</if>
  45. <if test="latitude != null">#{latitude},</if>
  46. <if test="notes != null">#{notes},</if>
  47. <if test="cid != null">#{cid},</if>
  48. </trim>
  49. </insert>
  50. <update id="updateRiderPosition" parameterType="RiderPosition">
  51. update rider_position
  52. <trim prefix="SET" suffixOverrides=",">
  53. <if test="riderId != null">rider_id = #{riderId},</if>
  54. <if test="longitude != null">longitude = #{longitude},</if>
  55. <if test="latitude != null">latitude = #{latitude},</if>
  56. <if test="notes != null">notes = #{notes},</if>
  57. <if test="cid != null">cid = #{cid},</if>
  58. </trim>
  59. where id = #{id}
  60. </update>
  61. <delete id="deleteRiderPositionById" parameterType="Long">
  62. delete from rider_position where id = #{id}
  63. </delete>
  64. <delete id="deleteRiderPositionByIds" parameterType="String">
  65. delete from rider_position where id in
  66. <foreach item="id" collection="array" open="(" separator="," close=")">
  67. #{id}
  68. </foreach>
  69. </delete>
  70. </mapper>