From f1400115f582ae795913e360c0f5a70ea4513544 Mon Sep 17 00:00:00 2001
From: XiaoRuby <3114200645@qq.com>
Date: 星期一, 04 九月 2023 17:42:27 +0800
Subject: [PATCH] MOM系统-9-04 三个不合格查询
---
production-server/src/main/resources/mapper/ManualTechnologyMapper.xml | 48 +++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 41 insertions(+), 7 deletions(-)
diff --git a/production-server/src/main/resources/mapper/ManualTechnologyMapper.xml b/production-server/src/main/resources/mapper/ManualTechnologyMapper.xml
index 743e3ab..752abcd 100644
--- a/production-server/src/main/resources/mapper/ManualTechnologyMapper.xml
+++ b/production-server/src/main/resources/mapper/ManualTechnologyMapper.xml
@@ -1,15 +1,49 @@
<?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.yuanchu.mom.mapper.ManualTechnologyMapper">
- <select id="seleDatil" resultType="java.util.Map">
+
+ <resultMap id="seleDatilMap" type="map">
+ <id property="lable" column="techfather"/>
+ <collection property="children" resultMap="seleDatilTowMap" javaType="List"/>
+ </resultMap>
+
+ <resultMap id="seleDatilTowMap" type="map">
+ <id property="lable" column="techname"/>
+ <result property="id" column="id"/>
+ <result property="deviceGroup" column="device_group"/>
+ <result property="technologyId" column="manufacture_order_id"/>
+ </resultMap>
+
+ <select id="seleDatil" resultMap="seleDatilMap">
select manual_technology.id,
techfather,
techname,
- device_group,
- name
+ device_group
from mom_ocean.manual_technology
- left join mom_ocean.device
- on device.id = device_id
- where manufacture_order_id=#{manOrdId}
+ where manufacture_order_id = #{manOrdId}
</select>
-</mapper>
\ No newline at end of file
+
+ <resultMap id="selectListTowTreeFirstMap" type="map">
+ <id property="techfather" column="techfather"/>
+ <collection property="children" javaType="list" resultMap="selectListTowTreeSecondMap"/>
+ </resultMap>
+
+ <resultMap id="selectListTowTreeSecondMap" type="map">
+ <id property="id" column="id"/>
+ <result property="techname" column="techname"/>
+ <result property="deviceName" column="name"/>
+ <result property="startTime" column="start_time"/>
+ <result property="endTime" column="end_time"/>
+ <result property="period" column="period"/>
+ </resultMap>
+ <select id="selectListTowTree" resultMap="selectListTowTreeFirstMap">
+ SELECT p.`id`, t.`techfather`, t.`techname`, d.`name`, DATE_FORMAT(p.`start_time`, '%Y-%m-%d') start_time,
+ DATE_FORMAT(p.`end_time`, '%Y-%m-%d') end_time, p.`period`
+ FROM manufacture_order_process p
+ LEFT JOIN device d ON d.`id` = p.`device_id`
+ LEFT JOIN manual_technology t ON t.`id` = p.`manual_technology_id`
+ WHERE p.`state` = 1
+ AND p.`manufacture_scheduling_id` = #{schedulingId}
+ ORDER BY p.`create_time` DESC
+ </select>
+</mapper>
--
Gitblit v1.9.3