<?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.KwtLogisticsOrderUnitMapper">
    <resultMap id="BaseResultMap" type="com.sckw.transport.model.KwtLogisticsOrderUnit">
        <id column="id" jdbcType="BIGINT" property="id" />
        <result column="l_order_id" jdbcType="BIGINT" property="lOrderId" />
        <result column="unit_type" jdbcType="INTEGER" property="unitType" />
        <result column="ent_id" jdbcType="BIGINT" property="entId" />
        <result column="top_ent_id" jdbcType="BIGINT" property="topEntId" />
        <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, l_order_id, unit_type,top_ent_id, ent_id, firm_name, contacts, phone, remark, `status`,
    create_by, create_time, update_by, update_time, del_flag
    </sql>

    <select id="findByUnit" resultType="com.sckw.transport.model.KwtLogisticsOrderUnit" >
        select
        id, l_order_id lOrderId, unit_type unitType, ent_id entId, firm_name firmName, contacts, phone
        remark, status, create_by createBy, create_time createTime, update_by updateBy, update_time updateTime
        from kwt_logistics_order_unit
        where del_flag = 0
        and l_order_id = #{lOrderId, jdbcType=BIGINT}
        and unit_type = #{unitType, jdbcType=INTEGER}
    </select>

</mapper>