<?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.WorkshopOutboundDetailDao">
  <resultMap id="BaseResultMap" type="com.sy.coinage.workshop.model.WorkshopOutboundDetail">
    <id column="id" jdbcType="INTEGER" property="id"/>
    <result column="out_id" jdbcType="INTEGER" property="outId"/>
    <result column="rfid" jdbcType="VARCHAR" property="rfid"/>
    <result column="serial_number" jdbcType="VARCHAR" property="serialNumber"/>
    <result column="tare_weight" jdbcType="DOUBLE" property="tareWeight"/>
    <result column="gross_weight" jdbcType="DOUBLE" property="grossWeight"/>
    <result column="net_weight" jdbcType="DOUBLE" property="netWeight"/>
    <result column="crown_between_str" jdbcType="VARCHAR" property="crownBetweenStr"/>
    <result column="crown_between" jdbcType="VARCHAR" property="crownBetween"/>
    <result column="remark" jdbcType="VARCHAR" property="remark"/>
    <result column="ware_id" jdbcType="INTEGER" property="wareId"/>
    <result column="ware_cn" jdbcType="VARCHAR" property="wareCn"/>
    <result column="area_id" jdbcType="INTEGER" property="areaId"/>
    <result column="area_cn" jdbcType="VARCHAR" property="areaCn"/>
    <result column="weightor_id" jdbcType="INTEGER" property="weightorId"/>
    <result column="weightor" jdbcType="VARCHAR" property="weightor"/>
    <result column="out_time" jdbcType="TIMESTAMP" property="outTime"/>
    <result column="in_time" jdbcType="TIMESTAMP" property="inTime"/>
  </resultMap>
  <sql id="Base_Column_List">
    id
    , out_id, rfid, serial_number, tare_weight, gross_weight, net_weight, crown_between_str, crown_between, remark, ware_id, ware_cn, area_id, area_cn, weightor_id, weightor, out_time, in_time
  </sql>
  <select id="queryVO" resultType="com.sy.coinage.workshop.req.vo.BaseInfoVO">
    SELECT
    rfid_base_info.id, rfid_base_info.rfid, rfid_base_info.create_time, rfid_base_info.securities_id,
    rfid_base_info.securities,
    rfid_base_info.serial_number,
    rfid_base_info.crown_prefix,rfid_base_info.crown_from,rfid_base_info.crown_to,rfid_base_info.crown_between
    from rfid_workshop_outbound_detail left join rfid_base_info on rfid_workshop_outbound_detail.rfid =
    rfid_base_info.rfid
    <if test="ew.emptyOfWhere == false">
      ${ew.customSqlSegment}
    </if>
  </select>
    <select id="myCount" resultType="java.lang.Long">
        select
        count(0)
        from rfid_workshop_outbound_detail left join rfid_workshop_outbound on rfid_workshop_outbound_detail.out_id =
        rfid_workshop_outbound.id
        <if test="ew.emptyOfWhere == false">
            ${ew.customSqlSegment}
        </if>
    </select>
    <select id="querylist" resultType="com.sy.coinage.workshop.model.WorkshopOutboundDetail">
      SELECT
      rfid_workshop_outbound.create_by, rfid_workshop_outbound.securities,
      rfid_workshop_outbound.dept,rfid_workshop_outbound.checker,
      rfid_workshop_outbound.order_type,rfid_workshop_outbound.receiver,rfid_workshop_outbound.receiver_check,
      rfid_workshop_outbound_detail.*, rfid_base_info.weight_date, rfid_base_info.weight_time
      from rfid_workshop_outbound_detail
      left join rfid_workshop_outbound on rfid_workshop_outbound_detail.out_id =
      rfid_workshop_outbound.id
      left join rfid_base_info on rfid_workshop_outbound_detail.rfid =
      rfid_base_info.rfid
      <if test="ew.emptyOfWhere == false">
            ${ew.customSqlSegment}
        </if>
    </select>

</mapper>

