mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-13 21:32:07 +08:00
MyCat-SQL语句冲突部分修改
This commit is contained in:
+2
-2
@@ -444,8 +444,8 @@ public class PlanServiceImpl implements PlanService {
|
||||
.betweenIfPresent("a.width", new BigDecimal[]{vo.getWidthMinRang(), vo.getWidthMaxRang()})
|
||||
.betweenIfPresent("a.height", new BigDecimal[]{vo.getLongMinRang(), vo.getLongMaxRang()})
|
||||
.inIfPresent("a.filter_type", filterTypes)
|
||||
.betweenIfPresent("f.delivery_date", new Date[]{vo.getBeginDate(), vo.getEndDate()});
|
||||
|
||||
.betweenIfPresent("f.delivery_date", new Date[]{vo.getBeginDate(), vo.getEndDate()})
|
||||
.orderByDesc("a.name");
|
||||
PageDTO<PlateResList> page = new PageDTO<>(vo.getPageNo(), vo.getPageSize());
|
||||
IPage<PlateResList> pageResult = plateMapper.selectPlateByPlanId(page, queryWrapperX);
|
||||
Set<Long> bodyIds = pageResult.getRecords().stream().map(PlateResList::getBodyId).collect(Collectors.toSet());
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
<mapper namespace="com.cf.imes.module.executor.dal.mysql.order.OrderMapper">
|
||||
|
||||
<select id="selectOrderPage" resultType="com.cf.imes.module.executor.controller.admin.plan.vo.OrderRespVOCopy">
|
||||
select a.id as orderId, a.order_date, a.delivery_date, a.customer, a.address, a.custom_order_no as defineId,
|
||||
select distinct a.id as orderId, a.order_date, a.delivery_date, a.customer, a.address, a.custom_order_no as defineId,
|
||||
count(op.id) as num, sum(op.area) as area
|
||||
from `orders` a
|
||||
left join order_item oi on a.id = oi.order_id and a.organ_id = oi.organ_id
|
||||
|
||||
+5
-5
@@ -4,7 +4,7 @@
|
||||
|
||||
|
||||
<select id="selectPlatesDetailByOrderId" resultType="com.cf.imes.module.executor.controller.admin.plate.vo.PlateRespVO">
|
||||
SELECT i.order_id, p.id, p.plate_no, g.material, p.name, p.area, p.seal_left, p.seal_down,
|
||||
SELECT distinct i.order_id, p.id, p.plate_no, g.material, p.name, p.area, p.seal_left, p.seal_down,
|
||||
p.seal_right, p.seal_up, p.texture, p.is_special_shaped, p.is_sculpt, p.unregular_point_count, p.front_hole_count,
|
||||
p.back_hole_count, p.side_hole_count,p.width,p.height,p.thickness,gp.name
|
||||
FROM order_item i
|
||||
@@ -27,7 +27,7 @@
|
||||
</select>
|
||||
|
||||
<select id="selectPartsDetailByOrderId" resultType="com.cf.imes.module.executor.controller.admin.orderParts.vo.OrderPartsRespVO">
|
||||
SELECT i.order_id, p.id, p.model, p.spec, p.name,i.num, p.unit, p.brand, p.factory, p.remark,p.type,p.price,
|
||||
SELECT distinct i.order_id, p.id, p.model, p.spec, p.name,i.num, p.unit, p.brand, p.factory, p.remark,p.type,p.price,
|
||||
p.is_composite,p.create_time
|
||||
FROM order_item i
|
||||
RIGHT JOIN `order_parts` p ON i.parts_id = p.id
|
||||
@@ -45,7 +45,7 @@
|
||||
|
||||
<select id="selectPartsByOrderId"
|
||||
resultType="com.cf.imes.module.executor.controller.admin.order.vo.order.OrderPlatesDetailRespVO">
|
||||
SELECT i.order_id, i.room_id, i.body_id, i.parts_id, p.`name` as part_name, i.num as plate_num
|
||||
SELECT distinct i.order_id, i.room_id, i.body_id, i.parts_id, p.`name` as part_name, i.num as plate_num
|
||||
FROM `order_item` i
|
||||
RIGHT JOIN `order_parts` p ON i.parts_id = p.id
|
||||
WHERE i.order_id = #{orderId} AND i.organ_id = #{organId} AND p.deleted = #{deleted}
|
||||
@@ -171,13 +171,13 @@
|
||||
from order_item oi
|
||||
left join order_package op on oi.order_id = op.order_id and oi.organ_id = op.organ_id
|
||||
|
||||
where oi.parts_id = '' and oi.organ_id = #{organId}
|
||||
where oi.parts_id = 0 and oi.organ_id = #{organId}
|
||||
and oi.order_id in
|
||||
|
||||
<foreach item="orderIds" collection="orderIds" open="(" separator="," close=")">
|
||||
#{orderIds}
|
||||
</foreach>
|
||||
group by oi.order_id,oi.plate_id,op.id,op.package_no;
|
||||
group by oi.order_id,oi.plate_id,op.id,op.package_no,op.status;
|
||||
|
||||
|
||||
|
||||
|
||||
+4
-3
@@ -4,7 +4,7 @@
|
||||
|
||||
<select id="selectProductList"
|
||||
resultType="com.cf.imes.module.executor.controller.admin.orderParts.vo.OrderPartsRespVO">
|
||||
SELECT a.id, a.goods_id, a.name, a.material, a.type, a.model, a.spec, a.brand, a.factory,
|
||||
SELECT distinct a.id, a.goods_id, a.name, a.material, a.type, a.model, a.spec, a.brand, a.factory,
|
||||
a.unit, a.price, a.is_composite, a.remark, b.num
|
||||
FROM order_parts a
|
||||
LEFT JOIN order_item b ON a.id = b.parts_id and a.organ_id = b.organ_id
|
||||
@@ -16,7 +16,8 @@
|
||||
|
||||
<select id="selectPartDetail"
|
||||
resultType="com.cf.imes.module.executor.controller.admin.orderParts.vo.PartGoodsRespVO">
|
||||
SELECT a.id,
|
||||
SELECT distinct
|
||||
a.id,
|
||||
a.goods_id,
|
||||
a.name,
|
||||
a.material,
|
||||
@@ -45,7 +46,7 @@
|
||||
|
||||
<select id="selectPartAll"
|
||||
resultType="com.cf.imes.module.executor.controller.admin.orderParts.vo.PartGoodsRespVO">
|
||||
SELECT
|
||||
SELECT distinct
|
||||
a.name,
|
||||
a.brand,
|
||||
a.model,
|
||||
|
||||
+2
-2
@@ -90,7 +90,7 @@
|
||||
|
||||
|
||||
<select id="getOptimizePlanParam" resultMap="optimizeMap">
|
||||
select op.id as plan_id, op.plan_no, op.type as op_type, op.status as op_status, op.machine_id, op.plan_time, op.produce_time, op.remark as op_remark, op.operator,
|
||||
select distinct op.id as plan_id, op.plan_no, op.type as op_type, op.status as op_status, op.machine_id, op.plan_time, op.produce_time, op.remark as op_remark, op.operator,
|
||||
oi.order_id, opl.id as plateId, opl.order_id opl_order_id, opl.name opl_name, opl.plate_no, opl.type as opl_type, opl.goods_id as opl_goods_id, opl.width opl_width,
|
||||
opl.height opl_height, opl.thickness as opl_thickness, opl.split_width, opl.split_height, opl.split_thickness, opl.seal_left, opl.seal_right,
|
||||
opl.seal_up, opl.seal_down, opl.area, opl.texture, opl.hole_face, opl.hole_arrange, opl.unregular_point_count, opl.front_hole_count,
|
||||
@@ -111,7 +111,7 @@
|
||||
resultType="com.cf.imes.module.executor.controller.admin.plan.vo.PlateOptimize"
|
||||
parameterType="java.lang.Long">
|
||||
|
||||
select a.id, a.goods_name, a.material, a.color, a.width, a.height, a.thickness, count(b.id) as plateNum, d.*
|
||||
select distinct a.id, a.goods_name, a.material, a.color, a.width, a.height, a.thickness, count(b.id) as plateNum, d.*
|
||||
from order_goods a
|
||||
left join order_plate b on a.id = b.goods_id and a.organ_id = b.organ_id
|
||||
left join order_item c on c.order_id = b.order_id and c.organ_id = b.organ_id
|
||||
|
||||
+11
-10
@@ -5,7 +5,7 @@
|
||||
|
||||
<select id="selectPlatePage" resultType="com.cf.imes.module.executor.controller.admin.plan.vo.PlatePage">
|
||||
|
||||
select a.id as plateId, a.name, a.width, a.height, a.thickness, a.area,
|
||||
select distinct a.id as plateId, a.name, a.width, a.height, a.thickness, a.area,
|
||||
b.custom_order_no, b.customer, b.address, b.remark, b.id as orderId,
|
||||
c.goods_name, c.material, c.color, a.goods_id,oi.num,a.is_special_shaped as specialShaped,a.is_sculpt as profiling
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
<select id="selectPlateByPlanId"
|
||||
resultType="com.cf.imes.module.executor.controller.admin.plan.vo.PlateResList">
|
||||
select a.order_id, a.plate_no , a.name as plateName,a.is_special_shaped,a.is_sculpt,a.area,a.seal_left,a.seal_right,a.seal_up,a.seal_down, e.material, e.color, a.width, a.height, a.thickness, b.room_id, b.body_id
|
||||
select distinct a.order_id, a.plate_no , a.name as plateName,a.is_special_shaped,a.is_sculpt,a.area,a.seal_left,a.seal_right,a.seal_up,a.seal_down, e.material, e.color, a.width, a.height, a.thickness, b.room_id, b.body_id
|
||||
from order_plate a
|
||||
LEFT JOIN order_item b ON a.id = b.plate_id AND a.order_id = b.order_id and a.organ_id = b.organ_id
|
||||
LEFT JOIN order_goods e ON e.id = a.goods_id AND e.order_id = a.order_id and e.organ_id = a.organ_id
|
||||
@@ -40,7 +40,7 @@
|
||||
</select>
|
||||
<select id="selectPlateList"
|
||||
resultType="com.cf.imes.module.executor.controller.admin.plan.vo.PlateParam">
|
||||
select a.id, a.plate_no, a.height length, a.width, a.texture, a.hole_arrange, a.hole_face, if ( (count(a.unregular_point_count) = 0), 1, 0) as isRect
|
||||
select distinct a.id, a.plate_no, a.height length, a.width, a.texture, a.hole_arrange, a.hole_face, if ( (count(a.unregular_point_count) = 0), 1, 0) as isRect
|
||||
from order_plate a
|
||||
left join order_item b on a.id = b.plate_id
|
||||
where b.plan_id = #{planId}
|
||||
@@ -50,7 +50,7 @@
|
||||
|
||||
<select id="selectProductList"
|
||||
resultType="com.cf.imes.module.executor.controller.admin.plate.vo.PlateRespVO">
|
||||
SELECT a.id, a.plate_no, a.height, a.thickness, a.width, a.name, a.area, a.seal_left, a.seal_right,
|
||||
SELECT distinct a.id, a.plate_no, a.height, a.thickness, a.width, a.name, a.area, a.seal_left, a.seal_right,
|
||||
a.seal_up, a.seal_down, a.texture, a.hole_face, a.hole_arrange, a.unregular_point_count, a.front_hole_count, a.back_hole_count,
|
||||
a.side_hole_count, a.front_model_count, a.back_model_count, a.remark, c.material, c.color
|
||||
FROM order_plate a
|
||||
@@ -63,7 +63,7 @@
|
||||
</select>
|
||||
|
||||
<select id="selectBatchOrderIdsAndGoodsIds" resultType="java.lang.Long">
|
||||
select oi.id from order_plate op
|
||||
select distinct oi.id from order_plate op
|
||||
join order_item oi on op.id = oi.plate_id and op.order_id = oi.order_id and op.organ_id = oi.organ_id
|
||||
where op.organ_id = #{organId} and op.order_id in
|
||||
<foreach collection="itemList" item="item" open="(" close=")" separator=",">
|
||||
@@ -181,7 +181,8 @@
|
||||
|
||||
<select id="selectPlateGoodsList" resultType="com.cf.imes.module.executor.controller.admin.plate.vo.PlateGoodsRespVO">
|
||||
|
||||
select op.id,
|
||||
select distinct
|
||||
op.id,
|
||||
op.name,
|
||||
op.goods_id,
|
||||
ogs.goods_name,
|
||||
@@ -242,7 +243,7 @@
|
||||
|
||||
<select id="selectPlateGoodsListSummary" resultType="com.cf.imes.module.executor.controller.admin.plate.vo.PlateGoodsRespVO">
|
||||
|
||||
select
|
||||
select distinct
|
||||
op.name,
|
||||
op.open_door_type,
|
||||
op.height,
|
||||
@@ -292,15 +293,15 @@
|
||||
parameterType="java.lang.Long">
|
||||
|
||||
|
||||
select a.order_id, a.plate_no , a.name as plateName,a.is_special_shaped,a.is_sculpt,a.area,a.seal_left,a.seal_right,a.seal_up,a.seal_down, e.material, e.color, a.width, a.height, a.thickness, b.room_id, b.body_id
|
||||
select distinct a.order_id, a.plate_no , a.name as plateName,a.is_special_shaped,a.is_sculpt,a.area,a.seal_left,a.seal_right,a.seal_up,a.seal_down, e.material, e.color, a.width, a.height, a.thickness, b.room_id, b.body_id
|
||||
from order_plan_item p
|
||||
left join order_item b on p.item_id = b.id and b.organ_id = p.organ_id
|
||||
left join order_plate a on b.plate_id = a.id and b.order_id = a.order_id and b.organ_id = a.organ_id
|
||||
left join order_goods e on a.goods_id = e.id and a.order_id = e.order_id and a.organ_id = e.organ_id
|
||||
|
||||
where p.plan_id = #{planId} and p.organ_id = #{organId} ;
|
||||
|
||||
where p.plan_id = #{planId} and p.organ_id = #{organId}
|
||||
|
||||
order by a.order_id,plateName;
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user