BkLocationRecordMapper.xml 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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.BkLocationRecordMapper">
  6. <resultMap type="BkLocationRecord" id="BkLocationRecordResult">
  7. <result property="id" column="id" />
  8. <result property="processId" column="process_id" />
  9. <result property="lat" column="lat" />
  10. <result property="lon" column="lon" />
  11. <result property="createBy" column="create_by" />
  12. <result property="createTime" column="create_time" />
  13. <result property="updateBy" column="update_by" />
  14. <result property="updateTime" column="update_time" />
  15. </resultMap>
  16. <sql id="selectBkLocationRecordVo">
  17. select id, process_id, lat, lon, create_by, create_time, update_by, update_time from bk_location_record
  18. </sql>
  19. <select id="selectBkLocationRecordList" parameterType="BkLocationRecord" resultMap="BkLocationRecordResult">
  20. <include refid="selectBkLocationRecordVo"/>
  21. <where>
  22. <if test="processId != null "> and process_id = #{processId}</if>
  23. <if test="lat != null and lat != ''"> and lat = #{lat}</if>
  24. <if test="lon != null and lon != ''"> and lon = #{lon}</if>
  25. </where>
  26. ORDER BY create_time ASC
  27. </select>
  28. <select id="selectBkLocationRecordById" parameterType="Long" resultMap="BkLocationRecordResult">
  29. <include refid="selectBkLocationRecordVo"/>
  30. where id = #{id}
  31. </select>
  32. <insert id="insertBkLocationRecord" parameterType="BkLocationRecord">
  33. insert into bk_location_record
  34. <trim prefix="(" suffix=")" suffixOverrides=",">
  35. <if test="id != null">id,</if>
  36. <if test="processId != null">process_id,</if>
  37. <if test="lat != null">lat,</if>
  38. <if test="lon != null">lon,</if>
  39. <if test="createBy != null">create_by,</if>
  40. <if test="createTime != null">create_time,</if>
  41. <if test="updateBy != null">update_by,</if>
  42. <if test="updateTime != null">update_time,</if>
  43. </trim>
  44. <trim prefix="values (" suffix=")" suffixOverrides=",">
  45. <if test="id != null">#{id},</if>
  46. <if test="processId != null">#{processId},</if>
  47. <if test="lat != null">#{lat},</if>
  48. <if test="lon != null">#{lon},</if>
  49. <if test="createBy != null">#{createBy},</if>
  50. <if test="createTime != null">#{createTime},</if>
  51. <if test="updateBy != null">#{updateBy},</if>
  52. <if test="updateTime != null">#{updateTime},</if>
  53. </trim>
  54. </insert>
  55. <update id="updateBkLocationRecord" parameterType="BkLocationRecord">
  56. update bk_location_record
  57. <trim prefix="SET" suffixOverrides=",">
  58. <if test="processId != null">process_id = #{processId},</if>
  59. <if test="lat != null">lat = #{lat},</if>
  60. <if test="lon != null">lon = #{lon},</if>
  61. <if test="createBy != null">create_by = #{createBy},</if>
  62. <if test="createTime != null">create_time = #{createTime},</if>
  63. <if test="updateBy != null">update_by = #{updateBy},</if>
  64. <if test="updateTime != null">update_time = #{updateTime},</if>
  65. </trim>
  66. where id = #{id}
  67. </update>
  68. <delete id="deleteBkLocationRecordById" parameterType="Long">
  69. delete from bk_location_record where id = #{id}
  70. </delete>
  71. <delete id="deleteBkLocationRecordByIds" parameterType="String">
  72. delete from bk_location_record where id in
  73. <foreach item="id" collection="array" open="(" separator="," close=")">
  74. #{id}
  75. </foreach>
  76. </delete>
  77. </mapper>