|
|
@@ -1,199 +1,212 @@
|
|
|
<?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.KwtLogisticsOrderUnitDao">
|
|
|
- <resultMap id="BaseResultMap" type="com.sckw.transport.model.KwtLogisticsOrderUnit">
|
|
|
- <id column="id" jdbcType="BIGINT" property="id" />
|
|
|
- <result column="order_id" jdbcType="BIGINT" property="orderId" />
|
|
|
- <result column="unit_type" jdbcType="INTEGER" property="unitType" />
|
|
|
- <result column="ent_id" jdbcType="BIGINT" property="entId" />
|
|
|
- <result column="firm_name" jdbcType="VARCHAR" property="firmName" />
|
|
|
- <result column="contacts" jdbcType="VARCHAR" property="contacts" />
|
|
|
- <result column="phone" jdbcType="VARCHAR" property="phone" />
|
|
|
- <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, order_id, unit_type, ent_id, firm_name, contacts, phone, remark, `status`,
|
|
|
+<mapper namespace="com.sckw.transport.dao.KwtLogisticsOrderUnitMapper">
|
|
|
+ <resultMap id="BaseResultMap" type="com.sckw.transport.model.KwtLogisticsOrderUnit">
|
|
|
+ <id column="id" jdbcType="BIGINT" property="id"/>
|
|
|
+ <result column="order_id" jdbcType="BIGINT" property="orderId"/>
|
|
|
+ <result column="unit_type" jdbcType="INTEGER" property="unitType"/>
|
|
|
+ <result column="ent_id" jdbcType="BIGINT" property="entId"/>
|
|
|
+ <result column="firm_name" jdbcType="VARCHAR" property="firmName"/>
|
|
|
+ <result column="contacts" jdbcType="VARCHAR" property="contacts"/>
|
|
|
+ <result column="phone" jdbcType="VARCHAR" property="phone"/>
|
|
|
+ <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
|
|
|
+ , order_id, unit_type, ent_id, firm_name, contacts, phone, remark, `status`,
|
|
|
create_by, create_time, update_by, update_time, del_flag
|
|
|
- </sql>
|
|
|
- <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
|
|
- select
|
|
|
- <include refid="Base_Column_List" />
|
|
|
- from kwt_logistics_order_unit
|
|
|
- where id = #{id,jdbcType=BIGINT}
|
|
|
- </select>
|
|
|
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
|
|
- delete from kwt_logistics_order_unit
|
|
|
- where id = #{id,jdbcType=BIGINT}
|
|
|
- </delete>
|
|
|
- <insert id="insert" parameterType="com.sckw.transport.model.KwtLogisticsOrderUnit">
|
|
|
- insert into kwt_logistics_order_unit (id, order_id, unit_type,
|
|
|
- ent_id, firm_name, contacts,
|
|
|
- phone, remark, `status`,
|
|
|
- create_by, create_time, update_by,
|
|
|
- update_time, del_flag)
|
|
|
- values (#{id,jdbcType=BIGINT}, #{orderId,jdbcType=BIGINT}, #{unitType,jdbcType=INTEGER},
|
|
|
- #{entId,jdbcType=BIGINT}, #{firmName,jdbcType=VARCHAR}, #{contacts,jdbcType=VARCHAR},
|
|
|
- #{phone,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
|
|
|
- #{createBy,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=BIGINT},
|
|
|
- #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=INTEGER})
|
|
|
- </insert>
|
|
|
- <insert id="insertSelective" parameterType="com.sckw.transport.model.KwtLogisticsOrderUnit">
|
|
|
- insert into kwt_logistics_order_unit
|
|
|
- <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
- <if test="id != null">
|
|
|
- id,
|
|
|
- </if>
|
|
|
- <if test="orderId != null">
|
|
|
- order_id,
|
|
|
- </if>
|
|
|
- <if test="unitType != null">
|
|
|
- unit_type,
|
|
|
- </if>
|
|
|
- <if test="entId != null">
|
|
|
- ent_id,
|
|
|
- </if>
|
|
|
- <if test="firmName != null">
|
|
|
- firm_name,
|
|
|
- </if>
|
|
|
- <if test="contacts != null">
|
|
|
- contacts,
|
|
|
- </if>
|
|
|
- <if test="phone != null">
|
|
|
- phone,
|
|
|
- </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="orderId != null">
|
|
|
- #{orderId,jdbcType=BIGINT},
|
|
|
- </if>
|
|
|
- <if test="unitType != null">
|
|
|
- #{unitType,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="entId != null">
|
|
|
- #{entId,jdbcType=BIGINT},
|
|
|
- </if>
|
|
|
- <if test="firmName != null">
|
|
|
- #{firmName,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="contacts != null">
|
|
|
- #{contacts,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="phone != null">
|
|
|
- #{phone,jdbcType=VARCHAR},
|
|
|
- </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>
|
|
|
- <update id="updateByPrimaryKeySelective" parameterType="com.sckw.transport.model.KwtLogisticsOrderUnit">
|
|
|
- update kwt_logistics_order_unit
|
|
|
- <set>
|
|
|
- <if test="orderId != null">
|
|
|
- order_id = #{orderId,jdbcType=BIGINT},
|
|
|
- </if>
|
|
|
- <if test="unitType != null">
|
|
|
- unit_type = #{unitType,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="entId != null">
|
|
|
- ent_id = #{entId,jdbcType=BIGINT},
|
|
|
- </if>
|
|
|
- <if test="firmName != null">
|
|
|
- firm_name = #{firmName,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="contacts != null">
|
|
|
- contacts = #{contacts,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="phone != null">
|
|
|
- phone = #{phone,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="remark != null">
|
|
|
- remark = #{remark,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="status != null">
|
|
|
- `status` = #{status,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="createBy != null">
|
|
|
- create_by = #{createBy,jdbcType=BIGINT},
|
|
|
- </if>
|
|
|
- <if test="createTime != null">
|
|
|
- create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- <if test="updateBy != null">
|
|
|
- update_by = #{updateBy,jdbcType=BIGINT},
|
|
|
- </if>
|
|
|
- <if test="updateTime != null">
|
|
|
- update_time = #{updateTime,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- <if test="delFlag != null">
|
|
|
- del_flag = #{delFlag,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- </set>
|
|
|
- where id = #{id,jdbcType=BIGINT}
|
|
|
- </update>
|
|
|
- <update id="updateByPrimaryKey" parameterType="com.sckw.transport.model.KwtLogisticsOrderUnit">
|
|
|
- update kwt_logistics_order_unit
|
|
|
- set order_id = #{orderId,jdbcType=BIGINT},
|
|
|
- unit_type = #{unitType,jdbcType=INTEGER},
|
|
|
- ent_id = #{entId,jdbcType=BIGINT},
|
|
|
- firm_name = #{firmName,jdbcType=VARCHAR},
|
|
|
- contacts = #{contacts,jdbcType=VARCHAR},
|
|
|
- phone = #{phone,jdbcType=VARCHAR},
|
|
|
- remark = #{remark,jdbcType=VARCHAR},
|
|
|
- `status` = #{status,jdbcType=INTEGER},
|
|
|
- create_by = #{createBy,jdbcType=BIGINT},
|
|
|
- create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
- update_by = #{updateBy,jdbcType=BIGINT},
|
|
|
- update_time = #{updateTime,jdbcType=TIMESTAMP},
|
|
|
- del_flag = #{delFlag,jdbcType=INTEGER}
|
|
|
- where id = #{id,jdbcType=BIGINT}
|
|
|
- </update>
|
|
|
+ </sql>
|
|
|
+ <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ from kwt_logistics_order_unit
|
|
|
+ where id = #{id,jdbcType=BIGINT}
|
|
|
+ </select>
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
|
|
+ delete
|
|
|
+ from kwt_logistics_order_unit
|
|
|
+ where id = #{id,jdbcType=BIGINT}
|
|
|
+ </delete>
|
|
|
+ <insert id="insert" parameterType="com.sckw.transport.model.KwtLogisticsOrderUnit">
|
|
|
+ insert into kwt_logistics_order_unit (id, order_id, unit_type,
|
|
|
+ ent_id, firm_name, contacts,
|
|
|
+ phone, remark, `status`,
|
|
|
+ create_by, create_time, update_by,
|
|
|
+ update_time, del_flag)
|
|
|
+ values (#{id,jdbcType=BIGINT}, #{orderId,jdbcType=BIGINT}, #{unitType,jdbcType=INTEGER},
|
|
|
+ #{entId,jdbcType=BIGINT}, #{firmName,jdbcType=VARCHAR}, #{contacts,jdbcType=VARCHAR},
|
|
|
+ #{phone,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
|
|
|
+ #{createBy,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=BIGINT},
|
|
|
+ #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=INTEGER})
|
|
|
+ </insert>
|
|
|
+ <insert id="insertSelective" parameterType="com.sckw.transport.model.KwtLogisticsOrderUnit">
|
|
|
+ insert into kwt_logistics_order_unit
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">
|
|
|
+ id,
|
|
|
+ </if>
|
|
|
+ <if test="orderId != null">
|
|
|
+ order_id,
|
|
|
+ </if>
|
|
|
+ <if test="unitType != null">
|
|
|
+ unit_type,
|
|
|
+ </if>
|
|
|
+ <if test="entId != null">
|
|
|
+ ent_id,
|
|
|
+ </if>
|
|
|
+ <if test="firmName != null">
|
|
|
+ firm_name,
|
|
|
+ </if>
|
|
|
+ <if test="contacts != null">
|
|
|
+ contacts,
|
|
|
+ </if>
|
|
|
+ <if test="phone != null">
|
|
|
+ phone,
|
|
|
+ </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="orderId != null">
|
|
|
+ #{orderId,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="unitType != null">
|
|
|
+ #{unitType,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="entId != null">
|
|
|
+ #{entId,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="firmName != null">
|
|
|
+ #{firmName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="contacts != null">
|
|
|
+ #{contacts,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="phone != null">
|
|
|
+ #{phone,jdbcType=VARCHAR},
|
|
|
+ </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>
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.sckw.transport.model.KwtLogisticsOrderUnit">
|
|
|
+ update kwt_logistics_order_unit
|
|
|
+ <set>
|
|
|
+ <if test="orderId != null">
|
|
|
+ order_id = #{orderId,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="unitType != null">
|
|
|
+ unit_type = #{unitType,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="entId != null">
|
|
|
+ ent_id = #{entId,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="firmName != null">
|
|
|
+ firm_name = #{firmName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="contacts != null">
|
|
|
+ contacts = #{contacts,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="phone != null">
|
|
|
+ phone = #{phone,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="remark != null">
|
|
|
+ remark = #{remark,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ `status` = #{status,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null">
|
|
|
+ create_by = #{createBy,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null">
|
|
|
+ update_by = #{updateBy,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ update_time = #{updateTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="delFlag != null">
|
|
|
+ del_flag = #{delFlag,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id = #{id,jdbcType=BIGINT}
|
|
|
+ </update>
|
|
|
+ <update id="updateByPrimaryKey" parameterType="com.sckw.transport.model.KwtLogisticsOrderUnit">
|
|
|
+ update kwt_logistics_order_unit
|
|
|
+ set order_id = #{orderId,jdbcType=BIGINT},
|
|
|
+ unit_type = #{unitType,jdbcType=INTEGER},
|
|
|
+ ent_id = #{entId,jdbcType=BIGINT},
|
|
|
+ firm_name = #{firmName,jdbcType=VARCHAR},
|
|
|
+ contacts = #{contacts,jdbcType=VARCHAR},
|
|
|
+ phone = #{phone,jdbcType=VARCHAR},
|
|
|
+ remark = #{remark,jdbcType=VARCHAR},
|
|
|
+ `status` = #{status,jdbcType=INTEGER},
|
|
|
+ create_by = #{createBy,jdbcType=BIGINT},
|
|
|
+ create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ update_by = #{updateBy,jdbcType=BIGINT},
|
|
|
+ update_time = #{updateTime,jdbcType=TIMESTAMP},
|
|
|
+ del_flag = #{delFlag,jdbcType=INTEGER}
|
|
|
+ where id = #{id,jdbcType=BIGINT}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <select id="selectCompanyBylOrderId" resultMap="BaseResultMap">
|
|
|
+ SELECT lu.*
|
|
|
+ FROM kwt_logistics_order lo
|
|
|
+ LEFT JOIN kwt_logistics_order_unit lu ON lo.id = lu.l_order_id
|
|
|
+ AND lu.unit_type = #{unitType}
|
|
|
+ AND lo.l_order_no in
|
|
|
+ <foreach collection="list" separator="," open="(" close=")" item="id">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </select>
|
|
|
</mapper>
|