追溯查询模块代码提交

cert
schry 2 years ago
parent 88b5ae6a04
commit 6ac03f9d3a

@ -2,8 +2,16 @@ package com.glxp.api.dao.trace;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.api.entity.trace.TraceManuCodeRelEntity;
import com.glxp.api.req.trace.TraceManuDetailRequest;
import com.glxp.api.req.trace.TraceManuOrderRequest;
import com.glxp.api.res.trace.TraceManuCodeRellResponse;
import com.glxp.api.res.trace.TraceManuOrderResponse;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface TraceManuCodeRelMapper extends BaseMapper<TraceManuCodeRelEntity> {
List<TraceManuCodeRellResponse> filterTraceManuCodeRel(TraceManuDetailRequest traceManuDetailRequest);
}

@ -3,10 +3,11 @@ package com.glxp.api.req.trace;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.glxp.api.util.page.ListPageRequest;
import lombok.Data;
@Data
public class TraceManuDetailRequest {
public class TraceManuDetailRequest extends ListPageRequest {
private Long id;
/**
@ -49,5 +50,9 @@ public class TraceManuDetailRequest {
*/
private Integer bzcj;
/**
*
*/
private String manuOrderNo;
}

@ -74,4 +74,14 @@ public class TraceManuOrderRequest extends ListPageRequest {
* ID
*/
private Long uploadUser;
/**
*
*/
private String recordCode;
/**
*
*/
private String companyName;
}

@ -74,6 +74,14 @@ public class TraceManuCodeRellResponse {
* ID
*/
private Long uploadUser;
private String code;
private String pcode;
private String batchNo;
private String produceDate;
private String expireDate;
private String serialNo;
private String bzcj;
private String packState;
}

@ -77,4 +77,34 @@ public class TraceManuOrderResponse {
* ID
*/
private Long uploadUser;
/**
*
*/
private String companyName;
/**
*
*/
private String recordCode;
/**
*
*/
private String batchNo;
/**
*
*/
private String createUser;
/**
*
*/
private String traceType;
/**
*
*/
private String remark;
}

@ -1,5 +1,6 @@
package com.glxp.api.service.trace;
import com.github.pagehelper.PageHelper;
import com.glxp.api.req.trace.TraceManuDetailRequest;
import com.glxp.api.res.trace.TraceManuCodeRellResponse;
import org.springframework.stereotype.Service;
@ -7,13 +8,25 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.glxp.api.entity.trace.TraceManuCodeRelEntity;
import com.glxp.api.dao.trace.TraceManuCodeRelMapper;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
@Service
public class TraceManuCodeRelServiceImpl extends ServiceImpl<TraceManuCodeRelMapper, TraceManuCodeRelEntity> implements TraceManuCodeRelService {
@Resource
TraceManuCodeRelMapper traceManuCodeRelMapper;
@Override
public List<TraceManuCodeRellResponse> filterList(TraceManuDetailRequest traceManuDetailRequest) {
return null;
if (traceManuDetailRequest == null) {
return Collections.emptyList();
}
if (traceManuDetailRequest.getPage() != null) {
int offset = (traceManuDetailRequest.getPage() - 1) * traceManuDetailRequest.getLimit();
PageHelper.offsetPage(offset, traceManuDetailRequest.getLimit());
}
return traceManuCodeRelMapper.filterTraceManuCodeRel(traceManuDetailRequest);
}
}

@ -1,4 +1,15 @@
<?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.glxp.api.dao.trace.TraceManuCodeRelMapper">
<select id="filterTraceManuCodeRel" parameterType="com.glxp.api.req.trace.TraceManuDetailRequest"
resultType="com.glxp.api.res.trace.TraceManuCodeRellResponse">
SELECT tmo.nameCode,tmo.cpmctymc,tmo.ggxh,tmcr.*
FROM trace_manu_code_rel tmcr
LEFT JOIN trace_manu_order tmo ON tmo.billNo = tmcr.manuOrderNo
<where>
<if test="manuOrderNo != '' and manuOrderNo != null">
and manuOrderNo = #{manuOrderNo}
</if>
</where>
</select>
</mapper>

@ -3,6 +3,38 @@
<mapper namespace="com.glxp.api.dao.trace.TraceManuOrderMapper">
<select id="filterTraces" parameterType="com.glxp.api.req.trace.TraceManuOrderRequest"
resultType="com.glxp.api.res.trace.TraceManuOrderResponse">
SELECT tmo.*,mid.*,uc.companyName
FROM trace_manu_order tmo
LEFT JOIN user_company uc ON uc.id = tmo.companyIdFk
LEFT JOIN (SELECT tr.recordCode,tr.createUser,tr.remark,trd.batchNo,trd.traceType
FROM trace_record tr
LEFT JOIN trace_record_detail trd ON trd.recordIdFk = tr.id) mid ON mid.recordCode = tmo.recordCode
<where>
<if test="recordCode != '' and recordCode != null">
and recordCode = #{recordCode}
</if>
<if test="companyName != '' and companyName != null">
AND companyName LIKE CONCAT('%', #{companyName}, '%')
</if>
<if test="nameCode != '' and nameCode != null">
and nameCode = #{nameCode}
</if>
<if test="cpmctymc != '' and cpmctymc != null">
and cpmctymc = #{cpmctymc}
</if>
<if test="ggxh != '' and ggxh != null">
and ggxh = #{ggxh}
</if>
<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
and ylqxzcrbarmc = #{ylqxzcrbarmc}
</if>
<if test="zczbhhzbapzbh != '' and zczbhhzbapzbh != null">
and zczbhhzbapzbh = #{zczbhhzbapzbh}
</if>
</where>
</select>
<select id="filterTraces1" parameterType="com.glxp.api.req.trace.TraceManuOrderRequest"
resultType="com.glxp.api.res.trace.TraceManuOrderResponse">
select *
from trace_manu_order
<where>

Loading…
Cancel
Save