<?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.OPRDao">
    <resultMap id="BaseResultMap" type="com.rongwei.bsentity.vo.OPRVo">
        <id column="opsID" jdbcType="VARCHAR" property="opsID"/>
        <result column="MACHINE_NO" property="machineNo" jdbcType="VARCHAR"/>
        <result column="SHIFT_NO" property="shiftNo" jdbcType="VARCHAR"/>
        <result column="DESCRIPTION" property="description" jdbcType="VARCHAR"/>
        <result column="RECORD_DATA" property="recordData" jdbcType="TIMESTAMP"/>
        <result column="START_TIME" property="startTime" jdbcType="TIMESTAMP"/>
        <result column="FINISH_TIME" property="finishTime" jdbcType="TIMESTAMP"/>
        <result column="OP_UUID" property="opUuid" jdbcType="VARCHAR"/>
        <result column="CREATE_USER" property="createUser" jdbcType="VARCHAR"/>
    </resultMap>
    <sql id="Base_Column_List">
        opsID,MACHINE_NO,SHIFT_NO,DESCRIPTION,RECORD_DATA,START_TIME,FINISH_TIME,OP_UUID,CREATE_USER
    </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}].[MACHINE_TIME_PER]
        where FINISH_TIME BETWEEN #{startDate, jdbcType=TIMESTAMP} AND #{endDate, jdbcType=TIMESTAMP}
        AND (TIME_CODE LIKE 'C%')
        AND SUB_TOTAL <![CDATA[ >= ]]> 150
    </select>
</mapper>
