|
@@ -39,7 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<sql id="selectRingScanInformationVo">
|
|
<sql id="selectRingScanInformationVo">
|
|
- select id, device_number, device_name, scanning_time,process_name,station_name, content_information,personnel_name,order_number,production_order_number,execution_message from fjqydb.ring_scan_information
|
|
|
|
|
|
+ select id, device_number, device_name, scanning_time,process_name,station_name, content_information,personnel_name,order_number,production_order_number,execution_message,over_number from fjqydb.ring_scan_information
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
<select id="selectRingScanInformationList" parameterType="com.zkqy.amichi.domain.RingScanInformation" resultMap="RingScanInformationResult">
|
|
<select id="selectRingScanInformationList" parameterType="com.zkqy.amichi.domain.RingScanInformation" resultMap="RingScanInformationResult">
|
|
@@ -103,7 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<![CDATA[ and scanning_time <= #{scanningTimes[0]}]]>
|
|
<![CDATA[ and scanning_time <= #{scanningTimes[0]}]]>
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
- order by scanning_time,process_name
|
|
|
|
|
|
+ order by personnel_name,process_name asc,scanning_time desc
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
@@ -288,20 +288,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
<select id="selectScanStatistics" resultType="com.zkqy.amichi.domain.vo.ScanStatistics" parameterType="com.zkqy.amichi.domain.RingScanInformation">
|
|
<select id="selectScanStatistics" resultType="com.zkqy.amichi.domain.vo.ScanStatistics" parameterType="com.zkqy.amichi.domain.RingScanInformation">
|
|
SELECT
|
|
SELECT
|
|
- c.production_order_number as dOrder,
|
|
|
|
|
|
+ CONCAT(c.order_number, '/', c.model_number) AS dOrder,
|
|
c.dCount,
|
|
c.dCount,
|
|
SUM( CASE WHEN c.execution_mark = 1 THEN 1 ELSE 0 END ) AS dsCount,
|
|
SUM( CASE WHEN c.execution_mark = 1 THEN 1 ELSE 0 END ) AS dsCount,
|
|
SUM( CASE WHEN c.execution_mark = 2 THEN 1 ELSE 0 END ) As dfCount
|
|
SUM( CASE WHEN c.execution_mark = 2 THEN 1 ELSE 0 END ) As dfCount
|
|
FROM
|
|
FROM
|
|
(
|
|
(
|
|
SELECT
|
|
SELECT
|
|
- rsi.production_order_number,
|
|
|
|
|
|
+ rsi.order_number,
|
|
rsi.native_numbering,
|
|
rsi.native_numbering,
|
|
- rsif.production_order_total_quantity AS dCount,
|
|
|
|
- rsi.execution_mark
|
|
|
|
|
|
+ rsif.total_quantity AS dCount,
|
|
|
|
+ rsi.execution_mark,
|
|
|
|
+ ptd.model_number
|
|
FROM
|
|
FROM
|
|
fjqydb.ring_scan_information rsi
|
|
fjqydb.ring_scan_information rsi
|
|
LEFT JOIN fjqydb.ring_scan_information_first rsif ON rsi.production_order_number = rsif.production_order_number
|
|
LEFT JOIN fjqydb.ring_scan_information_first rsif ON rsi.production_order_number = rsif.production_order_number
|
|
|
|
+ LEFT JOIN fjqydb.plan_task_details AS ptd ON rsi.production_order_number = ptd.demand_document
|
|
<where>
|
|
<where>
|
|
<if test="processName!=null and processName!='' and processName.equals('焊接D')">
|
|
<if test="processName!=null and processName!='' and processName.equals('焊接D')">
|
|
rsi.content_information LIKE concat('%','D', '%' ) and rsi.process_name='焊接'
|
|
rsi.content_information LIKE concat('%','D', '%' ) and rsi.process_name='焊接'
|
|
@@ -315,11 +317,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<if test="processName!=null and processName!='' and processName!='焊接D' and processName!='焊接Z'">
|
|
<if test="processName!=null and processName!='' and processName!='焊接D' and processName!='焊接Z'">
|
|
and rsi.process_name like concat('%', #{processName}, '%')
|
|
and rsi.process_name like concat('%', #{processName}, '%')
|
|
</if>
|
|
</if>
|
|
|
|
+ and execution_mark='1'
|
|
</where>
|
|
</where>
|
|
GROUP BY native_numbering
|
|
GROUP BY native_numbering
|
|
) AS c
|
|
) AS c
|
|
GROUP BY
|
|
GROUP BY
|
|
- production_order_number
|
|
|
|
|
|
+ order_number
|
|
</select>
|
|
</select>
|
|
<select id="selectRingScanInformationListLike" resultType="java.lang.String" parameterType="com.zkqy.amichi.domain.RingScanInformation">
|
|
<select id="selectRingScanInformationListLike" resultType="java.lang.String" parameterType="com.zkqy.amichi.domain.RingScanInformation">
|
|
SELECT
|
|
SELECT
|
|
@@ -333,30 +336,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<if test="processName!=null and processName!='' and processName.equals('焊接Z')">
|
|
<if test="processName!=null and processName!='' and processName.equals('焊接Z')">
|
|
content_information LIKE concat('%','Z', '%' ) and process_name='焊接'
|
|
content_information LIKE concat('%','Z', '%' ) and process_name='焊接'
|
|
</if>
|
|
</if>
|
|
- <if test="productionOrderNumber!=null and productionOrderNumber!=''">
|
|
|
|
- and production_order_number=#{productionOrderNumber}
|
|
|
|
|
|
+ <if test="orderNumber!=null and orderNumber!=''">
|
|
|
|
+ and order_number=#{orderNumber}
|
|
</if>
|
|
</if>
|
|
<if test="processName!=null and processName!='' and processName!='焊接D' and processName!='焊接Z'">
|
|
<if test="processName!=null and processName!='' and processName!='焊接D' and processName!='焊接Z'">
|
|
and process_name like concat('%', #{processName}, '%')
|
|
and process_name like concat('%', #{processName}, '%')
|
|
</if>
|
|
</if>
|
|
|
|
+ and execution_mark='1'
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="handHeldJournal" resultType="map" parameterType="com.zkqy.amichi.domain.RingScanInformation">
|
|
<select id="handHeldJournal" resultType="map" parameterType="com.zkqy.amichi.domain.RingScanInformation">
|
|
SELECT
|
|
SELECT
|
|
- rsif.production_order_total_quantity as Dcount,
|
|
|
|
- rsi.order_number as orderNumber,
|
|
|
|
- rsi.production_order_number as Dorder,
|
|
|
|
|
|
+ rsif.total_quantity as Dcount,
|
|
|
|
+ concat(rsi.order_number,'/' ,ptd.model_number) as Dorder,
|
|
|
|
+ rsi.order_number as DorderName,
|
|
|
|
+ rsi.production_order_number ,
|
|
rsi.personnel_name as Uname,
|
|
rsi.personnel_name as Uname,
|
|
rsi.station_name as Ugw,
|
|
rsi.station_name as Ugw,
|
|
|
|
+ rsi.process_name as processName,
|
|
SUM( CASE WHEN rsi.execution_mark = 1 THEN 1 ELSE 0 END ) AS dsCount,
|
|
SUM( CASE WHEN rsi.execution_mark = 1 THEN 1 ELSE 0 END ) AS dsCount,
|
|
SUM( CASE WHEN rsi.execution_mark = 2 THEN 1 ELSE 0 END ) As dfCount
|
|
SUM( CASE WHEN rsi.execution_mark = 2 THEN 1 ELSE 0 END ) As dfCount
|
|
FROM
|
|
FROM
|
|
fjqydb.ring_scan_information AS rsi
|
|
fjqydb.ring_scan_information AS rsi
|
|
LEFT JOIN fjqydb.ring_scan_information_first AS rsif ON rsi.production_order_number = rsif.production_order_number
|
|
LEFT JOIN fjqydb.ring_scan_information_first AS rsif ON rsi.production_order_number = rsif.production_order_number
|
|
|
|
+ left join fjqydb.plan_task_details as ptd on rsi.production_order_number=ptd.demand_document
|
|
where DATE(rsi.scanning_time) = CURDATE()
|
|
where DATE(rsi.scanning_time) = CURDATE()
|
|
GROUP BY
|
|
GROUP BY
|
|
- rsi.production_order_number,
|
|
|
|
|
|
+ rsi.order_number,
|
|
rsi.personnel_name,
|
|
rsi.personnel_name,
|
|
rsi.station_name
|
|
rsi.station_name
|
|
</select>
|
|
</select>
|
|
@@ -383,6 +390,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
</where>
|
|
</where>
|
|
order by scanning_time,process_name
|
|
order by scanning_time,process_name
|
|
</select>
|
|
</select>
|
|
|
|
+ <select id="selectRingScanInfoByUserNameAndOrderNumber" resultType="java.lang.String">
|
|
|
|
+ SELECT
|
|
|
|
+ COUNT(DISTINCT rsi.native_numbering) AS completedMachines
|
|
|
|
+ FROM
|
|
|
|
+ fjqydb.ring_scan_information AS rsi
|
|
|
|
+ WHERE
|
|
|
|
+ rsi.process_name = #{gw}
|
|
|
|
+ AND rsi.personnel_name = #{uname}
|
|
|
|
+ AND rsi.order_number =#{dorder}
|
|
|
|
+ AND rsi.execution_mark = '1'
|
|
|
|
+ GROUP BY
|
|
|
|
+ rsi.personnel_name,
|
|
|
|
+ rsi.order_number;
|
|
|
|
+ </select>
|
|
|
|
|
|
|
|
|
|
<insert id="insertRingScanInformation" parameterType="com.zkqy.amichi.domain.RingScanInformation" useGeneratedKeys="true" keyProperty="id">
|
|
<insert id="insertRingScanInformation" parameterType="com.zkqy.amichi.domain.RingScanInformation" useGeneratedKeys="true" keyProperty="id">
|