| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.sckw.transport.dao.KwtWaybillOrderAddressMapper">
- <resultMap id="BaseResultMap" type="com.sckw.transport.model.KwtWaybillOrderAddress">
- <id column="id" jdbcType="BIGINT" property="id"/>
- <result column="w_order_id" jdbcType="BIGINT" property="wOrderId"/>
- <result column="address_type" jdbcType="VARCHAR" property="addressType"/>
- <result column="name" jdbcType="VARCHAR" property="name"/>
- <result column="type" jdbcType="BIGINT" property="type"/>
- <result column="contacts" jdbcType="VARCHAR" property="contacts"/>
- <result column="phone" jdbcType="VARCHAR" property="phone"/>
- <result column="city_code" jdbcType="INTEGER" property="cityCode"/>
- <result column="city_name" jdbcType="VARCHAR" property="cityName"/>
- <result column="detail_address" jdbcType="VARCHAR" property="detailAddress"/>
- <result column="lat" jdbcType="VARCHAR" property="lat"/>
- <result column="lng" jdbcType="VARCHAR" property="lng"/>
- <result column="fence" jdbcType="VARCHAR" property="fence"/>
- <result column="entry_type" jdbcType="INTEGER" property="entryType"/>
- <result column="remark" jdbcType="VARCHAR" property="remark"/>
- <result column="status" jdbcType="INTEGER" property="status"/>
- <result column="create_by" jdbcType="BIGINT" property="createBy"/>
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
- <result column="update_by" jdbcType="BIGINT" property="updateBy"/>
- <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
- <result column="del_flag" jdbcType="INTEGER" property="delFlag"/>
- </resultMap>
- <sql id="Base_Column_List">
- id
- , w_order_id, address_type, `name`, `type`, `contacts`,`phone`,`city_code`
- , city_name, detail_address, lat, lng, fence, entry_type, remark, status
- , create_by, create_time, update_by, update_time, del_flag
- </sql>
- <insert id="insert1" parameterType="com.sckw.transport.model.KwtWaybillOrderAddress">
- insert into kwt_waybill_order_address
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
- `id`,
- </if>
- <if test="wOrderId != null">
- `w_order_id`,
- </if>
- <if test="addressType != null">
- `address_type`,
- </if>
- <if test="name != null">
- `name`,
- </if>
- <if test="type != null">
- `type`,
- </if>
- <if test="contacts != null">
- `contacts`,
- </if>
- <if test="phone != null">
- `phone`,
- </if>
- <if test="cityCode != null">
- `city_code`,
- </if>
- <if test="cityName != null">
- `city_name`,
- </if>
- <if test="detailAddress != null">
- `detail_address`,
- </if>
- <if test="lat != null">
- `lat`,
- </if>
- <if test="lng != null">
- `lng`,
- </if>
- <if test="fence != null">
- `fence`,
- </if>
- <if test="entryType != null">
- `entry_type`,
- </if>
- <if test="remark != null">
- `remark`,
- </if>
- <if test="status != null">
- `status`,
- </if>
- <if test="createBy != null">
- `create_by`,
- </if>
- <if test="createTime != null">
- `create_time`,
- </if>
- <if test="updateBy != null">
- `update_by`,
- </if>
- <if test="updateTime != null">
- `update_time`,
- </if>
- <if test="delFlag != null">
- `del_flag`,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">
- #{id,jdbcType=BIGINT},
- </if>
- <if test="wOrderId != null">
- #{wOrderId,jdbcType=BIGINT},
- </if>
- <if test="addressType != null">
- #{addressType,jdbcType=INTEGER},
- </if>
- <if test="name != null">
- #{name,jdbcType=VARCHAR},
- </if>
- <if test="type != null">
- #{type,jdbcType=BIGINT},
- </if>
- <if test="contacts != null">
- #{contacts,jdbcType=VARCHAR},
- </if>
- <if test="phone != null">
- #{phone,jdbcType=VARCHAR},
- </if>
- <if test="cityCode != null">
- #{cityCode,jdbcType=INTEGER},
- </if>
- <if test="cityName != null">
- #{cityName,jdbcType=VARCHAR},
- </if>
- <if test="detailAddress != null">
- #{detailAddress,jdbcType=VARCHAR},
- </if>
- <if test="lat != null">
- #{lat,jdbcType=VARCHAR},
- </if>
- <if test="lng != null">
- #{lng,jdbcType=VARCHAR},
- </if>
- <if test="fence != null">
- #{fence,jdbcType=VARCHAR},
- </if>
- <if test="entryType != null">
- #{entryType,jdbcType=INTEGER},
- </if>
- <if test="remark != null">
- #{remark,jdbcType=VARCHAR},
- </if>
- <if test="status != null">
- #{status,jdbcType=INTEGER},
- </if>
- <if test="createBy != null">
- #{createBy,jdbcType=BIGINT},
- </if>
- <if test="createTime != null">
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="updateBy != null">
- #{updateBy,jdbcType=BIGINT},
- </if>
- <if test="updateTime != null">
- #{updateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="delFlag != null">
- #{delFlag,jdbcType=INTEGER},
- </if>
- </trim>
- </insert>
- <select id="findByAddress" resultType="com.sckw.transport.model.KwtWaybillOrderAddress" >
- select
- id, w_order_id wOrderId, address_type addressType, `name`, `type`, contacts, phone, city_code cityCode, city_name cityName,
- detail_address detailAddress, lat, lng, fence, entry_type entryType, remark, `status`, create_by createBy, create_time createTime,
- update_by updateBy, update_time updateTime
- from kwt_waybill_order_address
- where del_flag = 0
- and w_order_id = #{wOrderId, jdbcType=BIGINT}
- and address_type = #{addressType, jdbcType=INTEGER}
- </select>
- <select id="findAddressCodeList" resultType="java.lang.Integer" >
- SELECT
- DISTINCT kwoa.city_code
- from kwt_waybill_order kwo
- left join kwt_waybill_order_address kwoa on kwoa.w_order_id = kwo.id
- where kwo.del_flag = 0 and kwoa.del_flag = 0
- and kwo.ent_id = #{entId, jdbcType=BIGINT}
- and kwoa.address_type = #{addressType, jdbcType=INTEGER}
- </select>
- </mapper>
|