联查产线名字
This commit is contained in:
@@ -89,5 +89,8 @@ public class WmsSchedulePlanDetailVo {
|
|||||||
* 天数
|
* 天数
|
||||||
*/
|
*/
|
||||||
private Integer days;
|
private Integer days;
|
||||||
|
//产线名字
|
||||||
|
@ExcelProperty(value = "产线名字")
|
||||||
|
private String lineName;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
package com.klp.mapper;
|
package com.klp.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.klp.domain.WmsSchedulePlanDetail;
|
import com.klp.domain.WmsSchedulePlanDetail;
|
||||||
import com.klp.domain.vo.PlanTimeAgg;
|
import com.klp.domain.vo.PlanTimeAgg;
|
||||||
import com.klp.domain.vo.WmsSchedulePlanDetailVo;
|
import com.klp.domain.vo.WmsSchedulePlanDetailVo;
|
||||||
@@ -17,4 +20,6 @@ import java.util.List;
|
|||||||
public interface WmsSchedulePlanDetailMapper extends BaseMapperPlus<WmsSchedulePlanDetailMapper, WmsSchedulePlanDetail, WmsSchedulePlanDetailVo> {
|
public interface WmsSchedulePlanDetailMapper extends BaseMapperPlus<WmsSchedulePlanDetailMapper, WmsSchedulePlanDetail, WmsSchedulePlanDetailVo> {
|
||||||
|
|
||||||
List<PlanTimeAgg> selectPlanTimeAgg(@Param("planIds") List<Long> planIds);
|
List<PlanTimeAgg> selectPlanTimeAgg(@Param("planIds") List<Long> planIds);
|
||||||
|
|
||||||
|
Page<WmsSchedulePlanDetailVo> selectVoPagePlus(Page<Object> build,@Param("ew") QueryWrapper<WmsSchedulePlanDetail> lqw);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
package com.klp.service.impl;
|
package com.klp.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.klp.common.core.page.TableDataInfo;
|
import com.klp.common.core.page.TableDataInfo;
|
||||||
import com.klp.common.core.domain.PageQuery;
|
import com.klp.common.core.domain.PageQuery;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.klp.common.utils.StringUtils;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.klp.domain.bo.WmsSchedulePlanDetailBo;
|
import com.klp.domain.bo.WmsSchedulePlanDetailBo;
|
||||||
@@ -43,8 +45,8 @@ public class WmsSchedulePlanDetailServiceImpl implements IWmsSchedulePlanDetailS
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public TableDataInfo<WmsSchedulePlanDetailVo> queryPageList(WmsSchedulePlanDetailBo bo, PageQuery pageQuery) {
|
public TableDataInfo<WmsSchedulePlanDetailVo> queryPageList(WmsSchedulePlanDetailBo bo, PageQuery pageQuery) {
|
||||||
LambdaQueryWrapper<WmsSchedulePlanDetail> lqw = buildQueryWrapper(bo);
|
QueryWrapper<WmsSchedulePlanDetail> lqw = buildQueryWrapper(bo);
|
||||||
Page<WmsSchedulePlanDetailVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
Page<WmsSchedulePlanDetailVo> result = baseMapper.selectVoPagePlus(pageQuery.build(), lqw);
|
||||||
return TableDataInfo.build(result);
|
return TableDataInfo.build(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,19 +55,21 @@ public class WmsSchedulePlanDetailServiceImpl implements IWmsSchedulePlanDetailS
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<WmsSchedulePlanDetailVo> queryList(WmsSchedulePlanDetailBo bo) {
|
public List<WmsSchedulePlanDetailVo> queryList(WmsSchedulePlanDetailBo bo) {
|
||||||
LambdaQueryWrapper<WmsSchedulePlanDetail> lqw = buildQueryWrapper(bo);
|
QueryWrapper<WmsSchedulePlanDetail> lqw = buildQueryWrapper(bo);
|
||||||
return baseMapper.selectVoList(lqw);
|
return baseMapper.selectVoList(lqw);
|
||||||
}
|
}
|
||||||
|
|
||||||
private LambdaQueryWrapper<WmsSchedulePlanDetail> buildQueryWrapper(WmsSchedulePlanDetailBo bo) {
|
private QueryWrapper<WmsSchedulePlanDetail> buildQueryWrapper(WmsSchedulePlanDetailBo bo) {
|
||||||
Map<String, Object> params = bo.getParams();
|
Map<String, Object> params = bo.getParams();
|
||||||
LambdaQueryWrapper<WmsSchedulePlanDetail> lqw = Wrappers.lambdaQuery();
|
QueryWrapper<WmsSchedulePlanDetail> lqw = Wrappers.query();
|
||||||
lqw.eq(bo.getPlanId() != null, WmsSchedulePlanDetail::getPlanId, bo.getPlanId());
|
//联查需要取别名
|
||||||
lqw.eq(bo.getLineId() != null, WmsSchedulePlanDetail::getLineId, bo.getLineId());
|
lqw.eq("wspd.del_flag", 0);
|
||||||
lqw.eq(bo.getProductId() != null, WmsSchedulePlanDetail::getProductId, bo.getProductId());
|
lqw.eq( "wspd.plan_id", bo.getPlanId());
|
||||||
lqw.eq(bo.getQuantity() != null, WmsSchedulePlanDetail::getQuantity, bo.getQuantity());
|
lqw.eq("wspd.line_id", bo.getLineId());
|
||||||
lqw.eq(bo.getStartDate() != null, WmsSchedulePlanDetail::getStartDate, bo.getStartDate());
|
lqw.eq("wspd.product_id", bo.getProductId());
|
||||||
lqw.eq(bo.getEndDate() != null, WmsSchedulePlanDetail::getEndDate, bo.getEndDate());
|
lqw.eq("wspd.quantity", bo.getQuantity());
|
||||||
|
lqw.eq("wspd.start_date", bo.getStartDate());
|
||||||
|
lqw.eq("wspd.end_date", bo.getEndDate());
|
||||||
return lqw;
|
return lqw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,5 +35,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
GROUP BY
|
GROUP BY
|
||||||
plan_id
|
plan_id
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectVoPagePlus" resultType="com.klp.domain.vo.WmsSchedulePlanDetailVo">
|
||||||
|
SELECT *,
|
||||||
|
wpl.line_name AS lineName
|
||||||
|
FROM wms_schedule_plan_detail wspd
|
||||||
|
left join wms_product_line wpl on wspd.line_id = wpl.line_id
|
||||||
|
${ew.customSqlSegment}
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
Reference in New Issue
Block a user