TaskDetailMapper.xml 6.34 KB
<?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.huaheng.pc.task.taskDetail.mapper.TaskDetailMapper">
    <resultMap id="BaseResultMap" type="com.huaheng.pc.task.taskDetail.domain.TaskDetail">
        <!--@mbg.generated-->
        <id column="id" jdbcType="INTEGER" property="id"/>
        <result column="taskId" jdbcType="INTEGER" property="taskId"/>
        <result column="taskType" jdbcType="INTEGER" property="taskType"/>
        <result column="internalTaskType" jdbcType="INTEGER" property="internalTaskType"/>
        <result column="warehouseCode" jdbcType="VARCHAR" property="warehouseCode"/>
        <result column="companyCode" jdbcType="VARCHAR" property="companyCode"/>
        <result column="materialCode" jdbcType="VARCHAR" property="materialCode"/>
        <result column="materialName" jdbcType="VARCHAR" property="materialName"/>
        <result column="materialSpec" jdbcType="VARCHAR" property="materialSpec"/>
        <result column="materialUnit" jdbcType="VARCHAR" property="materialUnit"/>
        <result column="qty" jdbcType="INTEGER" property="qty"/>
        <result column="fromLocation" jdbcType="VARCHAR" property="fromLocation"/>
        <result column="toLocation" jdbcType="VARCHAR" property="toLocation"/>
        <result column="containerCode" jdbcType="VARCHAR" property="containerCode"/>
        <result column="fromZone" jdbcType="VARCHAR" property="fromZone"/>
        <result column="toZone" jdbcType="VARCHAR" property="toZone"/>
        <result column="attributeId" jdbcType="INTEGER" property="attributeId"/>
        <result column="referenceCode" jdbcType="VARCHAR" property="referenceCode"/>
        <result column="referenceLineId" jdbcType="INTEGER" property="referenceLineId"/>
        <result column="assignedUser" jdbcType="VARCHAR" property="assignedUser"/>
        <result column="attribute1" jdbcType="VARCHAR" property="attribute1"/>
        <result column="attribute2" jdbcType="VARCHAR" property="attribute2"/>
        <result column="attribute3" jdbcType="VARCHAR" property="attribute3"/>
        <result column="batch" jdbcType="VARCHAR" property="batch"/>
        <result column="lot" jdbcType="VARCHAR" property="lot"/>
        <result column="projectNo" jdbcType="VARCHAR" property="projectNo"/>
        <result column="qcCheck" jdbcType="VARCHAR" property="qcCheck"/>
        <result column="manufactureDate" jdbcType="DATE" property="manufactureDate"/>
        <result column="expirationDate" jdbcType="DATE" property="expirationDate"/>
        <result column="agingDate" jdbcType="DATE" property="agingDate"/>
        <result column="inventorySts" jdbcType="VARCHAR" property="inventorySts"/>
        <result column="waveId" jdbcType="INTEGER" property="waveId"/>
        <result column="fromInventoryId" jdbcType="INTEGER" property="fromInventoryId"/>
        <result column="toInventoryId" jdbcType="INTEGER" property="toInventoryId"/>
        <result column="confirmedBy" jdbcType="VARCHAR" property="confirmedBy"/>
        <result column="groupNum" jdbcType="INTEGER" property="groupNum"/>
        <result column="groupIndex" jdbcType="INTEGER" property="groupIndex"/>
        <result column="created" jdbcType="TIMESTAMP" property="created"/>
        <result column="createdBy" jdbcType="VARCHAR" property="createdBy"/>
        <result column="lastUpdated" jdbcType="TIMESTAMP" property="lastUpdated"/>
        <result column="lastUpdatedBy" jdbcType="VARCHAR" property="lastUpdatedBy"/>
        <result column="version" jdbcType="INTEGER" property="version"/>
        <result column="userDef1" jdbcType="VARCHAR" property="userDef1"/>
        <result column="userDef2" jdbcType="VARCHAR" property="userDef2"/>
        <result column="userDef3" jdbcType="VARCHAR" property="userDef3"/>
        <result column="processStamp" jdbcType="VARCHAR" property="processStamp"/>
        <result column="containQty" jdbcType="INTEGER" property="containQty"/>
    </resultMap>
    <sql id="Base_Column_List">
        <!--@mbg.generated-->
        id, taskId, taskType, internalTaskType, warehouseCode, companyCode, materialCode,
        materialName, materialSpec, materialUnit, qty, fromLocation, toLocation, containerCode,
        fromZone, toZone, attributeId, referenceCode, referenceId, referenceLineId,
        assignedUser, attribute1, attribute2, attribute3, attribute4, batch, lot, projectNo,
        qcCheck, manufactureDate, expirationDate, agingDate, inventorySts, waveId, fromInventoryId,
        toInventoryId, confirmedBy, groupNum, groupIndex, created, createdBy, lastUpdated,
        lastUpdatedBy, version, userDef1, userDef2, userDef3, processStamp, containQty
    </sql>

    <select id="getTvReceiptView" resultType="com.huaheng.api.tv.domain.TopBean" parameterType="java.lang.String">
        SELECT
        a.dictLabel hours,
        ROUND(
        IFNULL( b.qty, 0 )) qty
        FROM
        ( SELECT dictLabel, dictValue FROM sys_dict_data WHERE dictType = 'time_range' ) a
        LEFT JOIN (
        SELECT
        ANY_VALUE(qty) qty,
        ANY_VALUE( date_format( created, '%H' )) hours
        FROM
        task_detail
        WHERE
        created >= CURRENT_DATE()
        and `status`>=100
        <if test="type== '1'.toString()">
            and (taskType='100' or taskType='200')
        </if>
        <if test="type== '2'.toString()">
            and (taskType='300' or taskType='400')
        </if>
        GROUP BY
        date_format( created, '%H' )) b ON a.dictValue = b.hours
        WHERE
        1 = 1
        ORDER BY
        ( a.dictValue + 0 ) ASC
    </select>


    <select id="getTvNotReceiptList" resultType="com.huaheng.api.tv.domain.UpBean" parameterType="java.lang.String">
        SELECT
        <if test="type== '1'.toString()">
            receiptCode,
        </if>
        <if test="type== '2'.toString()">
            shipmentCode receiptCode,
        </if>
        materialCode,
        materialName,
        isUrgent,
        noticeNo,
        <if test="type== '1'.toString()">
            receiptBarcode,
        </if>
        qty-taskQty qty
        FROM
        <if test="type== '1'.toString()">
            receipt_detail
        </if>
        <if test="type== '2'.toString()">
            shipment_detail
        </if>

        WHERE
        created >= CURRENT_DATE()
        and qty-taskQty>0

        LIMIT 30
    </select>
</mapper>