Merge branch 'main' of http://223.71.122.54:3000/rczn001/RCZN-bs-program
This commit is contained in:
@@ -11,6 +11,8 @@ import io.swagger.v3.oas.annotations.enums.ParameterIn;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 角色管理 CRUD API(MyBatis+PageHelper 实现)
|
||||
*/
|
||||
@@ -47,6 +49,23 @@ public class RoleController {
|
||||
return Result.success(pageBean);
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. 分页查询角色(多条件模糊查询)
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "查询角色列表", description = "支持角色名、角色编码模糊查询")
|
||||
@Parameters({
|
||||
@Parameter(name = "roleName", description = "角色名(模糊查询,可选)", required = false, example = "管理员", in = ParameterIn.QUERY),
|
||||
@Parameter(name = "roleCode", description = "角色编码(模糊查询,可选)", required = false, example = "ADMIN", in = ParameterIn.QUERY)
|
||||
})
|
||||
public Result getRoleList(
|
||||
@RequestParam(required = false) String roleName,
|
||||
@RequestParam(required = false) String roleCode) {
|
||||
|
||||
List<Role> list = roleService.selectRoleList( roleName, roleCode);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 2. 根据ID查询单个角色
|
||||
*/
|
||||
|
||||
@@ -12,6 +12,8 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户管理 CRUD API(MyBatis+PageHelper 实现)
|
||||
*/
|
||||
@@ -44,6 +46,19 @@ public class UserController {
|
||||
return Result.success(pageBean);
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "查询用户列表", description = "用户名模糊查询,查询全部")
|
||||
@Parameters({
|
||||
@Parameter(name = "userName", description = "用户名(模糊查询,可选)", required = false, example = "张三", in = ParameterIn.QUERY)
|
||||
})
|
||||
public Result<List<User>> getUserList(
|
||||
@RequestParam(required = false) String userName) {
|
||||
|
||||
// 调用 Service 查询列表
|
||||
List<User> userList = userService.selectUserList(userName);
|
||||
return Result.success(userList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 2. 根据ID查询单个用户
|
||||
*/
|
||||
|
||||
@@ -31,9 +31,7 @@ public interface UserRoleMapper {
|
||||
// 分页查询所有关联
|
||||
List<UserRole> selectPage(
|
||||
@Param("userId") Integer userId,
|
||||
@Param("roleId") Integer roleId,
|
||||
@Param("start") Integer start,
|
||||
@Param("pageSize") Integer pageSize
|
||||
@Param("roleId") Integer roleId
|
||||
);
|
||||
|
||||
// 查询分页总数
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.rczn.system.service;
|
||||
import com.rczn.domain.PageBean;
|
||||
import com.rczn.system.domain.Role;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Role 业务逻辑层接口
|
||||
*/
|
||||
@@ -47,4 +49,12 @@ public interface RoleService {
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteById(Long id);
|
||||
|
||||
/**
|
||||
* 根据角色名或角色编码模糊查询角色列表
|
||||
* @param roleName 角色名(可选)
|
||||
* @param roleCode 角色编码(可选)
|
||||
* @return 角色列表
|
||||
*/
|
||||
List<Role> selectRoleList(String roleName, String roleCode);
|
||||
}
|
||||
@@ -3,6 +3,8 @@ package com.rczn.system.service;
|
||||
import com.rczn.domain.PageBean;
|
||||
import com.rczn.system.domain.User;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* User 业务逻辑层接口
|
||||
*/
|
||||
@@ -17,6 +19,13 @@ public interface UserService {
|
||||
*/
|
||||
PageBean<User> selectUserPage(Integer pageNum, Integer pageSize, String userName);
|
||||
|
||||
/**
|
||||
* 1. 查询用户列表(支持用户名模糊查询)
|
||||
* @param userName 用户名(模糊查询,可选)
|
||||
* @return 结果(listUser)
|
||||
*/
|
||||
List<User> selectUserList(String userName);
|
||||
|
||||
/**
|
||||
* 2. 根据ID查询单个用户
|
||||
* @param id 用户ID
|
||||
|
||||
@@ -95,4 +95,16 @@ public class RoleServiceImpl implements RoleService {
|
||||
int rows = roleMapper.deleteById(id);
|
||||
return rows > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据角色名或角色编码模糊查询角色列表
|
||||
*
|
||||
* @param roleName 角色名(可选)
|
||||
* @param roleCode 角色编码(可选)
|
||||
* @return 角色列表
|
||||
*/
|
||||
@Override
|
||||
public List<Role> selectRoleList(String roleName, String roleCode) {
|
||||
return roleMapper.selectRolePage(roleName, roleCode);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.rczn.system.service.impl;
|
||||
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.rczn.domain.PageBean;
|
||||
import com.rczn.system.domain.Position;
|
||||
import com.rczn.system.domain.UserRole;
|
||||
@@ -72,8 +73,8 @@ public class UserRoleServiceImpl implements UserRoleService {
|
||||
Assert.isTrue(pageNum > 0, "页码必须大于0");
|
||||
Assert.isTrue(pageSize > 0 && pageSize <= 100000, "每页条数必须在1-10000之间");
|
||||
|
||||
int start = (pageNum - 1) * pageSize;
|
||||
List<UserRole> items = userRoleMapper.selectPage(userId, roleId, start, pageSize);
|
||||
PageHelper.startPage(pageNum,pageSize);
|
||||
List<UserRole> items = userRoleMapper.selectPage(userId, roleId);
|
||||
Page<UserRole> page = (Page<UserRole>) items;
|
||||
|
||||
PageBean<UserRole> pageBean = new PageBean<>();
|
||||
|
||||
@@ -45,6 +45,22 @@ public class UserServiceImpl implements UserService {
|
||||
return pageBean;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. 查询用户列表(支持用户名模糊查询)
|
||||
*
|
||||
* @param userName 用户名(模糊查询,可选)
|
||||
* @return 结果(listUser)
|
||||
*/
|
||||
@Override
|
||||
public List<User> selectUserList(String userName) {
|
||||
// 2. 执行查询(MyBatis 会自动添加 LIMIT 分页)
|
||||
User user = new User();
|
||||
user.setUserName(userName);
|
||||
List<User> userList = userMapper.selectUserPage(user);
|
||||
|
||||
return userList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public User selectById(Long id) {
|
||||
// 查询不到返回 null(后续 Controller 处理)
|
||||
|
||||
@@ -69,10 +69,10 @@
|
||||
UPDATE sys_role
|
||||
<set>
|
||||
<if test="roleName != null ">role_name = #{roleName},</if>
|
||||
<if test="roleCode != null ">role_code = #{roleCode}</if>
|
||||
<if test="updateId != null ">updateId = NULL,</if>
|
||||
<if test="updateTime != null ">updateTime = now(),</if>
|
||||
<if test="remark != null ">remark = NULL,</if>
|
||||
<if test="roleCode != null ">role_code = #{roleCode},</if>
|
||||
<if test="updateId != null ">update_id = #{updateId},</if>
|
||||
<if test="updateTime != null ">update_time = now(),</if>
|
||||
<if test="remark != null ">remark = #{remark},</if>
|
||||
</set>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
|
||||
<insert id="insert" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO sys_user_role (
|
||||
<include refid="userRoleColumn"/>, create_time, update_time, del_sign
|
||||
<include refid="userRoleColumn"/>,remark, create_time, del_sign
|
||||
) VALUES (
|
||||
#{userId}, #{roleId}, NOW(), NOW(), 0
|
||||
#{userId}, #{roleId}, #{remark},NOW(), 0
|
||||
)
|
||||
</insert>
|
||||
|
||||
@@ -57,7 +57,6 @@
|
||||
<if test="userId != null">AND user_id = #{userId}</if>
|
||||
<if test="roleId != null">AND role_id = #{roleId}</if>
|
||||
ORDER BY id DESC
|
||||
LIMIT #{start}, #{pageSize}
|
||||
</select>
|
||||
|
||||
<select id="selectTotal" resultType="java.lang.Integer">
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
package com.rczn.rcznautoplc.controller;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.rczn.domain.PageBean;
|
||||
import com.rczn.domain.Result;
|
||||
import com.rczn.rcznautoplc.domain.DevParam;
|
||||
import com.rczn.rcznautoplc.service.DevParamService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
import io.swagger.v3.oas.annotations.enums.ParameterIn;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/devParam")
|
||||
@Tag(name = "设备参数管理", description = "设备参数增删改查+分页查询接口")
|
||||
public class DevParamController {
|
||||
|
||||
@Autowired
|
||||
DevParamService devParamService;
|
||||
|
||||
/**
|
||||
* 分页查询设备参数
|
||||
*/
|
||||
@GetMapping(value = "/listPage", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "分页查询设备参数", description = "支持设备ID精准查询、参数名称/值模糊查询")
|
||||
@Parameters({
|
||||
@Parameter(name = "pageNum", description = "页码(必填)", required = true, example = "1", in = ParameterIn.QUERY),
|
||||
@Parameter(name = "pageSize", description = "每页条数(必填)", required = true, example = "10", in = ParameterIn.QUERY),
|
||||
@Parameter(name = "devId", description = "设备ID(可选,精准查询)", required = false, example = "1", in = ParameterIn.QUERY),
|
||||
@Parameter(name = "paramName", description = "参数名称(可选,模糊查询)", required = false, example = "温度", in = ParameterIn.QUERY),
|
||||
@Parameter(name = "paramValue", description = "参数值(可选,模糊查询)", required = false, example = "25", in = ParameterIn.QUERY)
|
||||
})
|
||||
public Result getDevParamPage(
|
||||
@RequestParam Integer pageNum,
|
||||
@RequestParam Integer pageSize,
|
||||
@RequestParam(required = false) Integer devId,
|
||||
@RequestParam(required = false) String paramName,
|
||||
@RequestParam(required = false) String paramValue) {
|
||||
PageInfo<DevParam> pageBean = devParamService.selectPage(pageNum, pageSize, devId, paramName, paramValue);
|
||||
return Result.success(pageBean);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID查询设备参数
|
||||
*/
|
||||
@GetMapping(value = "/getById/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "查询单个设备参数", description = "根据设备参数ID查询详情")
|
||||
public Result getDevParamById(@PathVariable Long id) {
|
||||
DevParam devParam = devParamService.selectById(id);
|
||||
return devParam != null ? Result.success(devParam) : Result.error("设备参数不存在");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备参数
|
||||
*/
|
||||
@PostMapping(value = "/add", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "新增设备参数", description = "设备ID、参数名称为必填项")
|
||||
public Result addDevParam(@RequestBody DevParam devParam) {
|
||||
try {
|
||||
Long devParamId = devParamService.insert(devParam);
|
||||
return Result.success(devParamId);
|
||||
} catch (IllegalArgumentException e) {
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备参数
|
||||
*/
|
||||
@PutMapping(value = "/update", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "修改设备参数", description = "需传入设备参数ID,其他字段可选(非空则更新)")
|
||||
public Result updateDevParam(@RequestBody DevParam devParam) {
|
||||
try {
|
||||
Boolean success = devParamService.update(devParam);
|
||||
return success ? Result.success(true) : Result.error("修改失败(设备参数不存在或已删除)");
|
||||
} catch (IllegalArgumentException e) {
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备参数(逻辑删除)
|
||||
*/
|
||||
@DeleteMapping(value = "/del/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "删除设备参数", description = "逻辑删除(设置delSign=1,不物理删除数据)")
|
||||
public Result deleteDevParam(@PathVariable Long id) {
|
||||
try {
|
||||
Boolean success = devParamService.deleteById(id);
|
||||
return success ? Result.success(true) : Result.error("删除失败(设备参数不存在或已删除)");
|
||||
} catch (IllegalArgumentException e) {
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.rczn.rcznautoplc.controller;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.rczn.domain.PageBean;
|
||||
import com.rczn.domain.Result;
|
||||
import com.rczn.rcznautoplc.domain.FlowInfo;
|
||||
import com.rczn.rcznautoplc.service.FlowInfoService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
import io.swagger.v3.oas.annotations.enums.ParameterIn;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/flowInfo")
|
||||
@Tag(name = "流程信息管理", description = "流程信息增删改查+分页查询接口")
|
||||
public class FlowInfoController {
|
||||
|
||||
@Autowired
|
||||
FlowInfoService flowInfoService;
|
||||
|
||||
|
||||
@GetMapping(value = "/listPage", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "分页查询流程信息", description = "支持流程排序精准查询、流程名称/岛屿ID列表模糊查询")
|
||||
@Parameters({
|
||||
@Parameter(name = "pageNum", description = "页码(必填)", required = true, example = "1", in = ParameterIn.QUERY),
|
||||
@Parameter(name = "pageSize", description = "每页条数(必填)", required = true, example = "10", in = ParameterIn.QUERY),
|
||||
@Parameter(name = "flowIndex", description = "流程排序(可选,精准查询)", required = false, example = "1", in = ParameterIn.QUERY),
|
||||
@Parameter(name = "flowName", description = "流程名称(可选,模糊查询)", required = false, example = "检测流程", in = ParameterIn.QUERY),
|
||||
@Parameter(name = "islandIdList", description = "岛屿ID列表(可选,模糊查询)", required = false, example = "1,2,3", in = ParameterIn.QUERY)
|
||||
})
|
||||
public Result getFlowInfoPage(
|
||||
@RequestParam Integer pageNum,
|
||||
@RequestParam Integer pageSize,
|
||||
@RequestParam(required = false) Integer flowIndex,
|
||||
@RequestParam(required = false) String flowName,
|
||||
@RequestParam(required = false) String islandIdList) {
|
||||
PageInfo<FlowInfo> pageBean = flowInfoService.selectPage(pageNum, pageSize, flowIndex, flowName, islandIdList);
|
||||
return Result.success(pageBean);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/getById/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "查询单个流程信息", description = "根据流程信息ID查询详情")
|
||||
public Result getFlowInfoById(@PathVariable Long id) {
|
||||
FlowInfo flowInfo = flowInfoService.selectById(id);
|
||||
return flowInfo != null ? Result.success(flowInfo) : Result.error("流程信息不存在");
|
||||
}
|
||||
|
||||
@PostMapping(value = "/add", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "新增流程信息", description = "流程名称、流程排序为必填项")
|
||||
public Result addFlowInfo(@RequestBody FlowInfo flowInfo) {
|
||||
try {
|
||||
Long flowInfoId = flowInfoService.insert(flowInfo);
|
||||
return Result.success(flowInfoId);
|
||||
} catch (IllegalArgumentException e) {
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@PutMapping(value = "/update", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "修改流程信息", description = "需传入流程信息ID,其他字段可选(非空则更新)")
|
||||
public Result updateFlowInfo(@RequestBody FlowInfo flowInfo) {
|
||||
try {
|
||||
Boolean success = flowInfoService.update(flowInfo);
|
||||
return success ? Result.success(true) : Result.error("修改失败(流程信息不存在或已删除)");
|
||||
} catch (IllegalArgumentException e) {
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@DeleteMapping(value = "/del/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "删除流程信息", description = "逻辑删除(设置delSign=1,不物理删除数据)")
|
||||
public Result deleteFlowInfo(@PathVariable Long id) {
|
||||
try {
|
||||
Boolean success = flowInfoService.deleteById(id);
|
||||
return success ? Result.success(true) : Result.error("删除失败(流程信息不存在或已删除)");
|
||||
} catch (IllegalArgumentException e) {
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package com.rczn.rcznautoplc.controller;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.rczn.domain.PageBean;
|
||||
import com.rczn.domain.Result;
|
||||
import com.rczn.rcznautoplc.domain.GoodsFlowStatus;
|
||||
import com.rczn.rcznautoplc.service.GoodsFlowStatusService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
import io.swagger.v3.oas.annotations.enums.ParameterIn;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/goodsFlowStatus")
|
||||
@Tag(name = "样品流程状态管理", description = "样品流程状态增删改查+分页查询接口")
|
||||
public class GoodsFlowStatusController {
|
||||
|
||||
@Autowired
|
||||
GoodsFlowStatusService goodsFlowStatusService;
|
||||
|
||||
|
||||
@GetMapping(value = "/listPage", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "分页查询样品流程状态", description = "支持样品ID、流程ID、岛屿ID、状态精准查询")
|
||||
@Parameters({
|
||||
@Parameter(name = "pageNum", description = "页码(必填)", required = true, example = "1", in = ParameterIn.QUERY),
|
||||
@Parameter(name = "pageSize", description = "每页条数(必填)", required = true, example = "10", in = ParameterIn.QUERY),
|
||||
@Parameter(name = "goodsId", description = "样品ID(可选,精准查询)", required = false, example = "1", in = ParameterIn.QUERY),
|
||||
@Parameter(name = "flowId", description = "流程ID(可选,精准查询)", required = false, example = "1", in = ParameterIn.QUERY),
|
||||
@Parameter(name = "islandId", description = "岛屿ID(可选,精准查询)", required = false, example = "1", in = ParameterIn.QUERY),
|
||||
@Parameter(name = "status", description = "状态(可选,精准查询:0-未执行,1-执行,10-通过,11-失败)", required = false, example = "10", in = ParameterIn.QUERY)
|
||||
})
|
||||
public Result getGoodsFlowStatusPage(
|
||||
@RequestParam Integer pageNum,
|
||||
@RequestParam Integer pageSize,
|
||||
@RequestParam(required = false) Integer goodsId,
|
||||
@RequestParam(required = false) Integer flowId,
|
||||
@RequestParam(required = false) Integer islandId,
|
||||
@RequestParam(required = false) Integer status) {
|
||||
PageInfo<GoodsFlowStatus> pageBean = goodsFlowStatusService.selectPage(pageNum, pageSize, goodsId, flowId, islandId, status);
|
||||
return Result.success(pageBean);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/getById/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "查询单个样品流程状态", description = "根据样品流程状态ID查询详情")
|
||||
public Result getGoodsFlowStatusById(@PathVariable Long id) {
|
||||
GoodsFlowStatus goodsFlowStatus = goodsFlowStatusService.selectById(id);
|
||||
return goodsFlowStatus != null ? Result.success(goodsFlowStatus) : Result.error("样品流程状态不存在");
|
||||
}
|
||||
|
||||
@PostMapping(value = "/add", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "新增样品流程状态", description = "样品ID、流程ID、状态为必填项(状态:0-未执行,1-执行,10-通过,11-失败)")
|
||||
public Result addGoodsFlowStatus(@RequestBody GoodsFlowStatus goodsFlowStatus) {
|
||||
try {
|
||||
Long goodsFlowStatusId = goodsFlowStatusService.insert(goodsFlowStatus);
|
||||
return Result.success(goodsFlowStatusId);
|
||||
} catch (IllegalArgumentException e) {
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@PutMapping(value = "/update", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "修改样品流程状态", description = "需传入样品流程状态ID,其他字段可选(非空则更新)")
|
||||
public Result updateGoodsFlowStatus(@RequestBody GoodsFlowStatus goodsFlowStatus) {
|
||||
try {
|
||||
Boolean success = goodsFlowStatusService.update(goodsFlowStatus);
|
||||
return success ? Result.success(true) : Result.error("修改失败(样品流程状态不存在或已删除)");
|
||||
} catch (IllegalArgumentException e) {
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@DeleteMapping(value = "/del/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "删除样品流程状态", description = "逻辑删除(设置delSign=1,不物理删除数据)")
|
||||
public Result deleteGoodsFlowStatus(@PathVariable Long id) {
|
||||
try {
|
||||
Boolean success = goodsFlowStatusService.deleteById(id);
|
||||
return success ? Result.success(true) : Result.error("删除失败(样品流程状态不存在或已删除)");
|
||||
} catch (IllegalArgumentException e) {
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.rczn.rcznautoplc.controller;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.rczn.domain.PageBean;
|
||||
import com.rczn.domain.Result;
|
||||
import com.rczn.rcznautoplc.domain.GoodsInfo;
|
||||
import com.rczn.rcznautoplc.service.GoodsInfoService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
import io.swagger.v3.oas.annotations.enums.ParameterIn;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/goodsInfo")
|
||||
@Tag(name = "样品信息管理", description = "样品信息增删改查+分页查询接口")
|
||||
public class GoodsInfoController {
|
||||
|
||||
@Autowired
|
||||
GoodsInfoService goodsInfoService;
|
||||
|
||||
/**
|
||||
* 分页查询样品信息
|
||||
*/
|
||||
@GetMapping(value = "/listPage", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "分页查询样品信息", description = "支持样品名称/类型/来源模糊查询、批次精准查询")
|
||||
@Parameters({
|
||||
@Parameter(name = "pageNum", description = "页码(必填)", required = true, example = "1", in = ParameterIn.QUERY),
|
||||
@Parameter(name = "pageSize", description = "每页条数(必填)", required = true, example = "10", in = ParameterIn.QUERY),
|
||||
@Parameter(name = "goodsName", description = "样品名称(可选,模糊查询)", required = false, example = "手机", in = ParameterIn.QUERY),
|
||||
@Parameter(name = "goodsType", description = "样品类型(可选,模糊查询)", required = false, example = "电子产品", in = ParameterIn.QUERY),
|
||||
@Parameter(name = "goodFrom", description = "样品来源(可选,模糊查询)", required = false, example = "深圳", in = ParameterIn.QUERY),
|
||||
@Parameter(name = "goodBatch", description = "样品批次(可选,精准查询)", required = false, example = "202501", in = ParameterIn.QUERY)
|
||||
})
|
||||
public Result getGoodsInfoPage(
|
||||
@RequestParam Integer pageNum,
|
||||
@RequestParam Integer pageSize,
|
||||
@RequestParam(required = false) String goodsName,
|
||||
@RequestParam(required = false) String goodsType,
|
||||
@RequestParam(required = false) String goodFrom,
|
||||
@RequestParam(required = false) Integer goodBatch) {
|
||||
PageInfo<GoodsInfo> pageBean = goodsInfoService.selectPage(pageNum, pageSize, goodsName, goodsType, goodFrom, goodBatch);
|
||||
return Result.success(pageBean);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID查询样品信息
|
||||
*/
|
||||
@GetMapping(value = "/getById/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "查询单个样品信息", description = "根据样品信息ID查询详情")
|
||||
public Result getGoodsInfoById(@PathVariable Long id) {
|
||||
GoodsInfo goodsInfo = goodsInfoService.selectById(id);
|
||||
return goodsInfo != null ? Result.success(goodsInfo) : Result.error("样品信息不存在");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增样品信息
|
||||
*/
|
||||
@PostMapping(value = "/add", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "新增样品信息", description = "样品名称、类型、入库时间为必填项")
|
||||
public Result addGoodsInfo(@RequestBody GoodsInfo goodsInfo) {
|
||||
try {
|
||||
Long goodsInfoId = goodsInfoService.insert(goodsInfo);
|
||||
return Result.success(goodsInfoId);
|
||||
} catch (IllegalArgumentException e) {
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改样品信息
|
||||
*/
|
||||
@PutMapping(value = "/update", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "修改样品信息", description = "需传入样品信息ID,其他字段可选(非空则更新)")
|
||||
public Result updateGoodsInfo(@RequestBody GoodsInfo goodsInfo) {
|
||||
try {
|
||||
Boolean success = goodsInfoService.update(goodsInfo);
|
||||
return success ? Result.success(true) : Result.error("修改失败(样品信息不存在或已删除)");
|
||||
} catch (IllegalArgumentException e) {
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除样品信息(逻辑删除)
|
||||
*/
|
||||
@DeleteMapping(value = "/del/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "删除样品信息", description = "逻辑删除(设置delSign=1,不物理删除数据)")
|
||||
public Result deleteGoodsInfo(@PathVariable Long id) {
|
||||
try {
|
||||
Boolean success = goodsInfoService.deleteById(id);
|
||||
return success ? Result.success(true) : Result.error("删除失败(样品信息不存在或已删除)");
|
||||
} catch (IllegalArgumentException e) {
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package com.rczn.rcznautoplc.controller;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.rczn.domain.PageBean;
|
||||
import com.rczn.domain.Result;
|
||||
import com.rczn.rcznautoplc.domain.IslandInfo;
|
||||
import com.rczn.rcznautoplc.service.IslandInfoService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
import io.swagger.v3.oas.annotations.enums.ParameterIn;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/islandInfo")
|
||||
@Tag(name = "功能岛信息管理", description = "功能岛信息增删改查+分页查询接口")
|
||||
public class IslandInfoController {
|
||||
|
||||
@Autowired
|
||||
IslandInfoService islandInfoService;
|
||||
|
||||
@GetMapping(value = "/listPage", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "分页查询功能岛信息", description = "支持功能岛名称、编码模糊查询")
|
||||
@Parameters({
|
||||
@Parameter(name = "pageNum", description = "页码(必填)", required = true, example = "1", in = ParameterIn.QUERY),
|
||||
@Parameter(name = "pageSize", description = "每页条数(必填)", required = true, example = "10", in = ParameterIn.QUERY),
|
||||
@Parameter(name = "islandName", description = "功能岛名称(可选,模糊查询)", required = false, example = "一号岛", in = ParameterIn.QUERY),
|
||||
@Parameter(name = "islandCode", description = "功能岛编码(可选,模糊查询)", required = false, example = "ISLAND001", in = ParameterIn.QUERY)
|
||||
})
|
||||
public Result getIslandInfoPage(
|
||||
@RequestParam Integer pageNum,
|
||||
@RequestParam Integer pageSize,
|
||||
@RequestParam(required = false) String islandName,
|
||||
@RequestParam(required = false) String islandCode) {
|
||||
PageInfo<IslandInfo> pageBean = islandInfoService.selectPage(pageNum, pageSize, islandName, islandCode);
|
||||
return Result.success(pageBean);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/getById/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "查询单个功能岛信息", description = "根据功能岛信息ID查询详情")
|
||||
public Result getIslandInfoById(@PathVariable Long id) {
|
||||
IslandInfo islandInfo = islandInfoService.selectById(id);
|
||||
return islandInfo != null ? Result.success(islandInfo) : Result.error("功能岛信息不存在");
|
||||
}
|
||||
|
||||
@PostMapping(value = "/add", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "新增功能岛信息", description = "功能岛名称、编码为必填项")
|
||||
public Result addIslandInfo(@RequestBody IslandInfo islandInfo) {
|
||||
try {
|
||||
Long islandInfoId = islandInfoService.insert(islandInfo);
|
||||
return Result.success(islandInfoId);
|
||||
} catch (IllegalArgumentException e) {
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@PutMapping(value = "/update", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "修改功能岛信息", description = "需传入功能岛信息ID,其他字段可选(非空则更新)")
|
||||
public Result updateIslandInfo(@RequestBody IslandInfo islandInfo) {
|
||||
try {
|
||||
Boolean success = islandInfoService.update(islandInfo);
|
||||
return success ? Result.success(true) : Result.error("修改失败(功能岛信息不存在或已删除)");
|
||||
} catch (IllegalArgumentException e) {
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@DeleteMapping(value = "/del/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "删除功能岛信息", description = "逻辑删除(设置delSign=1,不物理删除数据)")
|
||||
public Result deleteIslandInfo(@PathVariable Long id) {
|
||||
try {
|
||||
Boolean success = islandInfoService.deleteById(id);
|
||||
return success ? Result.success(true) : Result.error("删除失败(功能岛信息不存在或已删除)");
|
||||
} catch (IllegalArgumentException e) {
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package com.rczn.rcznautoplc.controller;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.rczn.domain.PageBean;
|
||||
import com.rczn.domain.Result;
|
||||
import com.rczn.rcznautoplc.domain.IslandParam;
|
||||
import com.rczn.rcznautoplc.service.IslandParamService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
import io.swagger.v3.oas.annotations.enums.ParameterIn;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/islandParam")
|
||||
@Tag(name = "功能岛参数管理", description = "功能岛参数增删改查+分页查询接口")
|
||||
public class IslandParamController {
|
||||
|
||||
@Autowired
|
||||
IslandParamService islandParamService;
|
||||
|
||||
|
||||
@GetMapping(value = "/listPage", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "分页查询功能岛参数", description = "支持功能岛ID、步骤ID精准查询,参数名称模糊查询、参数类型精准查询")
|
||||
@Parameters({
|
||||
@Parameter(name = "pageNum", description = "页码(必填)", required = true, example = "1", in = ParameterIn.QUERY),
|
||||
@Parameter(name = "pageSize", description = "每页条数(必填)", required = true, example = "10", in = ParameterIn.QUERY),
|
||||
@Parameter(name = "islandId", description = "功能岛ID(可选,精准查询)", required = false, example = "1", in = ParameterIn.QUERY),
|
||||
@Parameter(name = "stepId", description = "步骤ID(可选,精准查询)", required = false, example = "1", in = ParameterIn.QUERY),
|
||||
@Parameter(name = "paramName", description = "参数名称(可选,模糊查询)", required = false, example = "温度", in = ParameterIn.QUERY),
|
||||
@Parameter(name = "paramType", description = "参数类型(可选,精准查询)", required = false, example = "数值", in = ParameterIn.QUERY)
|
||||
})
|
||||
public Result getIslandParamPage(
|
||||
@RequestParam Integer pageNum,
|
||||
@RequestParam Integer pageSize,
|
||||
@RequestParam(required = false) Integer islandId,
|
||||
@RequestParam(required = false) Integer stepId,
|
||||
@RequestParam(required = false) String paramName,
|
||||
@RequestParam(required = false) String paramType) {
|
||||
PageInfo<IslandParam> pageBean = islandParamService.selectPage(pageNum, pageSize, islandId, stepId, paramName, paramType);
|
||||
return Result.success(pageBean);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/getById/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "查询单个功能岛参数", description = "根据功能岛参数ID查询详情")
|
||||
public Result getIslandParamById(@PathVariable Long id) {
|
||||
IslandParam islandParam = islandParamService.selectById(id);
|
||||
return islandParam != null ? Result.success(islandParam) : Result.error("功能岛参数不存在");
|
||||
}
|
||||
|
||||
@PostMapping(value = "/add", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "新增功能岛参数", description = "功能岛ID、步骤ID、参数名称为必填项")
|
||||
public Result addIslandParam(@RequestBody IslandParam islandParam) {
|
||||
try {
|
||||
Long islandParamId = islandParamService.insert(islandParam);
|
||||
return Result.success(islandParamId);
|
||||
} catch (IllegalArgumentException e) {
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@PutMapping(value = "/update", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "修改功能岛参数", description = "需传入功能岛参数ID,其他字段可选(非空则更新)")
|
||||
public Result updateIslandParam(@RequestBody IslandParam islandParam) {
|
||||
try {
|
||||
Boolean success = islandParamService.update(islandParam);
|
||||
return success ? Result.success(true) : Result.error("修改失败(功能岛参数不存在或已删除)");
|
||||
} catch (IllegalArgumentException e) {
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@DeleteMapping(value = "/del/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "删除功能岛参数", description = "逻辑删除(设置delSign=1,不物理删除数据)")
|
||||
public Result deleteIslandParam(@PathVariable Long id) {
|
||||
try {
|
||||
Boolean success = islandParamService.deleteById(id);
|
||||
return success ? Result.success(true) : Result.error("删除失败(功能岛参数不存在或已删除)");
|
||||
} catch (IllegalArgumentException e) {
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.rczn.rcznautoplc.controller;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.rczn.domain.PageBean;
|
||||
import com.rczn.domain.Result;
|
||||
import com.rczn.rcznautoplc.domain.RecordInfo;
|
||||
import com.rczn.rcznautoplc.service.RecordInfoService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
import io.swagger.v3.oas.annotations.enums.ParameterIn;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/recordInfo")
|
||||
@Tag(name = "记录信息管理", description = "记录信息增删改查+分页查询接口")
|
||||
public class RecordInfoController {
|
||||
|
||||
@Autowired
|
||||
RecordInfoService recordInfoService;
|
||||
|
||||
|
||||
@GetMapping(value = "/listPage", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "分页查询记录信息", description = "支持记录名称模糊查询,记录类型、状态精准查询")
|
||||
@Parameters({
|
||||
@Parameter(name = "pageNum", description = "页码(必填)", required = true, example = "1", in = ParameterIn.QUERY),
|
||||
@Parameter(name = "pageSize", description = "每页条数(必填)", required = true, example = "10", in = ParameterIn.QUERY),
|
||||
@Parameter(name = "recordName", description = "记录名称(可选,模糊查询)", required = false, example = "设备故障", in = ParameterIn.QUERY),
|
||||
@Parameter(name = "recordType", description = "记录类型(可选,精准查询:1-设备异常,2-样品异常,3-操作异常)", required = false, example = "1", in = ParameterIn.QUERY),
|
||||
@Parameter(name = "recordStatus", description = "记录状态(可选,精准查询:false-未处理,true-已处理)", required = false, example = "false", in = ParameterIn.QUERY)
|
||||
})
|
||||
public Result getRecordInfoPage(
|
||||
@RequestParam Integer pageNum,
|
||||
@RequestParam Integer pageSize,
|
||||
@RequestParam(required = false) String recordName,
|
||||
@RequestParam(required = false) Integer recordType,
|
||||
@RequestParam(required = false) Boolean recordStatus) {
|
||||
PageInfo<RecordInfo> pageBean = recordInfoService.selectPage(pageNum, pageSize, recordName, recordType, recordStatus);
|
||||
return Result.success(pageBean);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/getById/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "查询单个记录信息", description = "根据记录信息ID查询详情")
|
||||
public Result getRecordInfoById(@PathVariable Long id) {
|
||||
RecordInfo recordInfo = recordInfoService.selectById(id);
|
||||
return recordInfo != null ? Result.success(recordInfo) : Result.error("记录信息不存在");
|
||||
}
|
||||
|
||||
@PostMapping(value = "/add", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "新增记录信息", description = "记录名称、类型、内容为必填项(类型:1-设备异常,2-样品异常,3-操作异常)")
|
||||
public Result addRecordInfo(@RequestBody RecordInfo recordInfo) {
|
||||
try {
|
||||
Long recordInfoId = recordInfoService.insert(recordInfo);
|
||||
return Result.success(recordInfoId);
|
||||
} catch (IllegalArgumentException e) {
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@PutMapping(value = "/update", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "修改记录信息", description = "需传入记录信息ID,其他字段可选(非空则更新)")
|
||||
public Result updateRecordInfo(@RequestBody RecordInfo recordInfo) {
|
||||
try {
|
||||
Boolean success = recordInfoService.update(recordInfo);
|
||||
return success ? Result.success(true) : Result.error("修改失败(记录信息不存在或已删除)");
|
||||
} catch (IllegalArgumentException e) {
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@DeleteMapping(value = "/del/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "删除记录信息", description = "逻辑删除(设置delSign=1,不物理删除数据)")
|
||||
public Result deleteRecordInfo(@PathVariable Long id) {
|
||||
try {
|
||||
Boolean success = recordInfoService.deleteById(id);
|
||||
return success ? Result.success(true) : Result.error("删除失败(记录信息不存在或已删除)");
|
||||
} catch (IllegalArgumentException e) {
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.rczn.rcznautoplc.controller;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.rczn.domain.PageBean;
|
||||
import com.rczn.domain.Result;
|
||||
import com.rczn.rcznautoplc.domain.StepInfo;
|
||||
import com.rczn.rcznautoplc.service.StepInfoService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
import io.swagger.v3.oas.annotations.enums.ParameterIn;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/stepInfo")
|
||||
@Tag(name = "步骤信息管理", description = "步骤信息增删改查+分页查询接口")
|
||||
public class StepInfoController {
|
||||
|
||||
@Autowired
|
||||
StepInfoService stepInfoService;
|
||||
|
||||
|
||||
@GetMapping(value = "/listPage", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "分页查询步骤信息", description = "支持岛屿ID精准查询、步骤名称模糊查询")
|
||||
@Parameters({
|
||||
@Parameter(name = "pageNum", description = "页码(必填)", required = true, example = "1", in = ParameterIn.QUERY),
|
||||
@Parameter(name = "pageSize", description = "每页条数(必填)", required = true, example = "10", in = ParameterIn.QUERY),
|
||||
@Parameter(name = "islandId", description = "岛屿ID(可选,精准查询)", required = false, example = "1", in = ParameterIn.QUERY),
|
||||
@Parameter(name = "stepName", description = "步骤名称(可选,模糊查询)", required = false, example = "检测", in = ParameterIn.QUERY)
|
||||
})
|
||||
public Result getStepInfoPage(
|
||||
@RequestParam Integer pageNum,
|
||||
@RequestParam Integer pageSize,
|
||||
@RequestParam(required = false) Integer islandId,
|
||||
@RequestParam(required = false) String stepName) {
|
||||
PageInfo<StepInfo> pageBean = stepInfoService.selectPage(pageNum, pageSize, islandId, stepName);
|
||||
return Result.success(pageBean);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/getById/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "查询单个步骤信息", description = "根据步骤信息ID查询详情")
|
||||
public Result getStepInfoById(@PathVariable Long id) {
|
||||
StepInfo stepInfo = stepInfoService.selectById(id);
|
||||
return stepInfo != null ? Result.success(stepInfo) : Result.error("步骤信息不存在");
|
||||
}
|
||||
|
||||
@PostMapping(value = "/add", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "新增步骤信息", description = "岛屿ID、步骤名称为必填项")
|
||||
public Result addStepInfo(@RequestBody StepInfo stepInfo) {
|
||||
try {
|
||||
Long stepInfoId = stepInfoService.insert(stepInfo);
|
||||
return Result.success(stepInfoId);
|
||||
} catch (IllegalArgumentException e) {
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@PutMapping(value = "/update", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "修改步骤信息", description = "需传入步骤信息ID,其他字段可选(非空则更新)")
|
||||
public Result updateStepInfo(@RequestBody StepInfo stepInfo) {
|
||||
try {
|
||||
Boolean success = stepInfoService.update(stepInfo);
|
||||
return success ? Result.success(true) : Result.error("修改失败(步骤信息不存在或已删除)");
|
||||
} catch (IllegalArgumentException e) {
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@DeleteMapping(value = "/del/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "删除步骤信息", description = "逻辑删除(设置delSign=1,不物理删除数据)")
|
||||
public Result deleteStepInfo(@PathVariable Long id) {
|
||||
try {
|
||||
Boolean success = stepInfoService.deleteById(id);
|
||||
return success ? Result.success(true) : Result.error("删除失败(步骤信息不存在或已删除)");
|
||||
} catch (IllegalArgumentException e) {
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,9 @@
|
||||
package com.rczn.rcznautoplc.domain;
|
||||
|
||||
import com.rczn.domain.BaseBean;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ToString
|
||||
|
||||
public class GoodsInfo extends BaseBean {
|
||||
private String goodsName;
|
||||
@@ -25,4 +17,59 @@ public class GoodsInfo extends BaseBean {
|
||||
private Integer goodBatch;
|
||||
|
||||
private String desc;
|
||||
|
||||
public GoodsInfo() {
|
||||
}
|
||||
|
||||
public GoodsInfo(Long id, Long createId, LocalDateTime createTime, Long updateId, LocalDateTime updateTime, boolean delSign, String remark) {
|
||||
super(id, createId, createTime, updateId, updateTime, delSign, remark);
|
||||
}
|
||||
|
||||
public String getGoodsName() {
|
||||
return goodsName;
|
||||
}
|
||||
|
||||
public void setGoodsName(String goodsName) {
|
||||
this.goodsName = goodsName;
|
||||
}
|
||||
|
||||
public String getGoodsType() {
|
||||
return goodsType;
|
||||
}
|
||||
|
||||
public void setGoodsType(String goodsType) {
|
||||
this.goodsType = goodsType;
|
||||
}
|
||||
|
||||
public LocalDateTime getIncomeTime() {
|
||||
return incomeTime;
|
||||
}
|
||||
|
||||
public void setIncomeTime(LocalDateTime incomeTime) {
|
||||
this.incomeTime = incomeTime;
|
||||
}
|
||||
|
||||
public String getGoodFrom() {
|
||||
return goodFrom;
|
||||
}
|
||||
|
||||
public void setGoodFrom(String goodFrom) {
|
||||
this.goodFrom = goodFrom;
|
||||
}
|
||||
|
||||
public Integer getGoodBatch() {
|
||||
return goodBatch;
|
||||
}
|
||||
|
||||
public void setGoodBatch(Integer goodBatch) {
|
||||
this.goodBatch = goodBatch;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public void setDesc(String desc) {
|
||||
this.desc = desc;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,10 @@
|
||||
package com.rczn.rcznautoplc.domain;
|
||||
|
||||
import com.rczn.domain.BaseBean;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ToString
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
public class IslandInfo extends BaseBean {
|
||||
private String islandName;
|
||||
|
||||
@@ -18,4 +13,43 @@ public class IslandInfo extends BaseBean {
|
||||
private String islandLogo;
|
||||
|
||||
private String desc;
|
||||
|
||||
public IslandInfo() {
|
||||
}
|
||||
|
||||
public IslandInfo(Long id, Long createId, LocalDateTime createTime, Long updateId, LocalDateTime updateTime, boolean delSign, String remark) {
|
||||
super(id, createId, createTime, updateId, updateTime, delSign, remark);
|
||||
}
|
||||
|
||||
public String getIslandName() {
|
||||
return islandName;
|
||||
}
|
||||
|
||||
public void setIslandName(String islandName) {
|
||||
this.islandName = islandName;
|
||||
}
|
||||
|
||||
public String getIslandCode() {
|
||||
return islandCode;
|
||||
}
|
||||
|
||||
public void setIslandCode(String islandCode) {
|
||||
this.islandCode = islandCode;
|
||||
}
|
||||
|
||||
public String getIslandLogo() {
|
||||
return islandLogo;
|
||||
}
|
||||
|
||||
public void setIslandLogo(String islandLogo) {
|
||||
this.islandLogo = islandLogo;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public void setDesc(String desc) {
|
||||
this.desc = desc;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,8 @@
|
||||
package com.rczn.rcznautoplc.domain;
|
||||
|
||||
import com.rczn.domain.BaseBean;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ToString
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public class IslandParam extends BaseBean {
|
||||
private Integer islandId;
|
||||
@@ -29,4 +22,83 @@ public class IslandParam extends BaseBean {
|
||||
private IslandInfo islandInfo;
|
||||
|
||||
private StepInfo stepInfo;
|
||||
|
||||
public IslandParam() {
|
||||
}
|
||||
|
||||
public IslandParam(Long id, Long createId, LocalDateTime createTime, Long updateId, LocalDateTime updateTime, boolean delSign, String remark) {
|
||||
super(id, createId, createTime, updateId, updateTime, delSign, remark);
|
||||
}
|
||||
|
||||
public Integer getIslandId() {
|
||||
return islandId;
|
||||
}
|
||||
|
||||
public void setIslandId(Integer islandId) {
|
||||
this.islandId = islandId;
|
||||
}
|
||||
|
||||
public Integer getStepId() {
|
||||
return stepId;
|
||||
}
|
||||
|
||||
public void setStepId(Integer stepId) {
|
||||
this.stepId = stepId;
|
||||
}
|
||||
|
||||
public String getParamName() {
|
||||
return paramName;
|
||||
}
|
||||
|
||||
public void setParamName(String paramName) {
|
||||
this.paramName = paramName;
|
||||
}
|
||||
|
||||
public String getParamType() {
|
||||
return paramType;
|
||||
}
|
||||
|
||||
public void setParamType(String paramType) {
|
||||
this.paramType = paramType;
|
||||
}
|
||||
|
||||
public String getParamUnit() {
|
||||
return paramUnit;
|
||||
}
|
||||
|
||||
public void setParamUnit(String paramUnit) {
|
||||
this.paramUnit = paramUnit;
|
||||
}
|
||||
|
||||
public String getParamValue() {
|
||||
return paramValue;
|
||||
}
|
||||
|
||||
public void setParamValue(String paramValue) {
|
||||
this.paramValue = paramValue;
|
||||
}
|
||||
|
||||
public String getFormType() {
|
||||
return formType;
|
||||
}
|
||||
|
||||
public void setFormType(String formType) {
|
||||
this.formType = formType;
|
||||
}
|
||||
|
||||
public IslandInfo getIslandInfo() {
|
||||
return islandInfo;
|
||||
}
|
||||
|
||||
public void setIslandInfo(IslandInfo islandInfo) {
|
||||
this.islandInfo = islandInfo;
|
||||
}
|
||||
|
||||
public StepInfo getStepInfo() {
|
||||
return stepInfo;
|
||||
}
|
||||
|
||||
public void setStepInfo(StepInfo stepInfo) {
|
||||
this.stepInfo = stepInfo;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,8 @@
|
||||
package com.rczn.rcznautoplc.domain;
|
||||
|
||||
import com.rczn.domain.BaseBean;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ToString
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public class RecordInfo extends BaseBean {
|
||||
private String recordName;
|
||||
@@ -19,4 +12,43 @@ public class RecordInfo extends BaseBean {
|
||||
private Boolean recordStatus; // 0-未处理,1-已处理
|
||||
|
||||
private String recordContent;
|
||||
|
||||
public RecordInfo() {
|
||||
}
|
||||
|
||||
public RecordInfo(Long id, Long createId, LocalDateTime createTime, Long updateId, LocalDateTime updateTime, boolean delSign, String remark) {
|
||||
super(id, createId, createTime, updateId, updateTime, delSign, remark);
|
||||
}
|
||||
|
||||
public String getRecordName() {
|
||||
return recordName;
|
||||
}
|
||||
|
||||
public void setRecordName(String recordName) {
|
||||
this.recordName = recordName;
|
||||
}
|
||||
|
||||
public Integer getRecordType() {
|
||||
return recordType;
|
||||
}
|
||||
|
||||
public void setRecordType(Integer recordType) {
|
||||
this.recordType = recordType;
|
||||
}
|
||||
|
||||
public Boolean getRecordStatus() {
|
||||
return recordStatus;
|
||||
}
|
||||
|
||||
public void setRecordStatus(Boolean recordStatus) {
|
||||
this.recordStatus = recordStatus;
|
||||
}
|
||||
|
||||
public String getRecordContent() {
|
||||
return recordContent;
|
||||
}
|
||||
|
||||
public void setRecordContent(String recordContent) {
|
||||
this.recordContent = recordContent;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,8 @@
|
||||
package com.rczn.rcznautoplc.domain;
|
||||
|
||||
import com.rczn.domain.BaseBean;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ToString
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public class StepInfo extends BaseBean {
|
||||
private Integer islandId;
|
||||
@@ -19,4 +12,43 @@ public class StepInfo extends BaseBean {
|
||||
private String stepDesc;
|
||||
|
||||
private IslandInfo islandInfo;
|
||||
|
||||
public StepInfo() {
|
||||
}
|
||||
|
||||
public StepInfo(Long id, Long createId, LocalDateTime createTime, Long updateId, LocalDateTime updateTime, boolean delSign, String remark) {
|
||||
super(id, createId, createTime, updateId, updateTime, delSign, remark);
|
||||
}
|
||||
|
||||
public Integer getIslandId() {
|
||||
return islandId;
|
||||
}
|
||||
|
||||
public void setIslandId(Integer islandId) {
|
||||
this.islandId = islandId;
|
||||
}
|
||||
|
||||
public String getStepName() {
|
||||
return stepName;
|
||||
}
|
||||
|
||||
public void setStepName(String stepName) {
|
||||
this.stepName = stepName;
|
||||
}
|
||||
|
||||
public String getStepDesc() {
|
||||
return stepDesc;
|
||||
}
|
||||
|
||||
public void setStepDesc(String stepDesc) {
|
||||
this.stepDesc = stepDesc;
|
||||
}
|
||||
|
||||
public IslandInfo getIslandInfo() {
|
||||
return islandInfo;
|
||||
}
|
||||
|
||||
public void setIslandInfo(IslandInfo islandInfo) {
|
||||
this.islandInfo = islandInfo;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.rczn.rcznautoplc.mapper;
|
||||
|
||||
import com.rczn.rcznautoplc.domain.DevParam;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface DevParamMapper {
|
||||
/**
|
||||
* 新增设备参数
|
||||
*/
|
||||
Long insert(DevParam devParam);
|
||||
|
||||
/**
|
||||
* 根据ID更新设备参数
|
||||
*/
|
||||
Boolean update(DevParam devParam);
|
||||
|
||||
/**
|
||||
* 逻辑删除设备参数
|
||||
*/
|
||||
Boolean deleteById(@Param("id") Long id);
|
||||
|
||||
/**
|
||||
* 根据ID查询设备参数
|
||||
*/
|
||||
DevParam selectById(@Param("id") Long id);
|
||||
|
||||
/**
|
||||
* 分页查询设备参数(支持条件过滤)
|
||||
*/
|
||||
List<DevParam> selectPage(DevParam devParam);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.rczn.rcznautoplc.mapper;
|
||||
|
||||
import com.rczn.rcznautoplc.domain.FlowInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface FlowInfoMapper {
|
||||
Long insert(FlowInfo flowInfo);
|
||||
Boolean update(FlowInfo flowInfo);
|
||||
Boolean deleteById(@Param("id") Long id);
|
||||
FlowInfo selectById(@Param("id") Long id);
|
||||
List<FlowInfo> selectPage(FlowInfo flowInfo);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.rczn.rcznautoplc.mapper;
|
||||
|
||||
import com.rczn.rcznautoplc.domain.GoodsFlowStatus;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface GoodsFlowStatusMapper {
|
||||
Long insert(GoodsFlowStatus goodsFlowStatus);
|
||||
Boolean update(GoodsFlowStatus goodsFlowStatus);
|
||||
Boolean deleteById(@Param("id") Long id);
|
||||
GoodsFlowStatus selectById(@Param("id") Long id);
|
||||
List<GoodsFlowStatus> selectPage(GoodsFlowStatus goodsFlowStatus);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.rczn.rcznautoplc.mapper;
|
||||
|
||||
import com.rczn.rcznautoplc.domain.GoodsInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface GoodsInfoMapper {
|
||||
Long insert(GoodsInfo goodsInfo);
|
||||
Boolean update(GoodsInfo goodsInfo);
|
||||
Boolean deleteById(@Param("id") Long id);
|
||||
GoodsInfo selectById(@Param("id") Long id);
|
||||
List<GoodsInfo> selectPage(GoodsInfo goodsInfo);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.rczn.rcznautoplc.mapper;
|
||||
|
||||
import com.rczn.rcznautoplc.domain.IslandInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface IslandInfoMapper {
|
||||
Long insert(IslandInfo islandInfo);
|
||||
Boolean update(IslandInfo islandInfo);
|
||||
Boolean deleteById(@Param("id") Long id);
|
||||
IslandInfo selectById(@Param("id") Long id);
|
||||
List<IslandInfo> selectPage(IslandInfo islandInfo);
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.rczn.rcznautoplc.mapper;
|
||||
|
||||
import com.rczn.rcznautoplc.domain.IslandParam;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface IslandParamMapper {
|
||||
/**
|
||||
* 新增岛屿参数(返回自增ID)
|
||||
*/
|
||||
Long insert(IslandParam islandParam);
|
||||
|
||||
/**
|
||||
* 根据ID更新岛屿参数(非空字段才更新)
|
||||
*/
|
||||
Boolean update(IslandParam islandParam);
|
||||
|
||||
/**
|
||||
* 逻辑删除岛屿参数(设置delSign=1)
|
||||
*/
|
||||
Boolean deleteById(@Param("id") Long id);
|
||||
|
||||
/**
|
||||
* 根据ID查询岛屿参数(关联查询岛屿信息和步骤信息)
|
||||
*/
|
||||
IslandParam selectById(@Param("id") Long id);
|
||||
|
||||
/**
|
||||
* 分页查询岛屿参数(支持条件过滤,不关联查询关联对象)
|
||||
*/
|
||||
List<IslandParam> selectPage(IslandParam islandParam);
|
||||
|
||||
/**
|
||||
* 分页查询岛屿参数(关联查询岛屿信息和步骤信息,支持条件过滤)
|
||||
*/
|
||||
List<IslandParam> selectPageWithRelations(IslandParam islandParam);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.rczn.rcznautoplc.mapper;
|
||||
|
||||
import com.rczn.rcznautoplc.domain.RecordInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface RecordInfoMapper {
|
||||
Long insert(RecordInfo recordInfo);
|
||||
Boolean update(RecordInfo recordInfo);
|
||||
Boolean deleteById(@Param("id") Long id);
|
||||
RecordInfo selectById(@Param("id") Long id);
|
||||
List<RecordInfo> selectPage(RecordInfo recordInfo);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.rczn.rcznautoplc.mapper;
|
||||
|
||||
import com.rczn.rcznautoplc.domain.StepInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface StepInfoMapper {
|
||||
Long insert(StepInfo stepInfo);
|
||||
Boolean update(StepInfo stepInfo);
|
||||
Boolean deleteById(@Param("id") Long id);
|
||||
StepInfo selectById(@Param("id") Long id);
|
||||
List<StepInfo> selectPage(StepInfo stepInfo);
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.rczn.rcznautoplc.service;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.rczn.domain.PageBean;
|
||||
import com.rczn.rcznautoplc.domain.DevParam;
|
||||
|
||||
public interface DevParamService {
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
PageInfo<DevParam> selectPage(Integer pageNum, Integer pageSize, Integer devId, String paramName, String paramValue);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
*/
|
||||
DevParam selectById(Long id);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
Long insert(DevParam devParam);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
Boolean update(DevParam devParam);
|
||||
|
||||
/**
|
||||
* 逻辑删除
|
||||
*/
|
||||
Boolean deleteById(Long id);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.rczn.rcznautoplc.service;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.rczn.domain.PageBean;
|
||||
import com.rczn.rcznautoplc.domain.FlowInfo;
|
||||
|
||||
public interface FlowInfoService {
|
||||
PageInfo<FlowInfo> selectPage(Integer pageNum, Integer pageSize, Integer flowIndex, String flowName, String islandIdList);
|
||||
FlowInfo selectById(Long id);
|
||||
Long insert(FlowInfo flowInfo);
|
||||
Boolean update(FlowInfo flowInfo);
|
||||
Boolean deleteById(Long id);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.rczn.rcznautoplc.service;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.rczn.domain.PageBean;
|
||||
import com.rczn.rcznautoplc.domain.GoodsFlowStatus;
|
||||
|
||||
public interface GoodsFlowStatusService {
|
||||
PageInfo<GoodsFlowStatus> selectPage(Integer pageNum, Integer pageSize, Integer goodsId, Integer flowId, Integer islandId, Integer status);
|
||||
GoodsFlowStatus selectById(Long id);
|
||||
Long insert(GoodsFlowStatus goodsFlowStatus);
|
||||
Boolean update(GoodsFlowStatus goodsFlowStatus);
|
||||
Boolean deleteById(Long id);
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.rczn.rcznautoplc.service;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.rczn.domain.PageBean;
|
||||
import com.rczn.rcznautoplc.domain.GoodsInfo;
|
||||
|
||||
public interface GoodsInfoService {
|
||||
/**
|
||||
* 分页查询货物信息
|
||||
*/
|
||||
PageInfo<GoodsInfo> selectPage(Integer pageNum, Integer pageSize, String goodsName, String goodsType, String goodFrom, Integer goodBatch);
|
||||
|
||||
/**
|
||||
* 根据ID查询货物信息
|
||||
*/
|
||||
GoodsInfo selectById(Long id);
|
||||
|
||||
/**
|
||||
* 新增货物信息
|
||||
*/
|
||||
Long insert(GoodsInfo goodsInfo);
|
||||
|
||||
/**
|
||||
* 修改货物信息
|
||||
*/
|
||||
Boolean update(GoodsInfo goodsInfo);
|
||||
|
||||
/**
|
||||
* 逻辑删除货物信息
|
||||
*/
|
||||
Boolean deleteById(Long id);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.rczn.rcznautoplc.service;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.rczn.domain.PageBean;
|
||||
import com.rczn.rcznautoplc.domain.IslandInfo;
|
||||
|
||||
public interface IslandInfoService {
|
||||
PageInfo<IslandInfo> selectPage(Integer pageNum, Integer pageSize, String islandName, String islandCode);
|
||||
IslandInfo selectById(Long id);
|
||||
Long insert(IslandInfo islandInfo);
|
||||
Boolean update(IslandInfo islandInfo);
|
||||
Boolean deleteById(Long id);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.rczn.rcznautoplc.service;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.rczn.domain.PageBean;
|
||||
import com.rczn.rcznautoplc.domain.IslandParam;
|
||||
|
||||
public interface IslandParamService {
|
||||
PageInfo<IslandParam> selectPage(Integer pageNum, Integer pageSize, Integer islandId, Integer stepId, String paramName, String paramType);
|
||||
IslandParam selectById(Long id);
|
||||
Long insert(IslandParam islandParam);
|
||||
Boolean update(IslandParam islandParam);
|
||||
Boolean deleteById(Long id);
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.rczn.rcznautoplc.service;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.rczn.rcznautoplc.domain.RecordInfo;
|
||||
|
||||
public interface RecordInfoService {
|
||||
PageInfo<RecordInfo> selectPage(Integer pageNum, Integer pageSize, String recordName, Integer recordType, Boolean recordStatus);
|
||||
RecordInfo selectById(Long id);
|
||||
Long insert(RecordInfo recordInfo);
|
||||
Boolean update(RecordInfo recordInfo);
|
||||
Boolean deleteById(Long id);
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.rczn.rcznautoplc.service;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.rczn.rcznautoplc.domain.StepInfo;
|
||||
|
||||
public interface StepInfoService {
|
||||
PageInfo<StepInfo> selectPage(Integer pageNum, Integer pageSize, Integer islandId, String stepName);
|
||||
StepInfo selectById(Long id);
|
||||
Long insert(StepInfo stepInfo);
|
||||
Boolean update(StepInfo stepInfo);
|
||||
Boolean deleteById(Long id);
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.rczn.rcznautoplc.service.impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.rczn.domain.PageBean;
|
||||
import com.rczn.rcznautoplc.domain.DevParam;
|
||||
import com.rczn.rcznautoplc.mapper.DevParamMapper;
|
||||
import com.rczn.rcznautoplc.service.DevParamService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class DevParamServiceImpl implements DevParamService {
|
||||
|
||||
@Autowired
|
||||
DevParamMapper devParamMapper;
|
||||
|
||||
@Override
|
||||
public PageInfo<DevParam> selectPage(Integer pageNum, Integer pageSize, Integer devId, String paramName, String paramValue) {
|
||||
// 1. 开启分页
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
// 2. 构建查询条件
|
||||
DevParam queryParam = new DevParam();
|
||||
queryParam.setDevId(devId);
|
||||
queryParam.setParamName(paramName);
|
||||
queryParam.setParamValue(paramValue);
|
||||
// 3. 执行查询
|
||||
List<DevParam> list = devParamMapper.selectPage(queryParam);
|
||||
// 4. 包装分页结果
|
||||
return new PageInfo<>(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DevParam selectById(Long id) {
|
||||
if (id == null) {
|
||||
throw new IllegalArgumentException("ID不能为空");
|
||||
}
|
||||
return devParamMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long insert(DevParam devParam) {
|
||||
if (devParam.getDevId() == null) {
|
||||
throw new IllegalArgumentException("设备ID不能为空");
|
||||
}
|
||||
if (devParam.getParamName() == null || devParam.getParamName().isEmpty()) {
|
||||
throw new IllegalArgumentException("参数名称不能为空");
|
||||
}
|
||||
return devParamMapper.insert(devParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean update(DevParam devParam) {
|
||||
if (devParam.getId() == null) {
|
||||
throw new IllegalArgumentException("ID不能为空");
|
||||
}
|
||||
return devParamMapper.update(devParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteById(Long id) {
|
||||
if (id == null) {
|
||||
throw new IllegalArgumentException("ID不能为空");
|
||||
}
|
||||
return devParamMapper.deleteById(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.rczn.rcznautoplc.service.impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.rczn.domain.PageBean;
|
||||
import com.rczn.rcznautoplc.domain.FlowInfo;
|
||||
import com.rczn.rcznautoplc.mapper.FlowInfoMapper;
|
||||
import com.rczn.rcznautoplc.service.FlowInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class FlowInfoServiceImpl implements FlowInfoService {
|
||||
|
||||
@Autowired
|
||||
FlowInfoMapper flowInfoMapper;
|
||||
|
||||
@Override
|
||||
public PageInfo<FlowInfo> selectPage(Integer pageNum, Integer pageSize, Integer flowIndex, String flowName, String islandIdList) {
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
FlowInfo queryParam = new FlowInfo();
|
||||
queryParam.setFlowIndex(flowIndex);
|
||||
queryParam.setFlowName(flowName);
|
||||
queryParam.setIslandIdList(islandIdList);
|
||||
List<FlowInfo> list = flowInfoMapper.selectPage(queryParam);
|
||||
return new PageInfo<>(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FlowInfo selectById(Long id) {
|
||||
if (id == null) throw new IllegalArgumentException("ID不能为空");
|
||||
return flowInfoMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long insert(FlowInfo flowInfo) {
|
||||
if (flowInfo.getFlowName() == null || flowInfo.getFlowName().isEmpty()) {
|
||||
throw new IllegalArgumentException("流程名称不能为空");
|
||||
}
|
||||
if (flowInfo.getFlowIndex() == null) {
|
||||
throw new IllegalArgumentException("流程排序不能为空");
|
||||
}
|
||||
return flowInfoMapper.insert(flowInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean update(FlowInfo flowInfo) {
|
||||
if (flowInfo.getId() == null) throw new IllegalArgumentException("ID不能为空");
|
||||
return flowInfoMapper.update(flowInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteById(Long id) {
|
||||
if (id == null) throw new IllegalArgumentException("ID不能为空");
|
||||
return flowInfoMapper.deleteById(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.rczn.rcznautoplc.service.impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.rczn.domain.PageBean;
|
||||
import com.rczn.rcznautoplc.domain.GoodsFlowStatus;
|
||||
import com.rczn.rcznautoplc.mapper.GoodsFlowStatusMapper;
|
||||
import com.rczn.rcznautoplc.service.GoodsFlowStatusService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class GoodsFlowStatusServiceImpl implements GoodsFlowStatusService {
|
||||
|
||||
@Autowired
|
||||
GoodsFlowStatusMapper goodsFlowStatusMapper;
|
||||
|
||||
@Override
|
||||
public PageInfo<GoodsFlowStatus> selectPage(Integer pageNum, Integer pageSize, Integer goodsId, Integer flowId, Integer islandId, Integer status) {
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
GoodsFlowStatus queryParam = new GoodsFlowStatus();
|
||||
queryParam.setGoodsId(goodsId);
|
||||
queryParam.setFlowId(flowId);
|
||||
queryParam.setIslandId(islandId);
|
||||
queryParam.setStatus(status);
|
||||
List<GoodsFlowStatus> list = goodsFlowStatusMapper.selectPage(queryParam);
|
||||
return new PageInfo<>(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GoodsFlowStatus selectById(Long id) {
|
||||
if (id == null) throw new IllegalArgumentException("ID不能为空");
|
||||
return goodsFlowStatusMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long insert(GoodsFlowStatus goodsFlowStatus) {
|
||||
if (goodsFlowStatus.getGoodsId() == null) throw new IllegalArgumentException("货物ID不能为空");
|
||||
if (goodsFlowStatus.getFlowId() == null) throw new IllegalArgumentException("流程ID不能为空");
|
||||
if (goodsFlowStatus.getStatus() == null) throw new IllegalArgumentException("状态不能为空(0-未执行,1-执行,10-通过,11-失败)");
|
||||
return goodsFlowStatusMapper.insert(goodsFlowStatus);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean update(GoodsFlowStatus goodsFlowStatus) {
|
||||
if (goodsFlowStatus.getId() == null) throw new IllegalArgumentException("ID不能为空");
|
||||
return goodsFlowStatusMapper.update(goodsFlowStatus);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteById(Long id) {
|
||||
if (id == null) throw new IllegalArgumentException("ID不能为空");
|
||||
return goodsFlowStatusMapper.deleteById(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.rczn.rcznautoplc.service.impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.rczn.domain.PageBean;
|
||||
import com.rczn.rcznautoplc.domain.GoodsInfo;
|
||||
import com.rczn.rcznautoplc.mapper.GoodsInfoMapper;
|
||||
import com.rczn.rcznautoplc.service.GoodsInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class GoodsInfoServiceImpl implements GoodsInfoService {
|
||||
|
||||
@Autowired
|
||||
GoodsInfoMapper goodsInfoMapper;
|
||||
|
||||
@Override
|
||||
public PageInfo<GoodsInfo> selectPage(Integer pageNum, Integer pageSize, String goodsName, String goodsType, String goodFrom, Integer goodBatch) {
|
||||
// 开启分页
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
// 构建查询条件
|
||||
GoodsInfo queryParam = new GoodsInfo();
|
||||
queryParam.setGoodsName(goodsName);
|
||||
queryParam.setGoodsType(goodsType);
|
||||
queryParam.setGoodFrom(goodFrom);
|
||||
queryParam.setGoodBatch(goodBatch);
|
||||
// 执行查询
|
||||
List<GoodsInfo> list = goodsInfoMapper.selectPage(queryParam);
|
||||
// 包装分页结果
|
||||
return new PageInfo<>(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GoodsInfo selectById(Long id) {
|
||||
if (id == null) {
|
||||
throw new IllegalArgumentException("ID不能为空");
|
||||
}
|
||||
return goodsInfoMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long insert(GoodsInfo goodsInfo) {
|
||||
if (goodsInfo.getGoodsName() == null || goodsInfo.getGoodsName().isEmpty()) {
|
||||
throw new IllegalArgumentException("货物名称不能为空");
|
||||
}
|
||||
if (goodsInfo.getGoodsType() == null || goodsInfo.getGoodsType().isEmpty()) {
|
||||
throw new IllegalArgumentException("货物类型不能为空");
|
||||
}
|
||||
if (goodsInfo.getIncomeTime() == null) {
|
||||
throw new IllegalArgumentException("入库时间不能为空");
|
||||
}
|
||||
return goodsInfoMapper.insert(goodsInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean update(GoodsInfo goodsInfo) {
|
||||
if (goodsInfo.getId() == null) {
|
||||
throw new IllegalArgumentException("ID不能为空");
|
||||
}
|
||||
return goodsInfoMapper.update(goodsInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteById(Long id) {
|
||||
if (id == null) {
|
||||
throw new IllegalArgumentException("ID不能为空");
|
||||
}
|
||||
return goodsInfoMapper.deleteById(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.rczn.rcznautoplc.service.impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.rczn.rcznautoplc.domain.IslandInfo;
|
||||
import com.rczn.rcznautoplc.mapper.IslandInfoMapper;
|
||||
import com.rczn.rcznautoplc.service.IslandInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class IslandInfoServiceImpl implements IslandInfoService {
|
||||
|
||||
@Autowired
|
||||
IslandInfoMapper islandInfoMapper;
|
||||
|
||||
@Override
|
||||
public PageInfo<IslandInfo> selectPage(Integer pageNum, Integer pageSize, String islandName, String islandCode) {
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
IslandInfo queryParam = new IslandInfo();
|
||||
queryParam.setIslandName(islandName);
|
||||
queryParam.setIslandCode(islandCode);
|
||||
List<IslandInfo> list = islandInfoMapper.selectPage(queryParam);
|
||||
return new PageInfo<>(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IslandInfo selectById(Long id) {
|
||||
if (id == null) throw new IllegalArgumentException("ID不能为空");
|
||||
return islandInfoMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long insert(IslandInfo islandInfo) {
|
||||
if (islandInfo.getIslandName() == null || islandInfo.getIslandName().isEmpty()) {
|
||||
throw new IllegalArgumentException("岛屿名称不能为空");
|
||||
}
|
||||
if (islandInfo.getIslandCode() == null || islandInfo.getIslandCode().isEmpty()) {
|
||||
throw new IllegalArgumentException("岛屿编码不能为空");
|
||||
}
|
||||
return islandInfoMapper.insert(islandInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean update(IslandInfo islandInfo) {
|
||||
if (islandInfo.getId() == null) throw new IllegalArgumentException("ID不能为空");
|
||||
return islandInfoMapper.update(islandInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteById(Long id) {
|
||||
if (id == null) throw new IllegalArgumentException("ID不能为空");
|
||||
return islandInfoMapper.deleteById(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.rczn.rcznautoplc.service.impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.rczn.domain.PageBean;
|
||||
import com.rczn.rcznautoplc.domain.IslandParam;
|
||||
import com.rczn.rcznautoplc.mapper.IslandParamMapper;
|
||||
import com.rczn.rcznautoplc.service.IslandParamService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class IslandParamServiceImpl implements IslandParamService {
|
||||
|
||||
@Autowired
|
||||
IslandParamMapper islandParamMapper;
|
||||
|
||||
@Override
|
||||
public PageInfo<IslandParam> selectPage(Integer pageNum, Integer pageSize, Integer islandId, Integer stepId, String paramName, String paramType) {
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
IslandParam queryParam = new IslandParam();
|
||||
queryParam.setIslandId(islandId);
|
||||
queryParam.setStepId(stepId);
|
||||
queryParam.setParamName(paramName);
|
||||
queryParam.setParamType(paramType);
|
||||
List<IslandParam> list = islandParamMapper.selectPage(queryParam);
|
||||
return new PageInfo<>(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IslandParam selectById(Long id) {
|
||||
if (id == null) throw new IllegalArgumentException("ID不能为空");
|
||||
return islandParamMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long insert(IslandParam islandParam) {
|
||||
if (islandParam.getIslandId() == null) throw new IllegalArgumentException("岛屿ID不能为空");
|
||||
if (islandParam.getStepId() == null) throw new IllegalArgumentException("步骤ID不能为空");
|
||||
if (islandParam.getParamName() == null || islandParam.getParamName().isEmpty()) {
|
||||
throw new IllegalArgumentException("参数名称不能为空");
|
||||
}
|
||||
return islandParamMapper.insert(islandParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean update(IslandParam islandParam) {
|
||||
if (islandParam.getId() == null) throw new IllegalArgumentException("ID不能为空");
|
||||
return islandParamMapper.update(islandParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteById(Long id) {
|
||||
if (id == null) throw new IllegalArgumentException("ID不能为空");
|
||||
return islandParamMapper.deleteById(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.rczn.rcznautoplc.service.impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.rczn.rcznautoplc.domain.RecordInfo;
|
||||
import com.rczn.rcznautoplc.mapper.RecordInfoMapper;
|
||||
import com.rczn.rcznautoplc.service.RecordInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class RecordInfoServiceImpl implements RecordInfoService {
|
||||
|
||||
@Autowired
|
||||
RecordInfoMapper recordInfoMapper;
|
||||
|
||||
@Override
|
||||
public PageInfo<RecordInfo> selectPage(Integer pageNum, Integer pageSize, String recordName, Integer recordType, Boolean recordStatus) {
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
RecordInfo queryParam = new RecordInfo();
|
||||
queryParam.setRecordName(recordName);
|
||||
queryParam.setRecordType(recordType);
|
||||
queryParam.setRecordStatus(recordStatus);
|
||||
List<RecordInfo> list = recordInfoMapper.selectPage(queryParam);
|
||||
return new PageInfo<>(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RecordInfo selectById(Long id) {
|
||||
if (id == null) throw new IllegalArgumentException("ID不能为空");
|
||||
return recordInfoMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long insert(RecordInfo recordInfo) {
|
||||
if (recordInfo.getRecordName() == null || recordInfo.getRecordName().isEmpty()) {
|
||||
throw new IllegalArgumentException("记录名称不能为空");
|
||||
}
|
||||
if (recordInfo.getRecordType() == null) {
|
||||
throw new IllegalArgumentException("记录类型不能为空(1-设备异常,2-样品异常,3-操作异常)");
|
||||
}
|
||||
if (recordInfo.getRecordContent() == null || recordInfo.getRecordContent().isEmpty()) {
|
||||
throw new IllegalArgumentException("记录内容不能为空");
|
||||
}
|
||||
return recordInfoMapper.insert(recordInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean update(RecordInfo recordInfo) {
|
||||
if (recordInfo.getId() == null) throw new IllegalArgumentException("ID不能为空");
|
||||
return recordInfoMapper.update(recordInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteById(Long id) {
|
||||
if (id == null) throw new IllegalArgumentException("ID不能为空");
|
||||
return recordInfoMapper.deleteById(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.rczn.rcznautoplc.service.impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.rczn.rcznautoplc.domain.StepInfo;
|
||||
import com.rczn.rcznautoplc.mapper.StepInfoMapper;
|
||||
import com.rczn.rcznautoplc.service.StepInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class StepInfoServiceImpl implements StepInfoService {
|
||||
|
||||
@Autowired
|
||||
StepInfoMapper stepInfoMapper;
|
||||
|
||||
@Override
|
||||
public PageInfo<StepInfo> selectPage(Integer pageNum, Integer pageSize, Integer islandId, String stepName) {
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
StepInfo queryParam = new StepInfo();
|
||||
queryParam.setIslandId(islandId);
|
||||
queryParam.setStepName(stepName);
|
||||
List<StepInfo> list = stepInfoMapper.selectPage(queryParam);
|
||||
return new PageInfo<>(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StepInfo selectById(Long id) {
|
||||
if (id == null) throw new IllegalArgumentException("ID不能为空");
|
||||
return stepInfoMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long insert(StepInfo stepInfo) {
|
||||
if (stepInfo.getIslandId() == null) throw new IllegalArgumentException("岛屿ID不能为空");
|
||||
if (stepInfo.getStepName() == null || stepInfo.getStepName().isEmpty()) {
|
||||
throw new IllegalArgumentException("步骤名称不能为空");
|
||||
}
|
||||
return stepInfoMapper.insert(stepInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean update(StepInfo stepInfo) {
|
||||
if (stepInfo.getId() == null) throw new IllegalArgumentException("ID不能为空");
|
||||
return stepInfoMapper.update(stepInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteById(Long id) {
|
||||
if (id == null) throw new IllegalArgumentException("ID不能为空");
|
||||
return stepInfoMapper.deleteById(id);
|
||||
}
|
||||
}
|
||||
@@ -75,14 +75,14 @@
|
||||
|
||||
<!-- 逻辑删除设备 -->
|
||||
<update id="deleteById">
|
||||
UPDATE sys_dev_info
|
||||
UPDATE tb_dev_info
|
||||
SET del_sign = 1, update_time = NOW()
|
||||
WHERE id = #{id} AND del_sign = 0
|
||||
</update>
|
||||
|
||||
<!-- 根据ID更新设备(非空字段才更新) -->
|
||||
<update id="updateById">
|
||||
UPDATE sys_dev_info
|
||||
UPDATE tb_dev_info
|
||||
<set>
|
||||
<if test="devName != null and devName != ''">dev_name = #{devName},</if>
|
||||
<if test="devModel != null and devModel != ''">dev_model = #{devModel},</if>
|
||||
@@ -104,7 +104,7 @@
|
||||
SELECT
|
||||
<include refid="baseColumn"/>,
|
||||
<include refid="devColumn"/>
|
||||
FROM sys_dev_info
|
||||
FROM tb_dev_info
|
||||
WHERE id = #{id} AND del_sign = 0
|
||||
</select>
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
SELECT
|
||||
<include refid="baseColumn"/>,
|
||||
<include refid="devColumn"/>
|
||||
FROM sys_dev_info
|
||||
FROM tb_dev_info
|
||||
WHERE del_sign = 0
|
||||
<!-- 设备名称模糊查询 -->
|
||||
<if test="devName != null and devName != ''">
|
||||
@@ -141,7 +141,7 @@
|
||||
<!-- 查询符合条件的设备总数 -->
|
||||
<select id="selectTotal" resultType="java.lang.Integer">
|
||||
SELECT COUNT(id)
|
||||
FROM sys_dev_info
|
||||
FROM tb_dev_info
|
||||
WHERE del_sign = 0
|
||||
<if test="devName != null and devName != ''">
|
||||
AND dev_name LIKE CONCAT('%', #{devName}, '%')
|
||||
@@ -165,7 +165,7 @@
|
||||
SELECT
|
||||
<include refid="baseColumn"/>,
|
||||
<include refid="devColumn"/>
|
||||
FROM sys_dev_info
|
||||
FROM tb_dev_info
|
||||
WHERE del_sign = 0
|
||||
ORDER BY id ASC
|
||||
</select>
|
||||
@@ -0,0 +1,67 @@
|
||||
<?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.rczn.rcznautoplc.mapper.DevParamMapper">
|
||||
<!-- BaseBean 公共字段 -->
|
||||
<sql id="baseColumn">
|
||||
id, create_id, create_time, update_id, update_time, del_sign, remark
|
||||
</sql>
|
||||
|
||||
<!-- DevParam 业务字段 -->
|
||||
<sql id="devParamColumn">
|
||||
dev_id, param_name, param_value, `desc`
|
||||
</sql>
|
||||
|
||||
<!-- 新增 -->
|
||||
<insert id="insert" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO tb_dev_param (
|
||||
<include refid="devParamColumn"/>,
|
||||
create_id, create_time, update_id, update_time, del_sign
|
||||
) VALUES (
|
||||
#{devId}, #{paramName}, #{paramValue}, #{desc},
|
||||
#{createId}, NOW(), #{updateId}, NOW(), 0
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!-- 更新 -->
|
||||
<update id="update">
|
||||
UPDATE tb_dev_param
|
||||
<set>
|
||||
<if test="devId != null">dev_id = #{devId},</if>
|
||||
<if test="paramName != null and paramName != ''">param_name = #{paramName},</if>
|
||||
<if test="paramValue != null and paramValue != ''">param_value = #{paramValue},</if>
|
||||
<if test="desc != null and desc != ''">`desc` = #{desc},</if>
|
||||
<if test="updateId != null">update_id = #{updateId},</if>
|
||||
update_time = NOW()
|
||||
</set>
|
||||
WHERE id = #{id} AND del_sign = 0
|
||||
</update>
|
||||
|
||||
<!-- 逻辑删除 -->
|
||||
<update id="deleteById">
|
||||
UPDATE tb_dev_param
|
||||
SET del_sign = 1, update_time = NOW()
|
||||
WHERE id = #{id} AND del_sign = 0
|
||||
</update>
|
||||
|
||||
<!-- 根据ID查询 -->
|
||||
<select id="selectById" resultType="com.rczn.rcznautoplc.domain.DevParam">
|
||||
SELECT
|
||||
<include refid="baseColumn"/>,
|
||||
<include refid="devParamColumn"/>
|
||||
FROM tb_dev_param
|
||||
WHERE id = #{id} AND del_sign = 0
|
||||
</select>
|
||||
|
||||
<!-- 分页查询(条件过滤) -->
|
||||
<select id="selectPage" resultType="com.rczn.rcznautoplc.domain.DevParam">
|
||||
SELECT
|
||||
<include refid="baseColumn"/>,
|
||||
<include refid="devParamColumn"/>
|
||||
FROM tb_dev_param
|
||||
WHERE del_sign = 0
|
||||
<if test="devId != null">AND dev_id = #{devId}</if>
|
||||
<if test="paramName != null and paramName != ''">AND param_name LIKE CONCAT('%', #{paramName}, '%')</if>
|
||||
<if test="paramValue != null and paramValue != ''">AND param_value LIKE CONCAT('%', #{paramValue}, '%')</if>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,59 @@
|
||||
<?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.rczn.rcznautoplc.mapper.FlowInfoMapper">
|
||||
<sql id="baseColumn">
|
||||
id, create_id, create_time, update_id, update_time, del_sign, remark
|
||||
</sql>
|
||||
|
||||
<sql id="flowInfoColumn">
|
||||
flow_index, flow_name, island_id_list
|
||||
</sql>
|
||||
|
||||
<insert id="insert" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO tb_flow_info (
|
||||
<include refid="flowInfoColumn"/>,
|
||||
create_id, create_time, update_id, update_time, del_sign
|
||||
) VALUES (
|
||||
#{flowIndex}, #{flowName}, #{islandIdList},
|
||||
#{createId}, NOW(), #{updateId}, NOW(), 0
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="update">
|
||||
UPDATE tb_flow_info
|
||||
<set>
|
||||
<if test="flowIndex != null">flow_index = #{flowIndex},</if>
|
||||
<if test="flowName != null and flowName != ''">flow_name = #{flowName},</if>
|
||||
<if test="islandIdList != null and islandIdList != ''">island_id_list = #{islandIdList},</if>
|
||||
<if test="updateId != null">update_id = #{updateId},</if>
|
||||
update_time = NOW()
|
||||
</set>
|
||||
WHERE id = #{id} AND del_sign = 0
|
||||
</update>
|
||||
|
||||
<update id="deleteById">
|
||||
UPDATE tb_flow_info
|
||||
SET del_sign = 1, update_time = NOW()
|
||||
WHERE id = #{id} AND del_sign = 0
|
||||
</update>
|
||||
|
||||
<select id="selectById" resultType="com.rczn.rcznautoplc.domain.FlowInfo">
|
||||
SELECT
|
||||
<include refid="baseColumn"/>,
|
||||
<include refid="flowInfoColumn"/>
|
||||
FROM tb_flow_info
|
||||
WHERE id = #{id} AND del_sign = 0
|
||||
</select>
|
||||
|
||||
<select id="selectPage" resultType="com.rczn.rcznautoplc.domain.FlowInfo">
|
||||
SELECT
|
||||
<include refid="baseColumn"/>,
|
||||
<include refid="flowInfoColumn"/>
|
||||
FROM tb_flow_info
|
||||
WHERE del_sign = 0
|
||||
<if test="flowIndex != null">AND flow_index = #{flowIndex}</if>
|
||||
<if test="flowName != null and flowName != ''">AND flow_name LIKE CONCAT('%', #{flowName}, '%')</if>
|
||||
<if test="islandIdList != null and islandIdList != ''">AND island_id_list LIKE CONCAT('%', #{islandIdList}, '%')</if>
|
||||
ORDER BY flow_index ASC
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,62 @@
|
||||
<?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.rczn.rcznautoplc.mapper.GoodsFlowStatusMapper">
|
||||
<sql id="baseColumn">
|
||||
id, create_id, create_time, update_id, update_time, del_sign, remark
|
||||
</sql>
|
||||
|
||||
<sql id="goodsFlowStatusColumn">
|
||||
goods_id, flow_id, island_id, flow_sort, status
|
||||
</sql>
|
||||
|
||||
<insert id="insert" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO tb_goods_flow_status (
|
||||
<include refid="goodsFlowStatusColumn"/>,
|
||||
create_id, create_time, update_id, update_time, del_sign
|
||||
) VALUES (
|
||||
#{goodsId}, #{flowId}, #{islandId}, #{flowSort}, #{status},
|
||||
#{createId}, NOW(), #{updateId}, NOW(), 0
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="update">
|
||||
UPDATE tb_goods_flow_status
|
||||
<set>
|
||||
<if test="goodsId != null">goods_id = #{goodsId},</if>
|
||||
<if test="flowId != null">flow_id = #{flowId},</if>
|
||||
<if test="islandId != null">island_id = #{islandId},</if>
|
||||
<if test="flowSort != null">flow_sort = #{flowSort},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="updateId != null">update_id = #{updateId},</if>
|
||||
update_time = NOW()
|
||||
</set>
|
||||
WHERE id = #{id} AND del_sign = 0
|
||||
</update>
|
||||
|
||||
<update id="deleteById">
|
||||
UPDATE tb_goods_flow_status
|
||||
SET del_sign = 1, update_time = NOW()
|
||||
WHERE id = #{id} AND del_sign = 0
|
||||
</update>
|
||||
|
||||
<select id="selectById" resultType="com.rczn.rcznautoplc.domain.GoodsFlowStatus">
|
||||
SELECT
|
||||
<include refid="baseColumn"/>,
|
||||
<include refid="goodsFlowStatusColumn"/>
|
||||
FROM tb_goods_flow_status
|
||||
WHERE id = #{id} AND del_sign = 0
|
||||
</select>
|
||||
|
||||
<select id="selectPage" resultType="com.rczn.rcznautoplc.domain.GoodsFlowStatus">
|
||||
SELECT
|
||||
<include refid="baseColumn"/>,
|
||||
<include refid="goodsFlowStatusColumn"/>
|
||||
FROM tb_goods_flow_status
|
||||
WHERE del_sign = 0
|
||||
<if test="goodsId != null">AND goods_id = #{goodsId}</if>
|
||||
<if test="flowId != null">AND flow_id = #{flowId}</if>
|
||||
<if test="islandId != null">AND island_id = #{islandId}</if>
|
||||
<if test="status != null">AND status = #{status}</if>
|
||||
ORDER BY flow_sort ASC
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,63 @@
|
||||
<?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.rczn.rcznautoplc.mapper.GoodsInfoMapper">
|
||||
<sql id="baseColumn">
|
||||
id, create_id, create_time, update_id, update_time, del_sign, remark
|
||||
</sql>
|
||||
|
||||
<sql id="goodsInfoColumn">
|
||||
goods_name, goods_type, income_time, good_from, good_batch, `desc`
|
||||
</sql>
|
||||
|
||||
<insert id="insert" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO tb_goods_info (
|
||||
<include refid="goodsInfoColumn"/>,
|
||||
create_id, create_time, update_id, update_time, del_sign
|
||||
) VALUES (
|
||||
#{goodsName}, #{goodsType}, #{incomeTime}, #{goodFrom}, #{goodBatch}, #{desc},
|
||||
#{createId}, NOW(), #{updateId}, NOW(), 0
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="update">
|
||||
UPDATE tb_goods_info
|
||||
<set>
|
||||
<if test="goodsName != null and goodsName != ''">goods_name = #{goodsName},</if>
|
||||
<if test="goodsType != null and goodsType != ''">goods_type = #{goodsType},</if>
|
||||
<if test="incomeTime != null">income_time = #{incomeTime},</if>
|
||||
<if test="goodFrom != null and goodFrom != ''">good_from = #{goodFrom},</if>
|
||||
<if test="goodBatch != null">good_batch = #{goodBatch},</if>
|
||||
<if test="desc != null and desc != ''">`desc` = #{desc},</if>
|
||||
<if test="updateId != null">update_id = #{updateId},</if>
|
||||
update_time = NOW()
|
||||
</set>
|
||||
WHERE id = #{id} AND del_sign = 0
|
||||
</update>
|
||||
|
||||
<update id="deleteById">
|
||||
UPDATE tb_goods_info
|
||||
SET del_sign = 1, update_time = NOW()
|
||||
WHERE id = #{id} AND del_sign = 0
|
||||
</update>
|
||||
|
||||
<select id="selectById" resultType="com.rczn.rcznautoplc.domain.GoodsInfo">
|
||||
SELECT
|
||||
<include refid="baseColumn"/>,
|
||||
<include refid="goodsInfoColumn"/>
|
||||
FROM tb_goods_info
|
||||
WHERE id = #{id} AND del_sign = 0
|
||||
</select>
|
||||
|
||||
<select id="selectPage" resultType="com.rczn.rcznautoplc.domain.GoodsInfo">
|
||||
SELECT
|
||||
<include refid="baseColumn"/>,
|
||||
<include refid="goodsInfoColumn"/>
|
||||
FROM tb_goods_info
|
||||
WHERE del_sign = 0
|
||||
<if test="goodsName != null and goodsName != ''">AND goods_name LIKE CONCAT('%', #{goodsName}, '%')</if>
|
||||
<if test="goodsType != null and goodsType != ''">AND goods_type LIKE CONCAT('%', #{goodsType}, '%')</if>
|
||||
<if test="goodFrom != null and goodFrom != ''">AND good_from LIKE CONCAT('%', #{goodFrom}, '%')</if>
|
||||
<if test="goodBatch != null">AND good_batch = #{goodBatch}</if>
|
||||
ORDER BY income_time DESC
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,59 @@
|
||||
<?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.rczn.rcznautoplc.mapper.IslandInfoMapper">
|
||||
<sql id="baseColumn">
|
||||
id, create_id, create_time, update_id, update_time, del_sign, remark
|
||||
</sql>
|
||||
|
||||
<sql id="islandInfoColumn">
|
||||
island_name, island_code, island_logo, `desc`
|
||||
</sql>
|
||||
|
||||
<insert id="insert" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO tb_island_info (
|
||||
<include refid="islandInfoColumn"/>,
|
||||
create_id, create_time, update_id, update_time, del_sign
|
||||
) VALUES (
|
||||
#{islandName}, #{islandCode}, #{islandLogo}, #{desc},
|
||||
#{createId}, NOW(), #{updateId}, NOW(), 0
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="update">
|
||||
UPDATE tb_island_info
|
||||
<set>
|
||||
<if test="islandName != null and islandName != ''">island_name = #{islandName},</if>
|
||||
<if test="islandCode != null and islandCode != ''">island_code = #{islandCode},</if>
|
||||
<if test="islandLogo != null and islandLogo != ''">island_logo = #{islandLogo},</if>
|
||||
<if test="desc != null and desc != ''">`desc` = #{desc},</if>
|
||||
<if test="updateId != null">update_id = #{updateId},</if>
|
||||
update_time = NOW()
|
||||
</set>
|
||||
WHERE id = #{id} AND del_sign = 0
|
||||
</update>
|
||||
|
||||
<update id="deleteById">
|
||||
UPDATE tb_island_info
|
||||
SET del_sign = 1, update_time = NOW()
|
||||
WHERE id = #{id} AND del_sign = 0
|
||||
</update>
|
||||
|
||||
<select id="selectById" resultType="com.rczn.rcznautoplc.domain.IslandInfo">
|
||||
SELECT
|
||||
<include refid="baseColumn"/>,
|
||||
<include refid="islandInfoColumn"/>
|
||||
FROM tb_island_info
|
||||
WHERE id = #{id} AND del_sign = 0
|
||||
</select>
|
||||
|
||||
<select id="selectPage" resultType="com.rczn.rcznautoplc.domain.IslandInfo">
|
||||
SELECT
|
||||
<include refid="baseColumn"/>,
|
||||
<include refid="islandInfoColumn"/>
|
||||
FROM tb_island_info
|
||||
WHERE del_sign = 0
|
||||
<if test="islandName != null and islandName != ''">AND island_name LIKE CONCAT('%', #{islandName}, '%')</if>
|
||||
<if test="islandCode != null and islandCode != ''">AND island_code LIKE CONCAT('%', #{islandCode}, '%')</if>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,131 @@
|
||||
<?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.rczn.rcznautoplc.mapper.IslandParamMapper">
|
||||
|
||||
<!-- 1. 公共字段定义(BaseBean + 业务字段) -->
|
||||
<sql id="baseColumn">
|
||||
id, create_id, create_time, update_id, update_time, del_sign, remark
|
||||
</sql>
|
||||
|
||||
<sql id="islandParamColumn">
|
||||
island_id, step_id, param_name, param_type, param_unit, param_value, form_type
|
||||
</sql>
|
||||
|
||||
<!-- 2. 关联查询结果集(映射 IslandParam + IslandInfo + StepInfo) -->
|
||||
<resultMap id="IslandParamResultMap" type="com.rczn.rcznautoplc.domain.IslandParam">
|
||||
<!-- 基础字段映射 -->
|
||||
<id column="id" property="id"/>
|
||||
<result column="create_id" property="createId"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_id" property="updateId"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="del_sign" property="delSign"/>
|
||||
<result column="remark" property="remark"/>
|
||||
|
||||
<!-- 业务字段映射 -->
|
||||
<result column="island_id" property="islandId"/>
|
||||
<result column="step_id" property="stepId"/>
|
||||
<result column="param_name" property="paramName"/>
|
||||
<result column="param_type" property="paramType"/>
|
||||
<result column="param_unit" property="paramUnit"/>
|
||||
<result column="param_value" property="paramValue"/>
|
||||
<result column="form_type" property="formType"/>
|
||||
|
||||
<!-- 关联岛屿信息(一对一):通过 island_id 关联 island_info 表 -->
|
||||
<association property="islandInfo" javaType="com.rczn.rcznautoplc.domain.IslandInfo">
|
||||
<id column="island_id" property="id"/> <!-- island_info 的主键是 id,与 tb_island_param 的 island_id 关联 -->
|
||||
<result column="island_name" property="islandName"/>
|
||||
<result column="island_code" property="islandCode"/>
|
||||
<result column="island_logo" property="islandLogo"/>
|
||||
<result column="island_desc" property="desc"/> <!-- 注意:island_info 的 desc 字段别名,避免与主表冲突 -->
|
||||
</association>
|
||||
|
||||
<!-- 关联步骤信息(一对一):通过 step_id 关联 step_info 表 -->
|
||||
<association property="stepInfo" javaType="com.rczn.rcznautoplc.domain.StepInfo">
|
||||
<id column="step_id" property="id"/> <!-- step_info 的主键是 id,与 tb_island_param 的 step_id 关联 -->
|
||||
<result column="step_name" property="stepName"/>
|
||||
<result column="step_desc" property="stepDesc"/>
|
||||
</association>
|
||||
</resultMap>
|
||||
|
||||
<!-- 3. 新增 -->
|
||||
<insert id="insert" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO tb_island_param (
|
||||
<include refid="islandParamColumn"/>,
|
||||
create_id, create_time, update_id, update_time, del_sign
|
||||
) VALUES (
|
||||
#{islandId}, #{stepId}, #{paramName}, #{paramType}, #{paramUnit}, #{paramValue}, #{formType},
|
||||
#{createId}, NOW(), #{updateId}, NOW(), 0
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!-- 4. 更新(非空字段才更新) -->
|
||||
<update id="update">
|
||||
UPDATE tb_island_param
|
||||
<set>
|
||||
<if test="islandId != null">island_id = #{islandId},</if>
|
||||
<if test="stepId != null">step_id = #{stepId},</if>
|
||||
<if test="paramName != null and paramName != ''">param_name = #{paramName},</if>
|
||||
<if test="paramType != null and paramType != ''">param_type = #{paramType},</if>
|
||||
<if test="paramUnit != null and paramUnit != ''">param_unit = #{paramUnit},</if>
|
||||
<if test="paramValue != null and paramValue != ''">param_value = #{paramValue},</if>
|
||||
<if test="formType != null and formType != ''">form_type = #{formType},</if>
|
||||
<if test="updateId != null">update_id = #{updateId},</if>
|
||||
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
||||
update_time = NOW()
|
||||
</set>
|
||||
WHERE id = #{id} AND del_sign = 0
|
||||
</update>
|
||||
|
||||
<!-- 5. 逻辑删除 -->
|
||||
<update id="deleteById">
|
||||
UPDATE tb_island_param
|
||||
SET del_sign = 1, update_time = NOW()
|
||||
WHERE id = #{id} AND del_sign = 0
|
||||
</update>
|
||||
|
||||
<!-- 6. 根据ID查询(关联岛屿和步骤信息) -->
|
||||
<select id="selectById" resultMap="IslandParamResultMap">
|
||||
SELECT
|
||||
ip.*,
|
||||
ii.island_name, ii.island_code, ii.island_logo, ii.`desc` AS island_desc, -- 别名避免冲突
|
||||
si.step_name, si.step_desc
|
||||
FROM tb_island_param ip
|
||||
LEFT JOIN island_info ii ON ip.island_id = ii.id AND ii.del_sign = 0 -- 关联岛屿表,过滤已删除数据
|
||||
LEFT JOIN step_info si ON ip.step_id = si.id AND si.del_sign = 0 -- 关联步骤表,过滤已删除数据
|
||||
WHERE ip.id = #{id} AND ip.del_sign = 0
|
||||
</select>
|
||||
|
||||
<!-- 7. 分页查询(不关联关联对象,性能更优) -->
|
||||
<select id="selectPage" resultType="com.rczn.rcznautoplc.domain.IslandParam">
|
||||
SELECT
|
||||
<include refid="baseColumn"/>,
|
||||
<include refid="islandParamColumn"/>
|
||||
FROM tb_island_param
|
||||
WHERE del_sign = 0
|
||||
<if test="islandId != null">AND island_id = #{islandId}</if>
|
||||
<if test="stepId != null">AND step_id = #{stepId}</if>
|
||||
<if test="paramName != null and paramName != ''">AND param_name LIKE CONCAT('%', #{paramName}, '%')</if>
|
||||
<if test="paramType != null and paramType != ''">AND param_type = #{paramType}</if>
|
||||
<if test="formType != null and formType != ''">AND form_type = #{formType}</if>
|
||||
ORDER BY ip.create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 8. 分页查询(关联岛屿和步骤信息) -->
|
||||
<select id="selectPageWithRelations" resultMap="IslandParamResultMap">
|
||||
SELECT
|
||||
ip.*,
|
||||
ii.island_name, ii.island_code, ii.island_logo, ii.`desc` AS island_desc,
|
||||
si.step_name, si.step_desc
|
||||
FROM tb_island_param ip
|
||||
LEFT JOIN island_info ii ON ip.island_id = ii.id AND ii.del_sign = 0
|
||||
LEFT JOIN step_info si ON ip.step_id = si.id AND si.del_sign = 0
|
||||
WHERE ip.del_sign = 0
|
||||
<if test="islandId != null">AND ip.island_id = #{islandId}</if>
|
||||
<if test="stepId != null">AND ip.step_id = #{stepId}</if>
|
||||
<if test="paramName != null and paramName != ''">AND ip.param_name LIKE CONCAT('%', #{paramName}, '%')</if>
|
||||
<if test="paramType != null and paramType != ''">AND ip.param_type = #{paramType}</if>
|
||||
<if test="formType != null and formType != ''">AND ip.form_type = #{formType}</if>
|
||||
ORDER BY ip.create_time DESC
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,60 @@
|
||||
<?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.rczn.rcznautoplc.mapper.RecordInfoMapper">
|
||||
<sql id="baseColumn">
|
||||
id, create_id, create_time, update_id, update_time, del_sign, remark
|
||||
</sql>
|
||||
|
||||
<sql id="recordInfoColumn">
|
||||
record_name, record_type, record_status, record_content
|
||||
</sql>
|
||||
|
||||
<insert id="insert" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO tb_record_info (
|
||||
<include refid="recordInfoColumn"/>,
|
||||
create_id, create_time, update_id, update_time, del_sign
|
||||
) VALUES (
|
||||
#{recordName}, #{recordType}, #{recordStatus}, #{recordContent},
|
||||
#{createId}, NOW(), #{updateId}, NOW(), 0
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="update">
|
||||
UPDATE tb_record_info
|
||||
<set>
|
||||
<if test="recordName != null and recordName != ''">record_name = #{recordName},</if>
|
||||
<if test="recordType != null">record_type = #{recordType},</if>
|
||||
<if test="recordStatus != null">record_status = #{recordStatus},</if>
|
||||
<if test="recordContent != null and recordContent != ''">record_content = #{recordContent},</if>
|
||||
<if test="updateId != null">update_id = #{updateId},</if>
|
||||
update_time = NOW()
|
||||
</set>
|
||||
WHERE id = #{id} AND del_sign = 0
|
||||
</update>
|
||||
|
||||
<update id="deleteById">
|
||||
UPDATE tb_record_info
|
||||
SET del_sign = 1, update_time = NOW()
|
||||
WHERE id = #{id} AND del_sign = 0
|
||||
</update>
|
||||
|
||||
<select id="selectById" resultType="com.rczn.rcznautoplc.domain.RecordInfo">
|
||||
SELECT
|
||||
<include refid="baseColumn"/>,
|
||||
<include refid="recordInfoColumn"/>
|
||||
FROM tb_record_info
|
||||
WHERE id = #{id} AND del_sign = 0
|
||||
</select>
|
||||
|
||||
<select id="selectPage" resultType="com.rczn.rcznautoplc.domain.RecordInfo">
|
||||
SELECT
|
||||
<include refid="baseColumn"/>,
|
||||
<include refid="recordInfoColumn"/>
|
||||
FROM tb_record_info
|
||||
WHERE del_sign = 0
|
||||
<if test="recordName != null and recordName != ''">AND record_name LIKE CONCAT('%', #{recordName}, '%')</if>
|
||||
<if test="recordType != null">AND record_type = #{recordType}</if>
|
||||
<if test="recordStatus != null">AND record_status = #{recordStatus}</if>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,58 @@
|
||||
<?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.rczn.rcznautoplc.mapper.StepInfoMapper">
|
||||
<sql id="baseColumn">
|
||||
id, create_id, create_time, update_id, update_time, del_sign, remark
|
||||
</sql>
|
||||
|
||||
<sql id="stepInfoColumn">
|
||||
island_id, step_name, step_desc
|
||||
</sql>
|
||||
|
||||
<insert id="insert" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO tb_step_info (
|
||||
<include refid="stepInfoColumn"/>,
|
||||
create_id, create_time, update_id, update_time, del_sign
|
||||
) VALUES (
|
||||
#{islandId}, #{stepName}, #{stepDesc},
|
||||
#{createId}, NOW(), #{updateId}, NOW(), 0
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="update">
|
||||
UPDATE tb_step_info
|
||||
<set>
|
||||
<if test="islandId != null">island_id = #{islandId},</if>
|
||||
<if test="stepName != null and stepName != ''">step_name = #{stepName},</if>
|
||||
<if test="stepDesc != null and stepDesc != ''">step_desc = #{stepDesc},</if>
|
||||
<if test="updateId != null">update_id = #{updateId},</if>
|
||||
update_time = NOW()
|
||||
</set>
|
||||
WHERE id = #{id} AND del_sign = 0
|
||||
</update>
|
||||
|
||||
<update id="deleteById">
|
||||
UPDATE tb_step_info
|
||||
SET del_sign = 1, update_time = NOW()
|
||||
WHERE id = #{id} AND del_sign = 0
|
||||
</update>
|
||||
|
||||
<select id="selectById" resultType="com.rczn.rcznautoplc.domain.StepInfo">
|
||||
SELECT
|
||||
<include refid="baseColumn"/>,
|
||||
<include refid="stepInfoColumn"/>
|
||||
FROM tb_step_info
|
||||
WHERE id = #{id} AND del_sign = 0
|
||||
</select>
|
||||
|
||||
<select id="selectPage" resultType="com.rczn.rcznautoplc.domain.StepInfo">
|
||||
SELECT
|
||||
<include refid="baseColumn"/>,
|
||||
<include refid="stepInfoColumn"/>
|
||||
FROM tb_step_info
|
||||
WHERE del_sign = 0
|
||||
<if test="islandId != null">AND island_id = #{islandId}</if>
|
||||
<if test="stepName != null and stepName != ''">AND step_name LIKE CONCAT('%', #{stepName}, '%')</if>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user