Commit 0517b307 authored by 温志超's avatar 温志超

更新报表

parent d6f2b60b
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!-- 日志存放路径 -->
<property name="log.path" value="d:/logs/mes" />
<property name="log.path" value="/home/ximai/logs" />
<!-- 日志输出格式 -->
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
<!-- 控制台输出 -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${log.pattern}</pattern>
<charset>UTF-8</charset>
</encoder>
</appender>
<!-- 控制台输出 -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<!-- 系统日志输出 -->
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-info.log</file>
<!-- 系统日志输出 -->
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-info.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
<charset>UTF-8</charset>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>INFO</level>
<!-- 匹配时的操作:接收(记录) -->
......@@ -35,34 +33,33 @@
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
</appender>
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-error.log</file>
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-error.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
<charset>UTF-8</charset>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>ERROR</level>
<!-- 匹配时的操作:接收(记录) -->
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 用户访问日志输出 -->
<!-- 用户访问日志输出 -->
<appender name="sys-user" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-user.log</file>
<file>${log.path}/sys-user.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 按天回滚 daily -->
<fileNamePattern>${log.path}/sys-user.%d{yyyy-MM-dd}.log</fileNamePattern>
......@@ -71,7 +68,6 @@
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
<charset>UTF-8</charset>
</encoder>
</appender>
......@@ -86,26 +82,25 @@
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
<charset>UTF-8</charset>
</encoder>
</appender>
<!-- 系统模块日志级别控制 -->
<logger name="com.ximai" level="info" />
<!-- Spring日志级别控制 -->
<logger name="org.springframework" level="warn" />
<!-- 系统模块日志级别控制 -->
<logger name="com.ximai" level="info" />
<!-- Spring日志级别控制 -->
<logger name="org.springframework" level="warn" />
<root level="info">
<appender-ref ref="console" />
</root>
<root level="info">
<appender-ref ref="console" />
</root>
<!--系统操作日志-->
<!--系统操作日志-->
<root level="info">
<appender-ref ref="file_info" />
<appender-ref ref="file_error" />
</root>
<!--系统用户操作日志-->
<!--系统用户操作日志-->
<logger name="sys-user" level="info">
<appender-ref ref="sys-user"/>
</logger>
......
......@@ -125,4 +125,16 @@ public interface ProFeedbackMapper {
void updateLastFeedback(@Param("qrcode")String qrcode, @Param("taskId")Long taskId);
List<FeedbackResponse> getList(FeedbackRequest feedbackRequest);
List<FeedbackResponse> getListByWorkOrder(FeedbackRequest feedbackRequest);
List<FeedbackResponse> getListByWorkshop(FeedbackRequest feedbackRequest);
List<FeedbackResponse> getListByWorkstation(FeedbackRequest feedbackRequest);
List<FeedbackResponse> getListByWorkunit(FeedbackRequest feedbackRequest);
List<FeedbackResponse> getListByProcess(FeedbackRequest feedbackRequest);
List<FeedbackResponse> getListByUser(FeedbackRequest feedbackRequest);
}
......@@ -3,6 +3,7 @@ package com.ximai.mes.report.controller;
import com.ximai.common.annotation.Log;
import com.ximai.common.core.controller.BaseController;
import com.ximai.common.core.domain.AjaxResult;
import com.ximai.common.core.page.TableDataInfo;
import com.ximai.common.enums.BusinessType;
import com.ximai.mes.report.request.FeedbackRequest;
import com.ximai.mes.report.response.FeedbackResponse;
......@@ -14,6 +15,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.List;
@Api("生产报工")
......@@ -26,12 +29,141 @@ public class FeedbackController extends BaseController {
/**
* 新增生产报工记录
*/
@ApiOperation("新增报工单接口")
@PreAuthorize("@ss.hasPermi('mes:pro:feedback:add')")
@ApiOperation("生产报工记录:明细界面")
@PreAuthorize("@ss.hasPermi('mes:pro:feedback:get')")
@Log(title = "生产报工记录", businessType = BusinessType.QUERY)
@GetMapping("/getList")
public AjaxResult getList(@RequestBody FeedbackRequest feedbackRequest) {
public TableDataInfo getList(@RequestBody FeedbackRequest feedbackRequest) {
startPage();
List<FeedbackResponse> feedbackResponseList = feedbackService.getList(feedbackRequest);
return null;
return getDataTable(feedbackResponseList);
}
@ApiOperation("生产报工记录")
@PreAuthorize("@ss.hasPermi('mes:pro:feedback:get')")
@Log(title = "生产报工记录:统计方式工单", businessType = BusinessType.QUERY)
@GetMapping("/getListByWorkOrder")
public TableDataInfo getListByWorkOrder(@RequestBody FeedbackRequest feedbackRequest) {
startPage();
List<FeedbackResponse> feedbackResponseList = feedbackService.getListByWorkOrder(feedbackRequest);
DecimalFormat df = new DecimalFormat("0.00%");
for(FeedbackResponse feedbackResponse : feedbackResponseList){
if(feedbackResponse.getQuantityFeedback() != null
&& feedbackResponse.getQuantityFeedback().compareTo(BigDecimal.ZERO) != 0
&& feedbackResponse.getQuantityUnqualify()!= null ){
feedbackResponse.setQualificationRate(df.format((feedbackResponse.getQuantityQualify().divide(feedbackResponse.getQuantityFeedback()).doubleValue())));
}else{
feedbackResponse.setQualificationRate("0.00%");
}
}
return getDataTable(feedbackResponseList);
}
@ApiOperation("生产报工记录:统计方式车间")
@PreAuthorize("@ss.hasPermi('mes:pro:feedback:get')")
@Log(title = "生产报工记录:统计方式车间", businessType = BusinessType.QUERY)
@GetMapping("/getListByWorkshop")
public TableDataInfo getListByWorkshop(@RequestBody FeedbackRequest feedbackRequest) {
startPage();
List<FeedbackResponse> feedbackResponseList = feedbackService.getListByWorkshop(feedbackRequest);
DecimalFormat df = new DecimalFormat("0.00%");
for(FeedbackResponse feedbackResponse : feedbackResponseList){
if(feedbackResponse.getQuantityFeedback() != null
&& feedbackResponse.getQuantityFeedback().compareTo(BigDecimal.ZERO) != 0
&& feedbackResponse.getQuantityUnqualify()!= null ){
feedbackResponse.setQualificationRate(df.format((feedbackResponse.getQuantityQualify().divide(feedbackResponse.getQuantityFeedback()).doubleValue())));
}else{
feedbackResponse.setQualificationRate("0.00%");
}
}
return getDataTable(feedbackResponseList);
}
@ApiOperation("生产报工记录:统计方式工作中心")
@PreAuthorize("@ss.hasPermi('mes:pro:feedback:get')")
@Log(title = "生产报工记录:统计方式工作中心", businessType = BusinessType.QUERY)
@GetMapping("/getListByWorkstation")
public TableDataInfo getListByWorkstation(@RequestBody FeedbackRequest feedbackRequest) {
startPage();
List<FeedbackResponse> feedbackResponseList = feedbackService.getListByWorkstation(feedbackRequest);
DecimalFormat df = new DecimalFormat("0.00%");
for(FeedbackResponse feedbackResponse : feedbackResponseList){
if(feedbackResponse.getQuantityFeedback() != null
&& feedbackResponse.getQuantityFeedback().compareTo(BigDecimal.ZERO) != 0
&& feedbackResponse.getQuantityUnqualify()!= null ){
feedbackResponse.setQualificationRate(df.format((feedbackResponse.getQuantityQualify().divide(feedbackResponse.getQuantityFeedback()).doubleValue())));
}else{
feedbackResponse.setQualificationRate("0.00%");
}
}
return getDataTable(feedbackResponseList);
}
@ApiOperation("生产报工记录:统计方式工作单元")
@PreAuthorize("@ss.hasPermi('mes:pro:feedback:get')")
@Log(title = "生产报工记录:统计方式工作单元", businessType = BusinessType.QUERY)
@GetMapping("/getListByWorkunit")
public TableDataInfo getListByWorkunit(@RequestBody FeedbackRequest feedbackRequest) {
startPage();
List<FeedbackResponse> feedbackResponseList = feedbackService.getListByWorkunit(feedbackRequest);
DecimalFormat df = new DecimalFormat("0.00%");
for(FeedbackResponse feedbackResponse : feedbackResponseList){
if(feedbackResponse.getQuantityFeedback() != null
&& feedbackResponse.getQuantityFeedback().compareTo(BigDecimal.ZERO) != 0
&& feedbackResponse.getQuantityUnqualify()!= null ){
feedbackResponse.setQualificationRate(df.format((feedbackResponse.getQuantityQualify().divide(feedbackResponse.getQuantityFeedback()).doubleValue())));
}else{
feedbackResponse.setQualificationRate("0.00%");
}
}
return getDataTable(feedbackResponseList);
}
@ApiOperation("生产报工记录:统计方式工序")
@PreAuthorize("@ss.hasPermi('mes:pro:feedback:get')")
@Log(title = "生产报工记录:统计方式工序", businessType = BusinessType.QUERY)
@GetMapping("/getListByProcess")
public TableDataInfo getListByProcess(@RequestBody FeedbackRequest feedbackRequest) {
startPage();
List<FeedbackResponse> feedbackResponseList = feedbackService.getListByProcess(feedbackRequest);
DecimalFormat df = new DecimalFormat("0.00%");
for(FeedbackResponse feedbackResponse : feedbackResponseList){
if(feedbackResponse.getQuantityFeedback() != null
&& feedbackResponse.getQuantityFeedback().compareTo(BigDecimal.ZERO) != 0
&& feedbackResponse.getQuantityUnqualify()!= null ){
feedbackResponse.setQualificationRate(df.format((feedbackResponse.getQuantityQualify().divide(feedbackResponse.getQuantityFeedback()).doubleValue())));
}else{
feedbackResponse.setQualificationRate("0.00%");
}
}
return getDataTable(feedbackResponseList);
}
@ApiOperation("生产报工记录:统计方式工序")
@PreAuthorize("@ss.hasPermi('mes:pro:feedback:get')")
@Log(title = "生产报工记录:统计方式工序", businessType = BusinessType.QUERY)
@GetMapping("/getListByUser")
public TableDataInfo getListByUser(@RequestBody FeedbackRequest feedbackRequest) {
startPage();
List<FeedbackResponse> feedbackResponseList = feedbackService.getListByUser(feedbackRequest);
DecimalFormat df = new DecimalFormat("0.00%");
for(FeedbackResponse feedbackResponse : feedbackResponseList){
if(feedbackResponse.getQuantityFeedback() != null
&& feedbackResponse.getQuantityFeedback().compareTo(BigDecimal.ZERO) != 0
&& feedbackResponse.getQuantityUnqualify()!= null ){
feedbackResponse.setQualificationRate(df.format((feedbackResponse.getQuantityQualify().divide(feedbackResponse.getQuantityFeedback()).doubleValue())));
}else{
feedbackResponse.setQualificationRate("0.00%");
}
}
return getDataTable(feedbackResponseList);
}
}
......@@ -4,10 +4,11 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import com.ximai.common.annotation.Excel;
import com.ximai.mes.pro.domain.ProFeedback;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class FeedbackResponse extends ProFeedback {
/**
* 工单类型,项目号,订单号,
......@@ -38,6 +39,8 @@ public class FeedbackResponse extends ProFeedback {
@ApiModelProperty(name = "工单编码")
private String workorderCode;
@ApiModelProperty(name = "工单名称")
private String workorderName;
/**
* 产品编号
*/
......@@ -56,6 +59,13 @@ public class FeedbackResponse extends ProFeedback {
@ApiModelProperty(name = "工序任务号")
private String taskCode;
/**
* 工序名称
*/
@ApiModelProperty(name = "工序编码")
private String processCode;
/**
* 工序名称
*/
......@@ -82,6 +92,12 @@ public class FeedbackResponse extends ProFeedback {
@ApiModelProperty("工作单元ID")
private Long workunitId;
/**
*
*/
@ApiModelProperty("工作单元编码")
private String workunitCode;
@ApiModelProperty("工作单元名称")
private String workunitName;
......@@ -138,4 +154,13 @@ public class FeedbackResponse extends ProFeedback {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(name = "报工时间")
private Date feedbackTime;
@ApiModelProperty("良率")
private String qualificationRate;
@ApiModelProperty("车间编号")
private String workshopCode;
@ApiModelProperty("车间名称")
private String workshopName;
}
......@@ -7,4 +7,16 @@ import java.util.List;
public interface FeedbackService {
List<FeedbackResponse> getList(FeedbackRequest feedbackRequest);
List<FeedbackResponse> getListByWorkOrder(FeedbackRequest feedbackRequest);
List<FeedbackResponse> getListByWorkshop(FeedbackRequest feedbackRequest);
List<FeedbackResponse> getListByWorkstation(FeedbackRequest feedbackRequest);
List<FeedbackResponse> getListByWorkunit(FeedbackRequest feedbackRequest);
List<FeedbackResponse> getListByProcess(FeedbackRequest feedbackRequest);
List<FeedbackResponse> getListByUser(FeedbackRequest feedbackRequest);
}
......@@ -19,4 +19,34 @@ public class FeedbackServiceImp implements FeedbackService {
public List<FeedbackResponse> getList(FeedbackRequest feedbackRequest) {
return proFeedbackMapper.getList(feedbackRequest);
}
@Override
public List<FeedbackResponse> getListByWorkOrder(FeedbackRequest feedbackRequest) {
return proFeedbackMapper.getListByWorkOrder(feedbackRequest);
}
@Override
public List<FeedbackResponse> getListByWorkshop(FeedbackRequest feedbackRequest) {
return proFeedbackMapper.getListByWorkshop(feedbackRequest);
}
@Override
public List<FeedbackResponse> getListByWorkstation(FeedbackRequest feedbackRequest) {
return proFeedbackMapper.getListByWorkstation(feedbackRequest);
}
@Override
public List<FeedbackResponse> getListByWorkunit(FeedbackRequest feedbackRequest) {
return proFeedbackMapper.getListByWorkunit(feedbackRequest);
}
@Override
public List<FeedbackResponse> getListByProcess(FeedbackRequest feedbackRequest) {
return proFeedbackMapper.getListByProcess(feedbackRequest);
}
@Override
public List<FeedbackResponse> getListByUser(FeedbackRequest feedbackRequest) {
return proFeedbackMapper.getListByUser(feedbackRequest);
}
}
......@@ -216,6 +216,220 @@
<if test=" startDate != null and endDate != null">and feedback_time BETWEEN #{startDate} AND #{endDate}</if>
</where>
</select>
<select id="getListByWorkOrder" resultType="com.ximai.mes.report.response.FeedbackResponse">
select
workorder.workorder_Type,
workorder.customer_Project_No,
workorder.workorder_name,
workorder.order_Code,
workorder.workorder_Code,
workorder.product_Code,
workorder.product_Name,
sum(f.quantity) quantity,
sum(f.quantity_qualify) quantity_qualify,
sum(f.quantity_unqualify) quantity_unqualify,
sum(f.quantity_feedback) quantity_feedback
from pro_feedback f
left join pro_task_workunit workunit on workunit.task_id = f.task_id
left join pro_task pt on f.task_id = pt.task_id
left join pro_workorder workorder on workorder.workorder_id = f.workorder_id
LEFT JOIN md_item it ON it.item_id = f.item_id
left join md_workunit mw on workunit.workunit_id = mw.workunit_id
left join md_workstation workstation on workstation.workstation_id = mw.workstation_id
<where>
<if test="workorderType != null and workorderType != ''">and workorder.workorder_Type = #{workorderType}</if>
<if test="customerProjectNo!= null and customerProjectNo != '' ">and workorder.customer_Project_No like '%${customerProjectNo}%'</if>
<if test="orderCode != null and orderCode != '' ">and workorder.order_Code like '%${orderCode}%'</if>
<if test="workorderCode != null and workorderCode != '' ">and workorder.workorder_Code like '%${workorderCode}%' </if>
<if test="taskCode != null and taskCode != '' ">and pt.task_Code like '%${taskCode}%'</if>
<if test="productCode != null and productCode != '' ">and workorder.product_Code like '%${productCode}%' </if>
<if test=" productId != null">and workorder.product_Id = #{productId}</if>
<if test=" processId != null ">and pt.process_id = #{processId}</if>
<if test=" workshopId != null">and workstation.workshop_Id = #{workshopId}</if>
<if test=" workstationId != null">and workstation.workstation_id = #{workstationId} </if>
<if test=" workunitId != null">and workunit.workunit_id = #{workunitId}</if>
<if test=" userName != null and userName != '' ">and f.user_Name like '%${userName}%%'</if>
<if test=" startDate != null and endDate != null">and feedback_time BETWEEN #{startDate} AND #{endDate}</if>
</where>
group by
workorder.workorder_Type,
workorder.customer_Project_No,
workorder.workorder_name,
workorder.order_Code,
workorder.workorder_Code,
workorder.product_Code,
workorder.product_Name
</select>
<select id="getListByWorkshop" resultType="com.ximai.mes.report.response.FeedbackResponse">
select
workstation.workshop_code,
workstation.workshop_name,
sum(f.quantity) quantity,
sum(f.quantity_qualify) quantity_qualify,
sum(f.quantity_unqualify) quantity_unqualify,
sum(f.quantity_feedback) quantity_feedback
from pro_feedback f
left join pro_task_workunit workunit on workunit.task_id = f.task_id
left join pro_task pt on f.task_id = pt.task_id
left join pro_workorder workorder on workorder.workorder_id = f.workorder_id
LEFT JOIN md_item it ON it.item_id = f.item_id
left join md_workunit mw on workunit.workunit_id = mw.workunit_id
left join md_workstation workstation on workstation.workstation_id = mw.workstation_id
<where>
<if test="workorderType != null and workorderType != ''">and workorder.workorder_Type = #{workorderType}</if>
<if test="customerProjectNo!= null and customerProjectNo != '' ">and workorder.customer_Project_No like '%${customerProjectNo}%'</if>
<if test="orderCode != null and orderCode != '' ">and workorder.order_Code like '%${orderCode}%'</if>
<if test="workorderCode != null and workorderCode != '' ">and workorder.workorder_Code like '%${workorderCode}%' </if>
<if test="taskCode != null and taskCode != '' ">and pt.task_Code like '%${taskCode}%'</if>
<if test="productCode != null and productCode != '' ">and workorder.product_Code like '%${productCode}%' </if>
<if test=" productId != null">and workorder.product_Id = #{productId}</if>
<if test=" processId != null ">and pt.process_id = #{processId}</if>
<if test=" workshopId != null">and workstation.workshop_Id = #{workshopId}</if>
<if test=" workstationId != null">and workstation.workstation_id = #{workstationId} </if>
<if test=" workunitId != null">and workunit.workunit_id = #{workunitId}</if>
<if test=" userName != null and userName != '' ">and f.user_Name like '%${userName}%%'</if>
<if test=" startDate != null and endDate != null">and feedback_time BETWEEN #{startDate} AND #{endDate}</if>
</where>
group by
workstation.workshop_code,
workstation.workshop_name
</select>
<select id="getListByWorkstation" resultType="com.ximai.mes.report.response.FeedbackResponse">
select
workstation.workstation_code,
workstation.workstation_name,
sum(f.quantity) quantity,
sum(f.quantity_qualify) quantity_qualify,
sum(f.quantity_unqualify) quantity_unqualify,
sum(f.quantity_feedback) quantity_feedback
from pro_feedback f
left join pro_task_workunit workunit on workunit.task_id = f.task_id
left join pro_task pt on f.task_id = pt.task_id
left join pro_workorder workorder on workorder.workorder_id = f.workorder_id
LEFT JOIN md_item it ON it.item_id = f.item_id
left join md_workunit mw on workunit.workunit_id = mw.workunit_id
left join md_workstation workstation on workstation.workstation_id = mw.workstation_id
<where>
<if test="workorderType != null and workorderType != ''">and workorder.workorder_Type = #{workorderType}</if>
<if test="customerProjectNo!= null and customerProjectNo != '' ">and workorder.customer_Project_No like '%${customerProjectNo}%'</if>
<if test="orderCode != null and orderCode != '' ">and workorder.order_Code like '%${orderCode}%'</if>
<if test="workorderCode != null and workorderCode != '' ">and workorder.workorder_Code like '%${workorderCode}%' </if>
<if test="taskCode != null and taskCode != '' ">and pt.task_Code like '%${taskCode}%'</if>
<if test="productCode != null and productCode != '' ">and workorder.product_Code like '%${productCode}%' </if>
<if test=" productId != null">and workorder.product_Id = #{productId}</if>
<if test=" processId != null ">and pt.process_id = #{processId}</if>
<if test=" workshopId != null">and workstation.workshop_Id = #{workshopId}</if>
<if test=" workstationId != null">and workstation.workstation_id = #{workstationId} </if>
<if test=" workunitId != null">and workunit.workunit_id = #{workunitId}</if>
<if test=" userName != null and userName != '' ">and f.user_Name like '%${userName}%%'</if>
<if test=" startDate != null and endDate != null">and feedback_time BETWEEN #{startDate} AND #{endDate}</if>
</where>
group by
workstation.workstation_code,
workstation.workstation_name
</select>
<select id="getListByWorkunit" resultType="com.ximai.mes.report.response.FeedbackResponse">
select
workunit.workunit_code,
workunit.workunit_name,
sum(f.quantity) quantity,
sum(f.quantity_qualify) quantity_qualify,
sum(f.quantity_unqualify) quantity_unqualify,
sum(f.quantity_feedback) quantity_feedback
from pro_feedback f
left join pro_task_workunit workunit on workunit.task_id = f.task_id
left join pro_task pt on f.task_id = pt.task_id
left join pro_workorder workorder on workorder.workorder_id = f.workorder_id
LEFT JOIN md_item it ON it.item_id = f.item_id
left join md_workunit mw on workunit.workunit_id = mw.workunit_id
left join md_workstation workstation on workstation.workstation_id = mw.workstation_id
<where>
<if test="workorderType != null and workorderType != ''">and workorder.workorder_Type = #{workorderType}</if>
<if test="customerProjectNo!= null and customerProjectNo != '' ">and workorder.customer_Project_No like '%${customerProjectNo}%'</if>
<if test="orderCode != null and orderCode != '' ">and workorder.order_Code like '%${orderCode}%'</if>
<if test="workorderCode != null and workorderCode != '' ">and workorder.workorder_Code like '%${workorderCode}%' </if>
<if test="taskCode != null and taskCode != '' ">and pt.task_Code like '%${taskCode}%'</if>
<if test="productCode != null and productCode != '' ">and workorder.product_Code like '%${productCode}%' </if>
<if test=" productId != null">and workorder.product_Id = #{productId}</if>
<if test=" processId != null ">and pt.process_id = #{processId}</if>
<if test=" workshopId != null">and workstation.workshop_Id = #{workshopId}</if>
<if test=" workstationId != null">and workstation.workstation_id = #{workstationId} </if>
<if test=" workunitId != null">and workunit.workunit_id = #{workunitId}</if>
<if test=" userName != null and userName != '' ">and f.user_Name like '%${userName}%%'</if>
<if test=" startDate != null and endDate != null">and feedback_time BETWEEN #{startDate} AND #{endDate}</if>
</where>
group by
workunit.workunit_code,
workunit.workunit_name
</select>
<select id="getListByProcess" resultType="com.ximai.mes.report.response.FeedbackResponse">
select
pt.process_code,
pt.process_name,
sum(f.quantity) quantity,
sum(f.quantity_qualify) quantity_qualify,
sum(f.quantity_unqualify) quantity_unqualify,
sum(f.quantity_feedback) quantity_feedback
from pro_feedback f
left join pro_task_workunit workunit on workunit.task_id = f.task_id
left join pro_task pt on f.task_id = pt.task_id
left join pro_workorder workorder on workorder.workorder_id = f.workorder_id
LEFT JOIN md_item it ON it.item_id = f.item_id
left join md_workunit mw on workunit.workunit_id = mw.workunit_id
left join md_workstation workstation on workstation.workstation_id = mw.workstation_id
<where>
<if test="workorderType != null and workorderType != ''">and workorder.workorder_Type = #{workorderType}</if>
<if test="customerProjectNo!= null and customerProjectNo != '' ">and workorder.customer_Project_No like '%${customerProjectNo}%'</if>
<if test="orderCode != null and orderCode != '' ">and workorder.order_Code like '%${orderCode}%'</if>
<if test="workorderCode != null and workorderCode != '' ">and workorder.workorder_Code like '%${workorderCode}%' </if>
<if test="taskCode != null and taskCode != '' ">and pt.task_Code like '%${taskCode}%'</if>
<if test="productCode != null and productCode != '' ">and workorder.product_Code like '%${productCode}%' </if>
<if test=" productId != null">and workorder.product_Id = #{productId}</if>
<if test=" processId != null ">and pt.process_id = #{processId}</if>
<if test=" workshopId != null">and workstation.workshop_Id = #{workshopId}</if>
<if test=" workstationId != null">and workstation.workstation_id = #{workstationId} </if>
<if test=" workunitId != null">and workunit.workunit_id = #{workunitId}</if>
<if test=" userName != null and userName != '' ">and f.user_Name like '%${userName}%%'</if>
<if test=" startDate != null and endDate != null">and feedback_time BETWEEN #{startDate} AND #{endDate}</if>
</where>
group by
pt.process_code,
pt.process_name
</select>
<select id="getListByUser" resultType="com.ximai.mes.report.response.FeedbackResponse">
select
f.user_name,
f.nick_name,
sum(f.quantity) quantity,
sum(f.quantity_qualify) quantity_qualify,
sum(f.quantity_unqualify) quantity_unqualify,
sum(f.quantity_feedback) quantity_feedback
from pro_feedback f
left join pro_task_workunit workunit on workunit.task_id = f.task_id
left join pro_task pt on f.task_id = pt.task_id
left join pro_workorder workorder on workorder.workorder_id = f.workorder_id
LEFT JOIN md_item it ON it.item_id = f.item_id
left join md_workunit mw on workunit.workunit_id = mw.workunit_id
left join md_workstation workstation on workstation.workstation_id = mw.workstation_id
<where>
<if test="workorderType != null and workorderType != ''">and workorder.workorder_Type = #{workorderType}</if>
<if test="customerProjectNo!= null and customerProjectNo != '' ">and workorder.customer_Project_No like '%${customerProjectNo}%'</if>
<if test="orderCode != null and orderCode != '' ">and workorder.order_Code like '%${orderCode}%'</if>
<if test="workorderCode != null and workorderCode != '' ">and workorder.workorder_Code like '%${workorderCode}%' </if>
<if test="taskCode != null and taskCode != '' ">and pt.task_Code like '%${taskCode}%'</if>
<if test="productCode != null and productCode != '' ">and workorder.product_Code like '%${productCode}%' </if>
<if test=" productId != null">and workorder.product_Id = #{productId}</if>
<if test=" processId != null ">and pt.process_id = #{processId}</if>
<if test=" workshopId != null">and workstation.workshop_Id = #{workshopId}</if>
<if test=" workstationId != null">and workstation.workstation_id = #{workstationId} </if>
<if test=" workunitId != null">and workunit.workunit_id = #{workunitId}</if>
<if test=" userName != null and userName != '' ">and f.user_Name like '%${userName}%%'</if>
<if test=" startDate != null and endDate != null">and feedback_time BETWEEN #{startDate} AND #{endDate}</if>
</where>
group by
f.user_name,
f.nick_name
</select>
<insert id="insertProFeedback" parameterType="ProFeedback" useGeneratedKeys="true" keyProperty="recordId">
insert into pro_feedback
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment