提交 | 用户 | 时间
|
71e81e
|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
懒 |
2 |
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|
3 |
<mapper namespace="cn.stylefeng.guns.modular.om.productionOrdeInfo.mapper.ProductionOrdeInfoMapper"> |
|
4 |
|
|
5 |
<!-- 通用查询映射结果 --> |
|
6 |
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.om.productionOrdeInfo.entity.ProductionOrdeInfo"> |
|
7 |
<id column="id" property="id" /> |
|
8 |
<result column="sales_order_no" property="salesOrderNo" /> |
|
9 |
<result column="work_order_no" property="workOrderNo" /> |
|
10 |
<result column="production_line" property="productionLine" /> |
|
11 |
<result column="drawing_no" property="drawingNo" /> |
|
12 |
<result column="material_code" property="materialCode" /> |
|
13 |
<result column="material_name" property="materialName" /> |
|
14 |
<result column="plan_qty" property="planQty" /> |
|
15 |
<result column="actual_qty" property="actualQty" /> |
|
16 |
<result column="scrap_qty" property="scrapQty" /> |
|
17 |
<result column="repair_qty" property="repairQty" /> |
|
18 |
<result column="actual_online_qty" property="actualOnlineQty" /> |
|
19 |
<result column="online_completion_mark" property="onlineCompletionMark" /> |
|
20 |
<result column="demand_date" property="demandDate" /> |
|
21 |
<result column="plan_start_time" property="planStartTime" /> |
|
22 |
<result column="plan_end_time" property="planEndTime" /> |
|
23 |
<result column="actual_start_time" property="actualStartTime" /> |
|
24 |
<result column="actual_end_time" property="actualEndTime" /> |
|
25 |
<result column="serial_number" property="serialNumber" /> |
|
26 |
<result column="order_status" property="orderStatus" /> |
|
27 |
<result column="spare_field_1" property="spareField1" /> |
|
28 |
<result column="spare_field_2" property="spareField2" /> |
|
29 |
<result column="spare_field_3" property="spareField3" /> |
|
30 |
<result column="spare_field_4" property="spareField4" /> |
|
31 |
<result column="create_time" property="createTime" /> |
|
32 |
<result column="update_time" property="updateTime" /> |
|
33 |
<result column="create_user" property="createUser" /> |
|
34 |
<result column="update_user" property="updateUser" /> |
|
35 |
<result column="remarks" property="remarks" /> |
|
36 |
<result column="stream_number" property="streamNumber" /> |
|
37 |
<result column="custom" property="custom" /> |
|
38 |
<result column="market_area_code" property="marketAreaCode" /> |
|
39 |
<result column="software_version_code" property="softwareVersionCode" /> |
|
40 |
<result column="product_company_code" property="productCompanyCode" /> |
|
41 |
|
|
42 |
|
|
43 |
</resultMap> |
|
44 |
|
|
45 |
<!-- 通用查询结果列 --> |
|
46 |
<sql id="Base_Column_List"> |
|
47 |
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", |
|
48 |
create_user AS "createUser", update_user AS "updateUser", remarks AS "remarks", |
|
49 |
market_area_code AS "marketAreaCode",software_version_code AS "softwareVersionCode",product_company_code AS "productCompanyCode" |
|
50 |
</sql> |
|
51 |
|
|
52 |
|
|
53 |
<select id="customList" resultType="cn.stylefeng.guns.modular.om.productionOrdeInfo.model.result.ProductionOrdeInfoResult" parameterType="cn.stylefeng.guns.modular.om.productionOrdeInfo.model.params.ProductionOrdeInfoParam"> |
|
54 |
select |
|
55 |
<include refid="Base_Column_List"/> |
|
56 |
from om_production_orde_info where 1 = 1 |
|
57 |
<if test="paramCondition.workOrderNo != null and paramCondition.workOrderNo != ''"> |
|
58 |
and work_order_no like CONCAT('%',#{paramCondition.workOrderNo},'%') |
|
59 |
</if> |
|
60 |
<if test="paramCondition.materialCode != null and paramCondition.materialCode != ''"> |
|
61 |
and material_code like CONCAT('%',#{paramCondition.materialCode},'%') |
|
62 |
</if> |
|
63 |
<if test="paramCondition.orderStatus != null and paramCondition.orderStatus != ''"> |
|
64 |
and order_status = #{paramCondition.orderStatus} |
|
65 |
</if> |
|
66 |
<if test="paramCondition.productionLine != null and paramCondition.productionLine != ''"> |
|
67 |
and production_line like CONCAT('%',#{paramCondition.productionLine},'%') |
|
68 |
</if> |
|
69 |
order by serial_number desc |
|
70 |
</select> |
|
71 |
|
|
72 |
<select id="customMapList" resultType="map" parameterType="cn.stylefeng.guns.modular.om.productionOrdeInfo.model.params.ProductionOrdeInfoParam"> |
|
73 |
select |
|
74 |
<include refid="Base_Column_List"/> |
|
75 |
from om_production_orde_info where 1 = 1 |
|
76 |
</select> |
|
77 |
|
|
78 |
<select id="customPageList" resultType="cn.stylefeng.guns.modular.om.productionOrdeInfo.model.result.ProductionOrdeInfoResult" parameterType="cn.stylefeng.guns.modular.om.productionOrdeInfo.model.params.ProductionOrdeInfoParam"> |
|
79 |
select |
|
80 |
<include refid="Base_Column_List"/> |
|
81 |
from om_production_orde_info where 1 = 1 |
|
82 |
<if test="paramCondition.workOrderNo != null and paramCondition.workOrderNo != ''"> |
|
83 |
and work_order_no like CONCAT('%',#{paramCondition.workOrderNo},'%') |
|
84 |
</if> |
|
85 |
<if test="paramCondition.materialCode != null and paramCondition.materialCode != ''"> |
|
86 |
and material_code like CONCAT('%',#{paramCondition.materialCode},'%') |
|
87 |
</if> |
|
88 |
<if test="paramCondition.orderStatus != null and paramCondition.orderStatus != ''"> |
|
89 |
and order_status = #{paramCondition.orderStatus} |
|
90 |
</if> |
|
91 |
<if test="paramCondition.productionLine != null and paramCondition.productionLine != ''"> |
|
92 |
and production_line like CONCAT('%',#{paramCondition.productionLine},'%') |
|
93 |
</if> |
|
94 |
order by serial_number desc |
|
95 |
</select> |
|
96 |
|
|
97 |
<select id="customPageMapList" resultType="map" parameterType="cn.stylefeng.guns.modular.om.productionOrdeInfo.model.params.ProductionOrdeInfoParam"> |
|
98 |
select |
|
99 |
<include refid="Base_Column_List"/> |
|
100 |
from om_production_orde_info where 1 = 1 |
|
101 |
</select> |
|
102 |
|
0d7f31
|
103 |
<!-- <select id="lineFinishQty" resultType="cn.stylefeng.guns.modular.om.productionOrdeInfo.model.result.ProductionOrdeInfoResult">--> |
懒 |
104 |
<!-- SELECT production_line as name,sum(actual_qty)as value FROM om_production_orde_info GROUP BY production_line--> |
|
105 |
<!-- </select>--> |
71e81e
|
106 |
<select id="lineFinishQty" resultType="cn.stylefeng.guns.modular.om.productionOrdeInfo.model.result.ProductionOrdeInfoResult"> |
0d7f31
|
107 |
SELECT TOP 7 actual_start_time as actualStartTime,actual_qty as actualQty FROM om_production_orde_info WHERE plan_start_time is not null AND actual_qty IS NOT NULL ORDER BY actual_qty DESC |
71e81e
|
108 |
</select> |
懒 |
109 |
|
|
110 |
<select id="getOrderWeek" resultType="Map"> |
|
111 |
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 |
|
112 |
</select> |
|
113 |
|
|
114 |
<select id="getPlanQtyByDate" parameterType="java.lang.String" resultType="java.lang.Integer"> |
|
115 |
select SUM(plan_qty) as planQty FROM om_production_orde_info WHERE CONVERT ( VARCHAR ( 100 ), create_time, 23 ) = #{paramCondition} |
|
116 |
</select> |
|
117 |
|
|
118 |
<select id="getActualQtyByDate" parameterType="string" resultType="integer"> |
|
119 |
select SUM(actual_qty) as actualQty FROM om_production_orde_info WHERE CONVERT ( VARCHAR ( 100 ), create_time, 23 ) = #{testdate} |
|
120 |
</select> |
|
121 |
|
0d7f31
|
122 |
<!-- <select id="getListMonth" resultType="cn.stylefeng.guns.modular.om.productionOrdeInfo.model.result.ProductionOrdeInfoResult">--> |
懒 |
123 |
<!-- <![CDATA[--> |
|
124 |
<!-- select * from om_production_orde_info where datediff(dd, plan_start_time,getdate())<=6--> |
|
125 |
<!-- ]]>--> |
|
126 |
<!-- </select>--> |
|
127 |
|
71e81e
|
128 |
<select id="getListMonth" resultType="cn.stylefeng.guns.modular.om.productionOrdeInfo.model.result.ProductionOrdeInfoResult"> |
懒 |
129 |
<![CDATA[ |
0d7f31
|
130 |
SELECT TOP 10 * FROM om_production_orde_info ORDER BY actual_start_time DESC |
71e81e
|
131 |
]]> |
懒 |
132 |
</select> |
|
133 |
|
|
134 |
</mapper> |