<?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="cn.stylefeng.guns.modular.om.productionOrdeInfo.mapper.ProductionOrdeInfoMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.om.productionOrdeInfo.entity.ProductionOrdeInfo">
|
<id column="id" property="id" />
|
<result column="sales_order_no" property="salesOrderNo" />
|
<result column="work_order_no" property="workOrderNo" />
|
<result column="production_line" property="productionLine" />
|
<result column="drawing_no" property="drawingNo" />
|
<result column="material_code" property="materialCode" />
|
<result column="material_name" property="materialName" />
|
<result column="plan_qty" property="planQty" />
|
<result column="actual_qty" property="actualQty" />
|
<result column="scrap_qty" property="scrapQty" />
|
<result column="repair_qty" property="repairQty" />
|
<result column="actual_online_qty" property="actualOnlineQty" />
|
<result column="online_completion_mark" property="onlineCompletionMark" />
|
<result column="demand_date" property="demandDate" />
|
<result column="plan_start_time" property="planStartTime" />
|
<result column="plan_end_time" property="planEndTime" />
|
<result column="actual_start_time" property="actualStartTime" />
|
<result column="actual_end_time" property="actualEndTime" />
|
<result column="serial_number" property="serialNumber" />
|
<result column="order_status" property="orderStatus" />
|
<result column="spare_field_1" property="spareField1" />
|
<result column="spare_field_2" property="spareField2" />
|
<result column="spare_field_3" property="spareField3" />
|
<result column="spare_field_4" property="spareField4" />
|
<result column="create_time" property="createTime" />
|
<result column="update_time" property="updateTime" />
|
<result column="create_user" property="createUser" />
|
<result column="update_user" property="updateUser" />
|
<result column="remarks" property="remarks" />
|
<result column="stream_number" property="streamNumber" />
|
<result column="custom" property="custom" />
|
<result column="market_area_code" property="marketAreaCode" />
|
<result column="software_version_code" property="softwareVersionCode" />
|
<result column="product_company_code" property="productCompanyCode" />
|
|
|
</resultMap>
|
|
<!-- 通用查询结果列 -->
|
<sql id="Base_Column_List">
|
custom AS "custom", stream_number AS "streamNumber", id AS "id", sales_order_no AS "salesOrderNo", work_order_no AS "workOrderNo", production_line AS "productionLine", drawing_no AS "drawingNo", material_code AS "materialCode", material_name AS "materialName", plan_qty AS "planQty", actual_qty AS "actualQty", scrap_qty AS "scrapQty", repair_qty AS "repairQty", actual_online_qty AS "actualOnlineQty", online_completion_mark AS "onlineCompletionMark", demand_date AS "demandDate", plan_start_time AS "planStartTime", plan_end_time AS "planEndTime", actual_start_time AS "actualStartTime", actual_end_time AS "actualEndTime", serial_number AS "serialNumber", order_status AS "orderStatus", spare_field_1 AS "spareField1", spare_field_2 AS "spareField2", spare_field_3 AS "spareField3", spare_field_4 AS "spareField4", create_time AS "createTime", update_time AS "updateTime",
|
create_user AS "createUser", update_user AS "updateUser", remarks AS "remarks",
|
market_area_code AS "marketAreaCode",software_version_code AS "softwareVersionCode",product_company_code AS "productCompanyCode"
|
</sql>
|
|
|
<select id="customList" resultType="cn.stylefeng.guns.modular.om.productionOrdeInfo.model.result.ProductionOrdeInfoResult" parameterType="cn.stylefeng.guns.modular.om.productionOrdeInfo.model.params.ProductionOrdeInfoParam">
|
select
|
<include refid="Base_Column_List"/>
|
from om_production_orde_info where 1 = 1
|
<if test="paramCondition.workOrderNo != null and paramCondition.workOrderNo != ''">
|
and work_order_no like CONCAT('%',#{paramCondition.workOrderNo},'%')
|
</if>
|
<if test="paramCondition.materialCode != null and paramCondition.materialCode != ''">
|
and material_code like CONCAT('%',#{paramCondition.materialCode},'%')
|
</if>
|
<if test="paramCondition.orderStatus != null and paramCondition.orderStatus != ''">
|
and order_status = #{paramCondition.orderStatus}
|
</if>
|
<if test="paramCondition.productionLine != null and paramCondition.productionLine != ''">
|
and production_line like CONCAT('%',#{paramCondition.productionLine},'%')
|
</if>
|
order by serial_number desc
|
</select>
|
|
<select id="customMapList" resultType="map" parameterType="cn.stylefeng.guns.modular.om.productionOrdeInfo.model.params.ProductionOrdeInfoParam">
|
select
|
<include refid="Base_Column_List"/>
|
from om_production_orde_info where 1 = 1
|
</select>
|
|
<select id="customPageList" resultType="cn.stylefeng.guns.modular.om.productionOrdeInfo.model.result.ProductionOrdeInfoResult" parameterType="cn.stylefeng.guns.modular.om.productionOrdeInfo.model.params.ProductionOrdeInfoParam">
|
select
|
<include refid="Base_Column_List"/>
|
from om_production_orde_info where 1 = 1
|
<if test="paramCondition.workOrderNo != null and paramCondition.workOrderNo != ''">
|
and work_order_no like CONCAT('%',#{paramCondition.workOrderNo},'%')
|
</if>
|
<if test="paramCondition.materialCode != null and paramCondition.materialCode != ''">
|
and material_code like CONCAT('%',#{paramCondition.materialCode},'%')
|
</if>
|
<if test="paramCondition.orderStatus != null and paramCondition.orderStatus != ''">
|
and order_status = #{paramCondition.orderStatus}
|
</if>
|
<if test="paramCondition.productionLine != null and paramCondition.productionLine != ''">
|
and production_line like CONCAT('%',#{paramCondition.productionLine},'%')
|
</if>
|
order by serial_number desc
|
</select>
|
|
<select id="customPageMapList" resultType="map" parameterType="cn.stylefeng.guns.modular.om.productionOrdeInfo.model.params.ProductionOrdeInfoParam">
|
select
|
<include refid="Base_Column_List"/>
|
from om_production_orde_info where 1 = 1
|
</select>
|
|
<!-- <select id="lineFinishQty" resultType="cn.stylefeng.guns.modular.om.productionOrdeInfo.model.result.ProductionOrdeInfoResult">-->
|
<!-- SELECT production_line as name,sum(actual_qty)as value FROM om_production_orde_info GROUP BY production_line-->
|
<!-- </select>-->
|
<select id="lineFinishQty" resultType="cn.stylefeng.guns.modular.om.productionOrdeInfo.model.result.ProductionOrdeInfoResult">
|
<![CDATA[
|
SELECT TOP 7 actual_start_time as actualStartTime,actual_qty as actualQty FROM om_production_orde_info WHERE actual_start_time is not null AND actual_qty IS NOT NULL ORDER BY actual_start_time DESC
|
]]>
|
</select>
|
|
<select id="getOrderWeek" resultType="Map">
|
SELECT SUM(plan_qty) AS planQty,COALESCE( SUM(actual_qty) ,0) AS actualQty FROM om_production_orde_info WHERE DateDiff(month,create_time,getdate())=0
|
</select>
|
|
<select id="getPlanQtyByDate" parameterType="java.lang.String" resultType="java.lang.Integer">
|
select SUM(plan_qty) as planQty FROM om_production_orde_info WHERE CONVERT ( VARCHAR ( 100 ), create_time, 23 ) = #{paramCondition}
|
</select>
|
|
<select id="getActualQtyByDate" parameterType="string" resultType="integer">
|
select SUM(actual_qty) as actualQty FROM om_production_orde_info WHERE CONVERT ( VARCHAR ( 100 ), create_time, 23 ) = #{testdate}
|
</select>
|
|
<!-- <select id="getListMonth" resultType="cn.stylefeng.guns.modular.om.productionOrdeInfo.model.result.ProductionOrdeInfoResult">-->
|
<!-- <![CDATA[-->
|
<!-- select * from om_production_orde_info where datediff(dd, plan_start_time,getdate())<=6-->
|
<!-- ]]>-->
|
<!-- </select>-->
|
|
<select id="getListMonth" resultType="cn.stylefeng.guns.modular.om.productionOrdeInfo.model.result.ProductionOrdeInfoResult">
|
<![CDATA[
|
SELECT TOP 10 * FROM om_production_orde_info ORDER BY actual_start_time DESC
|
]]>
|
</select>
|
|
<select id="getColumnarDate" resultType="cn.stylefeng.guns.modular.om.productionOrdeInfo.model.result.ProductionOrdeInfoResult">
|
SELECT DISTINCT
|
FORMAT ( actual_start_time, 'yyyy-MM-dd' ) AS actual_start_time
|
FROM
|
om_production_orde_info
|
ORDER BY
|
actual_start_time DESC OFFSET 0 ROWS FETCH NEXT 7 ROWS ONLY;
|
</select>
|
|
<select id="orderDescListFive" resultType="cn.stylefeng.guns.modular.om.productionOrdeInfo.model.result.ProductionOrdeInfoResult">
|
SELECT TOP 5 * FROM om_production_orde_info ORDER BY actual_start_time DESC
|
</select>
|
|
</mapper>
|