报修+维修+设备班组
parent
551e194707
commit
9bb46f6a5e
@ -0,0 +1,97 @@
|
||||
package com.op.device.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.op.common.log.annotation.Log;
|
||||
import com.op.common.log.enums.BusinessType;
|
||||
import com.op.common.security.annotation.RequiresPermissions;
|
||||
import com.op.device.domain.EquTeam;
|
||||
import com.op.device.service.IEquTeamService;
|
||||
import com.op.common.core.web.controller.BaseController;
|
||||
import com.op.common.core.web.domain.AjaxResult;
|
||||
import com.op.common.core.utils.poi.ExcelUtil;
|
||||
import com.op.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 设备班组维护Controller
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2023-11-01
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/equTeam")
|
||||
public class EquTeamController extends BaseController {
|
||||
@Autowired
|
||||
private IEquTeamService equTeamService;
|
||||
|
||||
/**
|
||||
* 查询设备班组维护列表
|
||||
*/
|
||||
@RequiresPermissions("device:equTeam:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(EquTeam equTeam) {
|
||||
startPage();
|
||||
List<EquTeam> list = equTeamService.selectEquTeamList(equTeam);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出设备班组维护列表
|
||||
*/
|
||||
@RequiresPermissions("device:equTeam:export")
|
||||
@Log(title = "设备班组维护", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, EquTeam equTeam) {
|
||||
List<EquTeam> list = equTeamService.selectEquTeamList(equTeam);
|
||||
ExcelUtil<EquTeam> util = new ExcelUtil<EquTeam>(EquTeam.class);
|
||||
util.exportExcel(response, list, "设备班组维护数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备班组维护详细信息
|
||||
*/
|
||||
@RequiresPermissions("device:equTeam:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id) {
|
||||
return success(equTeamService.selectEquTeamById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备班组维护
|
||||
*/
|
||||
@RequiresPermissions("device:equTeam:add")
|
||||
@Log(title = "设备班组维护", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody EquTeam equTeam) {
|
||||
return toAjax(equTeamService.insertEquTeam(equTeam));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备班组维护
|
||||
*/
|
||||
@RequiresPermissions("device:equTeam:edit")
|
||||
@Log(title = "设备班组维护", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody EquTeam equTeam) {
|
||||
return toAjax(equTeamService.updateEquTeam(equTeam));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备班组维护
|
||||
*/
|
||||
@RequiresPermissions("device:equTeam:remove")
|
||||
@Log(title = "设备班组维护", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids) {
|
||||
return toAjax(equTeamService.deleteEquTeamByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,109 @@
|
||||
package com.op.device.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.op.common.core.annotation.Excel;
|
||||
import com.op.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 设备班组维护对象 equ_team
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2023-11-01
|
||||
*/
|
||||
public class EquTeam extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private String id;
|
||||
|
||||
/** 班组编号 */
|
||||
@Excel(name = "班组编号")
|
||||
private String teamCode;
|
||||
|
||||
/** 班组名称 */
|
||||
@Excel(name = "班组名称")
|
||||
private String teamName;
|
||||
|
||||
/** 班组类型 */
|
||||
@Excel(name = "班组类型")
|
||||
private String teamType;
|
||||
|
||||
/** 班组人员 */
|
||||
@Excel(name = "班组人员")
|
||||
private String teamPerson;
|
||||
|
||||
/** 删除标志 */
|
||||
private String delFlag;
|
||||
|
||||
/** 工厂号 */
|
||||
@Excel(name = "工厂号")
|
||||
private String factoryCode;
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
public void setTeamCode(String teamCode) {
|
||||
this.teamCode = teamCode;
|
||||
}
|
||||
|
||||
public String getTeamCode() {
|
||||
return teamCode;
|
||||
}
|
||||
public void setTeamName(String teamName) {
|
||||
this.teamName = teamName;
|
||||
}
|
||||
|
||||
public String getTeamName() {
|
||||
return teamName;
|
||||
}
|
||||
public void setTeamType(String teamType) {
|
||||
this.teamType = teamType;
|
||||
}
|
||||
|
||||
public String getTeamType() {
|
||||
return teamType;
|
||||
}
|
||||
public void setTeamPerson(String teamPerson) {
|
||||
this.teamPerson = teamPerson;
|
||||
}
|
||||
|
||||
public String getTeamPerson() {
|
||||
return teamPerson;
|
||||
}
|
||||
public void setDelFlag(String delFlag) {
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public String getDelFlag() {
|
||||
return delFlag;
|
||||
}
|
||||
public void setFactoryCode(String factoryCode) {
|
||||
this.factoryCode = factoryCode;
|
||||
}
|
||||
|
||||
public String getFactoryCode() {
|
||||
return factoryCode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("teamCode", getTeamCode())
|
||||
.append("teamName", getTeamName())
|
||||
.append("teamType", getTeamType())
|
||||
.append("teamPerson", getTeamPerson())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("factoryCode", getFactoryCode())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.op.device.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.op.device.domain.EquTeam;
|
||||
|
||||
/**
|
||||
* 设备班组维护Mapper接口
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2023-11-01
|
||||
*/
|
||||
public interface EquTeamMapper {
|
||||
/**
|
||||
* 查询设备班组维护
|
||||
*
|
||||
* @param id 设备班组维护主键
|
||||
* @return 设备班组维护
|
||||
*/
|
||||
public EquTeam selectEquTeamById(String id);
|
||||
|
||||
/**
|
||||
* 查询设备班组维护列表
|
||||
*
|
||||
* @param equTeam 设备班组维护
|
||||
* @return 设备班组维护集合
|
||||
*/
|
||||
public List<EquTeam> selectEquTeamList(EquTeam equTeam);
|
||||
|
||||
/**
|
||||
* 新增设备班组维护
|
||||
*
|
||||
* @param equTeam 设备班组维护
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertEquTeam(EquTeam equTeam);
|
||||
|
||||
/**
|
||||
* 修改设备班组维护
|
||||
*
|
||||
* @param equTeam 设备班组维护
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateEquTeam(EquTeam equTeam);
|
||||
|
||||
/**
|
||||
* 删除设备班组维护
|
||||
*
|
||||
* @param id 设备班组维护主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEquTeamById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除设备班组维护
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEquTeamByIds(String[] ids);
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package com.op.device.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.op.device.domain.EquTeam;
|
||||
|
||||
/**
|
||||
* 设备班组维护Service接口
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2023-11-01
|
||||
*/
|
||||
public interface IEquTeamService {
|
||||
/**
|
||||
* 查询设备班组维护
|
||||
*
|
||||
* @param id 设备班组维护主键
|
||||
* @return 设备班组维护
|
||||
*/
|
||||
public EquTeam selectEquTeamById(String id);
|
||||
|
||||
/**
|
||||
* 查询设备班组维护列表
|
||||
*
|
||||
* @param equTeam 设备班组维护
|
||||
* @return 设备班组维护集合
|
||||
*/
|
||||
public List<EquTeam> selectEquTeamList(EquTeam equTeam);
|
||||
|
||||
/**
|
||||
* 新增设备班组维护
|
||||
*
|
||||
* @param equTeam 设备班组维护
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertEquTeam(EquTeam equTeam);
|
||||
|
||||
/**
|
||||
* 修改设备班组维护
|
||||
*
|
||||
* @param equTeam 设备班组维护
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateEquTeam(EquTeam equTeam);
|
||||
|
||||
/**
|
||||
* 批量删除设备班组维护
|
||||
*
|
||||
* @param ids 需要删除的设备班组维护主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEquTeamByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除设备班组维护信息
|
||||
*
|
||||
* @param id 设备班组维护主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEquTeamById(String id);
|
||||
}
|
@ -0,0 +1,102 @@
|
||||
package com.op.device.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.op.common.core.utils.DateUtils;
|
||||
import com.op.common.core.utils.uuid.IdUtils;
|
||||
import com.op.common.security.utils.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.op.device.mapper.EquTeamMapper;
|
||||
import com.op.device.domain.EquTeam;
|
||||
import com.op.device.service.IEquTeamService;
|
||||
|
||||
/**
|
||||
* 设备班组维护Service业务层处理
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2023-11-01
|
||||
*/
|
||||
@Service
|
||||
public class EquTeamServiceImpl implements IEquTeamService {
|
||||
@Autowired
|
||||
private EquTeamMapper equTeamMapper;
|
||||
|
||||
/**
|
||||
* 查询设备班组维护
|
||||
*
|
||||
* @param id 设备班组维护主键
|
||||
* @return 设备班组维护
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public EquTeam selectEquTeamById(String id) {
|
||||
return equTeamMapper.selectEquTeamById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设备班组维护列表
|
||||
*
|
||||
* @param equTeam 设备班组维护
|
||||
* @return 设备班组维护
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public List<EquTeam> selectEquTeamList(EquTeam equTeam) {
|
||||
return equTeamMapper.selectEquTeamList(equTeam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备班组维护
|
||||
*
|
||||
* @param equTeam 设备班组维护
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int insertEquTeam(EquTeam equTeam) {
|
||||
equTeam.setId(IdUtils.fastSimpleUUID());
|
||||
equTeam.setCreateTime(DateUtils.getNowDate());
|
||||
equTeam.setCreateBy(SecurityUtils.getUsername());
|
||||
return equTeamMapper.insertEquTeam(equTeam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备班组维护
|
||||
*
|
||||
* @param equTeam 设备班组维护
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int updateEquTeam(EquTeam equTeam) {
|
||||
equTeam.setUpdateTime(DateUtils.getNowDate());
|
||||
equTeam.setUpdateBy(SecurityUtils.getUsername());
|
||||
return equTeamMapper.updateEquTeam(equTeam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除设备班组维护
|
||||
*
|
||||
* @param ids 需要删除的设备班组维护主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int deleteEquTeamByIds(String[] ids) {
|
||||
return equTeamMapper.deleteEquTeamByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备班组维护信息
|
||||
*
|
||||
* @param id 设备班组维护主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int deleteEquTeamById(String id) {
|
||||
return equTeamMapper.deleteEquTeamById(id);
|
||||
}
|
||||
}
|
@ -0,0 +1,101 @@
|
||||
<?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.op.device.mapper.EquTeamMapper">
|
||||
|
||||
<resultMap type="EquTeam" id="EquTeamResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="teamCode" column="team_code" />
|
||||
<result property="teamName" column="team_name" />
|
||||
<result property="teamType" column="team_type" />
|
||||
<result property="teamPerson" column="team_person" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="factoryCode" column="factory_code" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEquTeamVo">
|
||||
select id, team_code, team_name, team_type, team_person, create_by, create_time, update_by, update_time, del_flag, factory_code from equ_team
|
||||
</sql>
|
||||
|
||||
<select id="selectEquTeamList" parameterType="EquTeam" resultMap="EquTeamResult">
|
||||
<include refid="selectEquTeamVo"/>
|
||||
<where>
|
||||
<if test="teamCode != null and teamCode != ''"> and team_code like concat('%', #{teamCode}, '%')</if>
|
||||
<if test="teamName != null and teamName != ''"> and team_name like concat('%', #{teamName}, '%')</if>
|
||||
<if test="teamType != null and teamType != ''"> and team_type = #{teamType}</if>
|
||||
<if test="teamPerson != null and teamPerson != ''"> and team_person = #{teamPerson}</if>
|
||||
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
|
||||
and del_flag = '0'
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectEquTeamById" parameterType="String" resultMap="EquTeamResult">
|
||||
<include refid="selectEquTeamVo"/>
|
||||
where id = #{id}
|
||||
where del_flag = '0'
|
||||
</select>
|
||||
|
||||
<insert id="insertEquTeam" parameterType="EquTeam">
|
||||
insert into equ_team
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="teamCode != null">team_code,</if>
|
||||
<if test="teamName != null">team_name,</if>
|
||||
<if test="teamType != null">team_type,</if>
|
||||
<if test="teamPerson != null">team_person,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="factoryCode != null">factory_code,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="teamCode != null">#{teamCode},</if>
|
||||
<if test="teamName != null">#{teamName},</if>
|
||||
<if test="teamType != null">#{teamType},</if>
|
||||
<if test="teamPerson != null">#{teamPerson},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="factoryCode != null">#{factoryCode},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateEquTeam" parameterType="EquTeam">
|
||||
update equ_team
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="teamCode != null">team_code = #{teamCode},</if>
|
||||
<if test="teamName != null">team_name = #{teamName},</if>
|
||||
<if test="teamType != null">team_type = #{teamType},</if>
|
||||
<if test="teamPerson != null">team_person = #{teamPerson},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
and del_flag = '0'
|
||||
</update>
|
||||
|
||||
<delete id="deleteEquTeamById" parameterType="String">
|
||||
delete from equ_team where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteEquTeamByIds" parameterType="String">
|
||||
delete from equ_team where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in New Issue