<?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.sy.coinage.workshop.dao.DeliveryDetailDao">
  <resultMap id="BaseResultMap" type="com.sy.coinage.workshop.model.DeliveryDetail">
      <id column="id" jdbcType="INTEGER" property="id"/>
      <result column="delivery_id" jdbcType="INTEGER" property="deliveryId"/>
      <result column="rfid" jdbcType="VARCHAR" property="rfid"/>
      <result column="serial_number" jdbcType="VARCHAR" property="serialNumber"/>
      <result column="crown_between_str" jdbcType="VARCHAR" property="crownBetweenStr"/>
      <result column="crown_between" jdbcType="VARCHAR" property="crownBetween"/>
      <result column="tare_weight" jdbcType="DOUBLE" property="tareWeight"/>
      <result column="gross_weight" jdbcType="DOUBLE" property="grossWeight"/>
      <result column="weightor_id" jdbcType="INTEGER" property="weightorId"/>
      <result column="weightor" jdbcType="VARCHAR" property="weightor"/>
      <result column="print_time" jdbcType="TIMESTAMP" property="printTime"/>
      <result column="delivery_time" jdbcType="TIMESTAMP" property="deliveryTime"/>
      <result column="del_flag" jdbcType="INTEGER" property="delFlag"/>
      <result column="reg_flag" jdbcType="INTEGER" property="regFlag"/>
      <result column="is_whole" jdbcType="INTEGER" property="isWhole"/>
      <result column="qty" jdbcType="INTEGER" property="qty"/>
  </resultMap>
    <sql id="Base_Column_List">
        id
        , delivery_id, rfid, serial_number, crown_between_str, crown_between, tare_weight, gross_weight, weightor_id, weightor, print_time, delivery_time, del_flag, reg_flag, is_whole, qty
    </sql>
    <select id="querylist" resultType="com.sy.coinage.workshop.model.DeliveryDetail">
        SELECT
        rfid_delivery_detail.*,
        rfid_delivery.create_by,
        rfid_delivery.checker,
        rfid_delivery.securities,
        rfid_delivery.operator,
        rfid_base_info.dept,
        rfid_base_info.weightor
        FROM
        rfid_delivery_detail
        LEFT JOIN
        rfid_delivery ON rfid_delivery.id = rfid_delivery_detail.delivery_id
        left join rfid_base_info on rfid_delivery_detail.rfid =
        rfid_base_info.rfid
        <if test="ew.emptyOfWhere == false">
            ${ew.customSqlSegment}
        </if>
    </select>

</mapper>

