KwtWaybillOrderAddressMapper.xml 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  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. <resultMap id="BaseResultMap" type="com.sckw.transport.model.KwtWaybillOrderAddress">
  5. <id column="id" jdbcType="BIGINT" property="id"/>
  6. <result column="w_order_id" jdbcType="BIGINT" property="wOrderId"/>
  7. <result column="address_type" jdbcType="VARCHAR" property="addressType"/>
  8. <result column="name" jdbcType="VARCHAR" property="name"/>
  9. <result column="type" jdbcType="BIGINT" property="type"/>
  10. <result column="contacts" jdbcType="VARCHAR" property="contacts"/>
  11. <result column="phone" jdbcType="VARCHAR" property="phone"/>
  12. <result column="city_code" jdbcType="INTEGER" property="cityCode"/>
  13. <result column="city_name" jdbcType="VARCHAR" property="cityName"/>
  14. <result column="detail_address" jdbcType="VARCHAR" property="detailAddress"/>
  15. <result column="lat" jdbcType="VARCHAR" property="lat"/>
  16. <result column="lng" jdbcType="VARCHAR" property="lng"/>
  17. <result column="fence" jdbcType="VARCHAR" property="fence"/>
  18. <result column="entry_type" jdbcType="INTEGER" property="entryType"/>
  19. <result column="remark" jdbcType="VARCHAR" property="remark"/>
  20. <result column="status" jdbcType="INTEGER" property="status"/>
  21. <result column="create_by" jdbcType="BIGINT" property="createBy"/>
  22. <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
  23. <result column="update_by" jdbcType="BIGINT" property="updateBy"/>
  24. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
  25. <result column="del_flag" jdbcType="INTEGER" property="delFlag"/>
  26. </resultMap>
  27. <sql id="Base_Column_List">
  28. id
  29. , w_order_id, address_type, `name`, `type`, `contacts`,`phone`,`city_code`
  30. , city_name, detail_address, lat, lng, fence, entry_type, remark, status
  31. , create_by, create_time, update_by, update_time, del_flag
  32. </sql>
  33. <insert id="insert1" parameterType="com.sckw.transport.model.KwtWaybillOrderAddress">
  34. insert into kwt_waybill_order_address
  35. <trim prefix="(" suffix=")" suffixOverrides=",">
  36. <if test="id != null">
  37. `id`,
  38. </if>
  39. <if test="wOrderId != null">
  40. `w_order_id`,
  41. </if>
  42. <if test="addressType != null">
  43. `address_type`,
  44. </if>
  45. <if test="name != null">
  46. `name`,
  47. </if>
  48. <if test="type != null">
  49. `type`,
  50. </if>
  51. <if test="contacts != null">
  52. `contacts`,
  53. </if>
  54. <if test="phone != null">
  55. `phone`,
  56. </if>
  57. <if test="cityCode != null">
  58. `city_code`,
  59. </if>
  60. <if test="cityName != null">
  61. `city_name`,
  62. </if>
  63. <if test="detailAddress != null">
  64. `detail_address`,
  65. </if>
  66. <if test="lat != null">
  67. `lat`,
  68. </if>
  69. <if test="lng != null">
  70. `lng`,
  71. </if>
  72. <if test="fence != null">
  73. `fence`,
  74. </if>
  75. <if test="entryType != null">
  76. `entry_type`,
  77. </if>
  78. <if test="remark != null">
  79. `remark`,
  80. </if>
  81. <if test="status != null">
  82. `status`,
  83. </if>
  84. <if test="createBy != null">
  85. `create_by`,
  86. </if>
  87. <if test="createTime != null">
  88. `create_time`,
  89. </if>
  90. <if test="updateBy != null">
  91. `update_by`,
  92. </if>
  93. <if test="updateTime != null">
  94. `update_time`,
  95. </if>
  96. <if test="delFlag != null">
  97. `del_flag`,
  98. </if>
  99. </trim>
  100. <trim prefix="values (" suffix=")" suffixOverrides=",">
  101. <if test="id != null">
  102. #{id,jdbcType=BIGINT},
  103. </if>
  104. <if test="wOrderId != null">
  105. #{wOrderId,jdbcType=BIGINT},
  106. </if>
  107. <if test="addressType != null">
  108. #{addressType,jdbcType=INTEGER},
  109. </if>
  110. <if test="name != null">
  111. #{name,jdbcType=VARCHAR},
  112. </if>
  113. <if test="type != null">
  114. #{type,jdbcType=BIGINT},
  115. </if>
  116. <if test="contacts != null">
  117. #{contacts,jdbcType=VARCHAR},
  118. </if>
  119. <if test="phone != null">
  120. #{phone,jdbcType=VARCHAR},
  121. </if>
  122. <if test="cityCode != null">
  123. #{cityCode,jdbcType=INTEGER},
  124. </if>
  125. <if test="cityName != null">
  126. #{cityName,jdbcType=VARCHAR},
  127. </if>
  128. <if test="detailAddress != null">
  129. #{detailAddress,jdbcType=VARCHAR},
  130. </if>
  131. <if test="lat != null">
  132. #{lat,jdbcType=VARCHAR},
  133. </if>
  134. <if test="lng != null">
  135. #{lng,jdbcType=VARCHAR},
  136. </if>
  137. <if test="fence != null">
  138. #{fence,jdbcType=VARCHAR},
  139. </if>
  140. <if test="entryType != null">
  141. #{entryType,jdbcType=INTEGER},
  142. </if>
  143. <if test="remark != null">
  144. #{remark,jdbcType=VARCHAR},
  145. </if>
  146. <if test="status != null">
  147. #{status,jdbcType=INTEGER},
  148. </if>
  149. <if test="createBy != null">
  150. #{createBy,jdbcType=BIGINT},
  151. </if>
  152. <if test="createTime != null">
  153. #{createTime,jdbcType=TIMESTAMP},
  154. </if>
  155. <if test="updateBy != null">
  156. #{updateBy,jdbcType=BIGINT},
  157. </if>
  158. <if test="updateTime != null">
  159. #{updateTime,jdbcType=TIMESTAMP},
  160. </if>
  161. <if test="delFlag != null">
  162. #{delFlag,jdbcType=INTEGER},
  163. </if>
  164. </trim>
  165. </insert>
  166. <select id="findByAddress" resultType="com.sckw.transport.model.KwtWaybillOrderAddress" >
  167. select
  168. id, w_order_id wOrderId, address_type addressType, `name`, `type`, contacts, phone, city_code cityCode, city_name cityName,
  169. detail_address detailAddress, lat, lng, fence, entry_type entryType, remark, `status`, create_by createBy, create_time createTime,
  170. update_by updateBy, update_time updateTime
  171. from kwt_waybill_order_address
  172. where del_flag = 0
  173. and w_order_id = #{wOrderId, jdbcType=BIGINT}
  174. and address_type = #{addressType, jdbcType=INTEGER}
  175. </select>
  176. <select id="findAddressCodeList" resultType="java.lang.Integer" >
  177. SELECT
  178. DISTINCT kwoa.city_code
  179. from kwt_waybill_order kwo
  180. left join kwt_waybill_order_address kwoa on kwoa.w_order_id = kwo.id
  181. where kwo.del_flag = 0 and kwoa.del_flag = 0
  182. and kwo.ent_id = #{entId, jdbcType=BIGINT}
  183. and kwoa.address_type = #{addressType, jdbcType=INTEGER}
  184. </select>
  185. </mapper>