KwtWaybillOrderAddressMapper.xml 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.sckw.transport.dao.KwtWaybillOrderAddressMapper">
  4. <select id="findByAddress" resultType="com.sckw.transport.model.KwtWaybillOrderAddress" >
  5. select
  6. id, w_order_id wOrderId, address_type addressType, `name`, `type`, contacts, phone, city_code cityCode, city_name cityName,
  7. detail_address detailAddress, lat, lng, fence, entry_type entryType, remark, `status`, create_by createBy, create_time createTime,
  8. update_by updateBy, update_time updateTime
  9. from kwt_waybill_order_address
  10. where del_flag = 0
  11. and w_order_id = #{wOrderId, jdbcType=BIGINT}
  12. and address_type = #{addressType, jdbcType=INTEGER}
  13. </select>
  14. <select id="findByAddresses" resultType="com.sckw.transport.model.KwtWaybillOrderAddress" >
  15. select
  16. id, w_order_id wOrderId, w_subtask_id wSubtaskId, l_address_id lAddressId, address_type addressType,
  17. `name`, `type`, contacts, phone, city_code cityCode, city_name cityName, detail_address detailAddress,
  18. lat, lng, fence, entry_type entryType, plan_time planTime, entrust_amount entrustAmount, sort, remark,
  19. `status`, create_by createBy, create_time createTime, update_by updateBy, update_time updateTime
  20. from kwt_waybill_order_address
  21. where del_flag = 0
  22. and w_order_id = #{wOrderId, jdbcType=BIGINT}
  23. <if test="addressType != null and addressType != ''">
  24. and address_type = #{addressType, jdbcType=BIGINT}
  25. </if>
  26. </select>
  27. <select id="findBySubtaskId" resultType="com.sckw.transport.model.KwtWaybillOrderAddress" >
  28. select
  29. id, w_order_id wOrderId, w_subtask_id wSubtaskId, l_address_id lAddressId, address_type addressType,
  30. `name`, `type`, contacts, phone, city_code cityCode, city_name cityName, detail_address detailAddress,
  31. lat, lng, fence, entry_type entryType, plan_time planTime, entrust_amount entrustAmount, sort, remark,
  32. `status`, create_by createBy, create_time createTime, update_by updateBy, update_time updateTime
  33. from kwt_waybill_order_address
  34. where del_flag = 0
  35. and w_subtask_id = #{wSubtaskId, jdbcType=BIGINT}
  36. <if test="addressType != null and addressType != ''">
  37. and address_type = #{addressType, jdbcType=BIGINT}
  38. </if>
  39. </select>
  40. <select id="findByLAddressIds" resultType="com.sckw.transport.model.KwtWaybillOrderAddress" >
  41. select
  42. id, w_order_id wOrderId, w_subtask_id wSubtaskId, l_address_id lAddressId, address_type addressType,
  43. `name`, `type`, contacts, phone, city_code cityCode, city_name cityName, detail_address detailAddress,
  44. lat, lng, fence, entry_type entryType, plan_time planTime, entrust_amount entrustAmount, sort, remark,
  45. `status`, create_by createBy, create_time createTime, update_by updateBy, update_time updateTime
  46. from kwt_waybill_order_address
  47. where del_flag = 0
  48. <if test="lAddressIds != null and lAddressIds.size() > 0">
  49. AND l_address_id IN
  50. <foreach collection="lAddressIds" item="item" open="(" close=")" separator=",">
  51. #{item}
  52. </foreach>
  53. </if>
  54. </select>
  55. <select id="findAddressCodeList" resultType="java.lang.Integer" >
  56. SELECT
  57. DISTINCT kwoa.city_code
  58. from kwt_waybill_order kwo
  59. left join kwt_waybill_order_address kwoa on kwoa.w_order_id = kwo.id
  60. where kwo.del_flag = 0 and kwoa.del_flag = 0
  61. and kwo.ent_id = #{entId, jdbcType=BIGINT}
  62. and kwoa.address_type = #{addressType, jdbcType=INTEGER}
  63. </select>
  64. </mapper>