text:修改故障展示(改为双表)
parent
e39c5cb11c
commit
4e4d7c2f82
|
@ -22,19 +22,15 @@ public interface SysCarFaultLogMapper extends BaseMapper<SysCarFaultLog> {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Select("SELECT fault.fault_code,log.update_time,log.create_time,log.vin,log.status FROM sys_car_fault_log log \n" +
|
|
||||||
"LEFT JOIN sys_car_fault fault on log.sys_car_fault_id=fault.id ")
|
|
||||||
public List<SysCarFaultLog>list(SysCarFaultLog SysCarFaultLog);
|
|
||||||
|
|
||||||
@Select("SELECT fault.fault_code,log.update_time,log.create_time,log.vin,log.status FROM sys_car_fault_log log \n" +
|
public List<SysCarFaultLog>selectSysCarFaultLogList(SysCarFaultLog SysCarFaultLog);
|
||||||
"LEFT JOIN sys_car_fault fault on log.sys_car_fault_id=fault.id where log.status=1")
|
|
||||||
|
|
||||||
public List<SysCarFaultLog>listStatusSolve(SysCarFaultLog sysCarFaultLog);
|
public List<SysCarFaultLog>listStatusSolve(SysCarFaultLog sysCarFaultLog);
|
||||||
|
|
||||||
@Select("SELECT fault.fault_code,log.update_time,log.create_time,log.vin,log.status FROM sys_car_fault_log log \n" +
|
|
||||||
"LEFT JOIN sys_car_fault fault on log.sys_car_fault_id=fault.id where log.status=2")
|
|
||||||
public List<SysCarFaultLog>listStatusProcess(SysCarFaultLog sysCarFaultLog);
|
public List<SysCarFaultLog>listStatusProcess(SysCarFaultLog sysCarFaultLog);
|
||||||
|
|
||||||
@Select("SELECT fault.fault_code,log.update_time,log.create_time,log.vin,log.status FROM sys_car_fault_log log \n" +
|
|
||||||
"LEFT JOIN sys_car_fault fault on log.sys_car_fault_id=fault.id where log.status=3")
|
|
||||||
public List<SysCarFaultLog>listStatusIgnore(SysCarFaultLog sysCarFaultLog);
|
public List<SysCarFaultLog>listStatusIgnore(SysCarFaultLog sysCarFaultLog);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.muyu.breakdown.service.impl;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.muyu.breakdown.domain.SysCarFault;
|
||||||
import com.muyu.breakdown.domain.SysCarFaultLog;
|
import com.muyu.breakdown.domain.SysCarFaultLog;
|
||||||
import com.muyu.breakdown.domain.SysCarFaultLog;
|
import com.muyu.breakdown.domain.SysCarFaultLog;
|
||||||
import com.muyu.breakdown.mapper.SysCarFaultLogMapper;
|
import com.muyu.breakdown.mapper.SysCarFaultLogMapper;
|
||||||
|
@ -31,14 +32,8 @@ public class sysCarFaultLogServiceImpl extends ServiceImpl<SysCarFaultLogMapper,
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<SysCarFaultLog> selectSysCarFaultLogList(SysCarFaultLog sysCarFaultLog) {
|
public List<SysCarFaultLog> selectSysCarFaultLogList(SysCarFaultLog sysCarFaultLog) {
|
||||||
LambdaQueryWrapper<SysCarFaultLog> wrapper = new LambdaQueryWrapper<>();
|
|
||||||
if (StringUtils.isNotEmpty(sysCarFaultLog.getVin())){
|
return sysCarFaultLogMapper.selectSysCarFaultLogList(sysCarFaultLog);
|
||||||
wrapper.eq(SysCarFaultLog::getVin,sysCarFaultLog.getVin());
|
|
||||||
}
|
|
||||||
if (sysCarFaultLog.getStatus()!=null){
|
|
||||||
wrapper.eq(SysCarFaultLog::getStatus,sysCarFaultLog.getStatus());
|
|
||||||
}
|
|
||||||
return sysCarFaultLogMapper.list(sysCarFaultLog);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -48,10 +43,7 @@ public class sysCarFaultLogServiceImpl extends ServiceImpl<SysCarFaultLogMapper,
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysCarFaultLog> listStatusIgnore(SysCarFaultLog sysCarFaultLog) {
|
public List<SysCarFaultLog> listStatusIgnore(SysCarFaultLog sysCarFaultLog) {
|
||||||
LambdaQueryWrapper<SysCarFaultLog> wrapper = new LambdaQueryWrapper<>();
|
|
||||||
if (StringUtils.isNotEmpty(sysCarFaultLog.getVin())){
|
|
||||||
wrapper.eq(SysCarFaultLog::getVin,sysCarFaultLog.getVin());
|
|
||||||
}
|
|
||||||
return sysCarFaultLogMapper.listStatusIgnore(sysCarFaultLog);
|
return sysCarFaultLogMapper.listStatusIgnore(sysCarFaultLog);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,20 +54,13 @@ public class sysCarFaultLogServiceImpl extends ServiceImpl<SysCarFaultLogMapper,
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysCarFaultLog> listStatusProcess(SysCarFaultLog sysCarFaultLog) {
|
public List<SysCarFaultLog> listStatusProcess(SysCarFaultLog sysCarFaultLog) {
|
||||||
LambdaQueryWrapper<SysCarFaultLog> wrapper = new LambdaQueryWrapper<>();
|
|
||||||
if (StringUtils.isNotEmpty(sysCarFaultLog.getVin())){
|
|
||||||
wrapper.eq(SysCarFaultLog::getVin,sysCarFaultLog.getVin());
|
|
||||||
}
|
|
||||||
return sysCarFaultLogMapper.listStatusProcess(sysCarFaultLog);
|
return sysCarFaultLogMapper.listStatusProcess(sysCarFaultLog);
|
||||||
}
|
}
|
||||||
|
|
||||||
//只展示已解决的数据
|
//只展示已解决的数据
|
||||||
@Override
|
@Override
|
||||||
public List<SysCarFaultLog> listStatusSolve(SysCarFaultLog sysCarFaultLog) {
|
public List<SysCarFaultLog> listStatusSolve(SysCarFaultLog sysCarFaultLog) {
|
||||||
LambdaQueryWrapper<SysCarFaultLog> wrapper = new LambdaQueryWrapper<>();
|
|
||||||
if (StringUtils.isNotEmpty(sysCarFaultLog.getVin())){
|
|
||||||
wrapper.eq(SysCarFaultLog::getVin,sysCarFaultLog.getVin());
|
|
||||||
}
|
|
||||||
return sysCarFaultLogMapper.listStatusSolve(sysCarFaultLog);
|
return sysCarFaultLogMapper.listStatusSolve(sysCarFaultLog);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,66 @@
|
||||||
|
<?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.muyu.breakdown.mapper.SysCarFaultLogMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.muyu.breakdown.domain.SysCarFaultLog" id="SysCarFaultLogResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="sysCarFaultId" column="sys_car_fault_id"/>
|
||||||
|
<result property="faultCode" column="fault_code"/>
|
||||||
|
<result property="vin" column="vin"/>
|
||||||
|
<result property="status" column="status" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectSysCarFaultLogVo">
|
||||||
|
SELECT fault.fault_code,log.update_time,log.create_time,log.vin,log.status FROM sys_car_fault_log log LEFT JOIN sys_car_fault fault on log.sys_car_fault_id=fault.id
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectSysCarFaultLogList" parameterType="com.muyu.breakdown.domain.SysCarFaultLog" resultMap="SysCarFaultLogResult">
|
||||||
|
<include refid="selectSysCarFaultLogVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="faultCode != null and faultCode != ''"> and fault.fault_code = #{faultCode}</if>
|
||||||
|
<if test="vin != null and vin != ''"> and log.vin = #{vin}</if>
|
||||||
|
<if test="status != null "> and log.status = #{status}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
<select id="listStatusSolve" resultType="com.muyu.breakdown.domain.SysCarFaultLog" resultMap="SysCarFaultLogResult">
|
||||||
|
<include refid="selectSysCarFaultLogVo" />
|
||||||
|
<where>
|
||||||
|
<if test="faultCode!=null and faultCode!=''">and fault.fault_code=#{faultCode}</if>
|
||||||
|
<if test="vin!=null and vin!=''">and log.vin=#{vin}</if>
|
||||||
|
and log.status=1
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
<select id="listStatusProcess" resultType="com.muyu.breakdown.domain.SysCarFaultLog" resultMap="SysCarFaultLogResult">
|
||||||
|
<include refid="selectSysCarFaultLogVo" />
|
||||||
|
<where>
|
||||||
|
<if test="faultCode!=null and faultCode!=''">and fault.fault_code=#{faultCode}</if>
|
||||||
|
<if test="vin!=null and vin!=''">and log.vin=#{vin}</if>
|
||||||
|
and log.status=2
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
<select id="listStatusIgnore" resultType="com.muyu.breakdown.domain.SysCarFaultLog" resultMap="SysCarFaultLogResult">
|
||||||
|
<include refid="selectSysCarFaultLogVo" />
|
||||||
|
<where>
|
||||||
|
<if test="faultCode!=null and faultCode!=''">and fault.fault_code=#{faultCode}</if>
|
||||||
|
<if test="vin!=null and vin!=''">and log.vin=#{vin}</if>
|
||||||
|
and log.status=3
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<delete id="deleteSysCarFaultByIds" parameterType="String">
|
||||||
|
delete from sys_car_fault where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue