<?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.rongwei.bscommon.sys.dao.sqlserver.QUADao">
    <resultMap id="BaseResultMap" type="com.rongwei.bsentity.vo.QUAVo">
        <id column="UU_ID" jdbcType="VARCHAR" property="uuid"/>
        <result column="NC_WEIGHT" jdbcType="DECIMAL" property="ncWeight"/>
        <result column="NC_DATE" jdbcType="TIMESTAMP" property="ncDate"/>
        <result column="CREATE_USER" jdbcType="VARCHAR" property="createUser"/>
        <result column="NC_REASON_MACHINE" jdbcType="VARCHAR" property="ncReasonMachine"/>
        <result column="NC_REASON_DESC" jdbcType="VARCHAR" property="ncReasonDesc"/>
        <result column="NC_DESC" jdbcType="VARCHAR" property="ncDesc"/>
        <result column="COIL_NO" jdbcType="VARCHAR" property="coilNo"/>
    </resultMap>
    <sql id="Base_Column_List">
        UU_ID, NC_SCRAP_WEIGHT as NC_WEIGHT , NC_DATE, CREATE_USER, NC_REASON_MACHINE,
        NC_REASON_DESC,NC_DESC,COIL_NO
    </sql>
    <select id="selectInfoByDate" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List">
            <property name="alias" value="t."/>
            <property name="prefix" value=""/>
        </include>
        from [${DBLink}].[${dataBaseName}].[${dataBaseModel}].[OPERATION_REPORT_NC]
        where NC_DATE BETWEEN #{startDate, jdbcType=TIMESTAMP} AND #{endDate, jdbcType=TIMESTAMP}
        AND NC_SCRAP_WEIGHT <![CDATA[ >= ]]> #{scrapStandard,jdbcType=DECIMAL}
        AND (
        NOT (
        NC_REASON_CODE IN(
        '010',
        '037',
        '087',
        '088',
        '094',
        '118',
        '123',
        '124',
        '125',
        '126',
        '128',
        '129',
        '130',
        '131',
        '132',
        '133',
        '139',
        '140',
        '141',
        '142',
        '146',
        '148'
        )))
    </select>
</mapper>
