故障码业务实现 2
parent
5a964fa9f5
commit
6a9e8c3097
|
@ -0,0 +1,103 @@
|
|||
package com.zhilian.system.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.zhilian.common.log.annotation.Log;
|
||||
import com.zhilian.common.log.enums.BusinessType;
|
||||
import com.zhilian.common.security.annotation.RequiresPermissions;
|
||||
import com.zhilian.system.domain.BusinessBreak;
|
||||
import com.zhilian.system.service.IBusinessBreakService;
|
||||
import com.zhilian.common.core.web.controller.BaseController;
|
||||
import com.zhilian.common.core.domain.Result;
|
||||
import com.zhilian.common.core.utils.poi.ExcelUtil;
|
||||
import com.zhilian.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author y
|
||||
* @date 2024-04-07
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/break")
|
||||
public class BusinessBreakController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IBusinessBreakService businessBreakService;
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
@RequiresPermissions("system:break:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<BusinessBreak>> list(BusinessBreak businessBreak)
|
||||
{
|
||||
startPage();
|
||||
List<BusinessBreak> list = businessBreakService.selectBusinessBreakList(businessBreak);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出列表
|
||||
*/
|
||||
@RequiresPermissions("system:break:export")
|
||||
@Log(title = "", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BusinessBreak businessBreak)
|
||||
{
|
||||
List<BusinessBreak> list = businessBreakService.selectBusinessBreakList(businessBreak);
|
||||
ExcelUtil<BusinessBreak> util = new ExcelUtil<BusinessBreak>(BusinessBreak.class);
|
||||
util.exportExcel(response, list, "故障码数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取详细信息
|
||||
*/
|
||||
@RequiresPermissions("system:break:query")
|
||||
@GetMapping(value = "/{breakId}")
|
||||
public Result getInfo(@PathVariable("breakId") Long breakId)
|
||||
{
|
||||
return success(businessBreakService.selectBusinessBreakByBreakId(breakId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@RequiresPermissions("system:break:add")
|
||||
@Log(title = "", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public Result add(@RequestBody BusinessBreak businessBreak)
|
||||
{
|
||||
return toAjax(businessBreakService.insertBusinessBreak(businessBreak));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequiresPermissions("system:break:edit")
|
||||
@Log(title = "", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public Result edit(@RequestBody BusinessBreak businessBreak)
|
||||
{
|
||||
return toAjax(businessBreakService.updateBusinessBreak(businessBreak));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequiresPermissions("system:break:remove")
|
||||
@Log(title = "", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{breakIds}")
|
||||
public Result remove(@PathVariable Long[] breakIds)
|
||||
{
|
||||
return toAjax(businessBreakService.deleteBusinessBreakByBreakIds(breakIds));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,150 @@
|
|||
package com.zhilian.system.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.zhilian.common.core.annotation.Excel;
|
||||
import com.zhilian.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author zhilian
|
||||
* @date 2024-04-07
|
||||
*/
|
||||
public class BusinessBreak extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long breakId;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String breakCar;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String breakVin;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Date breakTime;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String breakType;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String breakRank;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String breakState;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String breakDevice;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String breakDesc;
|
||||
|
||||
public void setBreakId(Long breakId)
|
||||
{
|
||||
this.breakId = breakId;
|
||||
}
|
||||
|
||||
public Long getBreakId()
|
||||
{
|
||||
return breakId;
|
||||
}
|
||||
public void setBreakCar(String breakCar)
|
||||
{
|
||||
this.breakCar = breakCar;
|
||||
}
|
||||
|
||||
public String getBreakCar()
|
||||
{
|
||||
return breakCar;
|
||||
}
|
||||
public void setBreakVin(String breakVin)
|
||||
{
|
||||
this.breakVin = breakVin;
|
||||
}
|
||||
|
||||
public String getBreakVin()
|
||||
{
|
||||
return breakVin;
|
||||
}
|
||||
public void setBreakTime(Date breakTime)
|
||||
{
|
||||
this.breakTime = breakTime;
|
||||
}
|
||||
|
||||
public Date getBreakTime()
|
||||
{
|
||||
return breakTime;
|
||||
}
|
||||
public void setBreakType(String breakType)
|
||||
{
|
||||
this.breakType = breakType;
|
||||
}
|
||||
|
||||
public String getBreakType()
|
||||
{
|
||||
return breakType;
|
||||
}
|
||||
public void setBreakRank(String breakRank)
|
||||
{
|
||||
this.breakRank = breakRank;
|
||||
}
|
||||
|
||||
public String getBreakRank()
|
||||
{
|
||||
return breakRank;
|
||||
}
|
||||
public void setBreakState(String breakState)
|
||||
{
|
||||
this.breakState = breakState;
|
||||
}
|
||||
|
||||
public String getBreakState()
|
||||
{
|
||||
return breakState;
|
||||
}
|
||||
public void setBreakDevice(String breakDevice)
|
||||
{
|
||||
this.breakDevice = breakDevice;
|
||||
}
|
||||
|
||||
public String getBreakDevice()
|
||||
{
|
||||
return breakDevice;
|
||||
}
|
||||
public void setBreakDesc(String breakDesc)
|
||||
{
|
||||
this.breakDesc = breakDesc;
|
||||
}
|
||||
|
||||
public String getBreakDesc()
|
||||
{
|
||||
return breakDesc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("breakId", getBreakId())
|
||||
.append("breakCar", getBreakCar())
|
||||
.append("breakVin", getBreakVin())
|
||||
.append("breakTime", getBreakTime())
|
||||
.append("breakType", getBreakType())
|
||||
.append("breakRank", getBreakRank())
|
||||
.append("breakState", getBreakState())
|
||||
.append("breakDevice", getBreakDevice())
|
||||
.append("breakDesc", getBreakDesc())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package com.zhilian.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.zhilian.system.domain.BusinessBreak;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author zhilian
|
||||
* @date 2024-04-07
|
||||
*/
|
||||
public interface BusinessBreakMapper
|
||||
{
|
||||
|
||||
public BusinessBreak selectBusinessBreakByBreakId(Long breakId);
|
||||
|
||||
|
||||
public List<BusinessBreak> selectBusinessBreakList(BusinessBreak businessBreak);
|
||||
|
||||
|
||||
public int insertBusinessBreak(BusinessBreak businessBreak);
|
||||
|
||||
|
||||
public int updateBusinessBreak(BusinessBreak businessBreak);
|
||||
|
||||
|
||||
public int deleteBusinessBreakByBreakId(Long breakId);
|
||||
|
||||
|
||||
public int deleteBusinessBreakByBreakIds(Long[] breakIds);
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package com.zhilian.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.zhilian.system.domain.BusinessBreak;
|
||||
|
||||
|
||||
public interface IBusinessBreakService
|
||||
{
|
||||
|
||||
public BusinessBreak selectBusinessBreakByBreakId(Long breakId);
|
||||
|
||||
|
||||
public List<BusinessBreak> selectBusinessBreakList(BusinessBreak businessBreak);
|
||||
|
||||
|
||||
public int insertBusinessBreak(BusinessBreak businessBreak);
|
||||
|
||||
public int updateBusinessBreak(BusinessBreak businessBreak);
|
||||
|
||||
|
||||
public int deleteBusinessBreakByBreakIds(Long[] breakIds);
|
||||
|
||||
|
||||
public int deleteBusinessBreakByBreakId(Long breakId);
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
package com.zhilian.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.zhilian.system.mapper.BusinessBreakMapper;
|
||||
import com.zhilian.system.domain.BusinessBreak;
|
||||
import com.zhilian.system.service.IBusinessBreakService;
|
||||
|
||||
|
||||
@Service
|
||||
public class BusinessBreakServiceImpl implements IBusinessBreakService
|
||||
{
|
||||
@Autowired
|
||||
private BusinessBreakMapper businessBreakMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public BusinessBreak selectBusinessBreakByBreakId(Long breakId)
|
||||
{
|
||||
return businessBreakMapper.selectBusinessBreakByBreakId(breakId);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<BusinessBreak> selectBusinessBreakList(BusinessBreak businessBreak)
|
||||
{
|
||||
return businessBreakMapper.selectBusinessBreakList(businessBreak);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int insertBusinessBreak(BusinessBreak businessBreak)
|
||||
{
|
||||
return businessBreakMapper.insertBusinessBreak(businessBreak);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int updateBusinessBreak(BusinessBreak businessBreak)
|
||||
{
|
||||
return businessBreakMapper.updateBusinessBreak(businessBreak);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int deleteBusinessBreakByBreakIds(Long[] breakIds)
|
||||
{
|
||||
return businessBreakMapper.deleteBusinessBreakByBreakIds(breakIds);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int deleteBusinessBreakByBreakId(Long breakId)
|
||||
{
|
||||
return businessBreakMapper.deleteBusinessBreakByBreakId(breakId);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,91 @@
|
|||
<?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.zhilian.system.mapper.BusinessBreakMapper">
|
||||
|
||||
<resultMap type="com.zhilian.system.domain.BusinessBreak" id="BusinessBreakResult">
|
||||
<result property="breakId" column="break_id" />
|
||||
<result property="breakCar" column="break_car" />
|
||||
<result property="breakVin" column="break_vin" />
|
||||
<result property="breakTime" column="break_time" />
|
||||
<result property="breakType" column="break_type" />
|
||||
<result property="breakRank" column="break_rank" />
|
||||
<result property="breakState" column="break_state" />
|
||||
<result property="breakDevice" column="break_device" />
|
||||
<result property="breakDesc" column="break_desc" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBusinessBreakVo">
|
||||
select break_id, break_car, break_vin, break_time, break_type, break_rank, break_state, break_device, break_desc from business_break
|
||||
</sql>
|
||||
|
||||
<select id="selectBusinessBreakList" parameterType="com.zhilian.system.domain.BusinessBreak" resultMap="BusinessBreakResult">
|
||||
<include refid="selectBusinessBreakVo"/>
|
||||
<where>
|
||||
<if test="breakCar != null and breakCar != ''"> and break_car = #{breakCar}</if>
|
||||
<if test="breakVin != null and breakVin != ''"> and break_vin = #{breakVin}</if>
|
||||
<if test="breakTime != null "> and break_time = #{breakTime}</if>
|
||||
<if test="breakType != null and breakType != ''"> and break_type = #{breakType}</if>
|
||||
<if test="breakRank != null and breakRank != ''"> and break_rank = #{breakRank}</if>
|
||||
<if test="breakState != null and breakState != ''"> and break_state = #{breakState}</if>
|
||||
<if test="breakDevice != null and breakDevice != ''"> and break_device = #{breakDevice}</if>
|
||||
<if test="breakDesc != null and breakDesc != ''"> and break_desc = #{breakDesc}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBusinessBreakByBreakId" parameterType="Long" resultMap="BusinessBreakResult">
|
||||
<include refid="selectBusinessBreakVo"/>
|
||||
where break_id = #{breakId}
|
||||
</select>
|
||||
|
||||
<insert id="insertBusinessBreak" parameterType="com.zhilian.system.domain.BusinessBreak" useGeneratedKeys="true" keyProperty="breakId">
|
||||
insert into business_break
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="breakCar != null">break_car,</if>
|
||||
<if test="breakVin != null">break_vin,</if>
|
||||
<if test="breakTime != null">break_time,</if>
|
||||
<if test="breakType != null">break_type,</if>
|
||||
<if test="breakRank != null">break_rank,</if>
|
||||
<if test="breakState != null">break_state,</if>
|
||||
<if test="breakDevice != null">break_device,</if>
|
||||
<if test="breakDesc != null">break_desc,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="breakCar != null">#{breakCar},</if>
|
||||
<if test="breakVin != null">#{breakVin},</if>
|
||||
<if test="breakTime != null">#{breakTime},</if>
|
||||
<if test="breakType != null">#{breakType},</if>
|
||||
<if test="breakRank != null">#{breakRank},</if>
|
||||
<if test="breakState != null">#{breakState},</if>
|
||||
<if test="breakDevice != null">#{breakDevice},</if>
|
||||
<if test="breakDesc != null">#{breakDesc},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBusinessBreak" parameterType="com.zhilian.system.domain.BusinessBreak">
|
||||
update business_break
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="breakCar != null">break_car = #{breakCar},</if>
|
||||
<if test="breakVin != null">break_vin = #{breakVin},</if>
|
||||
<if test="breakTime != null">break_time = #{breakTime},</if>
|
||||
<if test="breakType != null">break_type = #{breakType},</if>
|
||||
<if test="breakRank != null">break_rank = #{breakRank},</if>
|
||||
<if test="breakState != null">break_state = #{breakState},</if>
|
||||
<if test="breakDevice != null">break_device = #{breakDevice},</if>
|
||||
<if test="breakDesc != null">break_desc = #{breakDesc},</if>
|
||||
</trim>
|
||||
where break_id = #{breakId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBusinessBreakByBreakId" parameterType="Long">
|
||||
delete from business_break where break_id = #{breakId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBusinessBreakByBreakIds" parameterType="String">
|
||||
delete from business_break where break_id in
|
||||
<foreach item="breakId" collection="array" open="(" separator="," close=")">
|
||||
#{breakId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in New Issue