问题修改
This commit is contained in:
parent
40f857458b
commit
fc34caabfd
|
|
@ -105,7 +105,7 @@ public class ToolServiceImpl implements ToolService {
|
|||
// 7. 执行新增操作
|
||||
int insertNum = toolMapper.add(entity);
|
||||
if (insertNum > 0) {
|
||||
toolMapper.addLedger(entity.getTypeId());
|
||||
//toolMapper.addLedger(entity.getTypeId());
|
||||
log.info("新增工具类型成功:typeId={}, typeName={}", entity.getTypeId(), entity.getTypeName());
|
||||
return AjaxResult.success("新增成功", entity.getTypeId()); // 返回新增ID,便于前端使用
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1,100 +1,116 @@
|
|||
package com.bonus.material.toolLedger.domain;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ToolLedgerEntity implements Serializable {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 工具编码(编码管理使用)
|
||||
*/
|
||||
private String toolCode;
|
||||
|
||||
/**
|
||||
* 录入批次号(数量管理使用)
|
||||
*/
|
||||
private String batchCode;
|
||||
|
||||
/**
|
||||
* 工具类型ID
|
||||
*/
|
||||
private Long typeId;
|
||||
|
||||
/**
|
||||
* 4级父节点id
|
||||
* 管理方式:1-编码管理;2-数量管理
|
||||
*/
|
||||
private String fourthParentId;
|
||||
/**
|
||||
* 4级父节点名称
|
||||
*/
|
||||
@Excel(name = "工具专业")
|
||||
private String fourthParentName;
|
||||
private Integer manageMode;
|
||||
|
||||
/**
|
||||
* 3级父节点id
|
||||
* 总数量(默认1.00)
|
||||
*/
|
||||
private String greatGrandparentId;
|
||||
/**
|
||||
* 3级父节点名称
|
||||
*/
|
||||
@Excel(name = "施工类型")
|
||||
private String greatGrandparentName;
|
||||
/**
|
||||
* 2级父节点id
|
||||
*/
|
||||
private String grandparentTypeId;
|
||||
/**
|
||||
* 2级父节点名称
|
||||
*/
|
||||
@Excel(name = "工具类型")
|
||||
private String grandparentTypeName;
|
||||
/**
|
||||
* 1级父节点id
|
||||
*/
|
||||
private String parentTypeId;
|
||||
/**
|
||||
* 1级父节点名称
|
||||
*/
|
||||
@Excel(name = "工具名称")
|
||||
private String parentTypeName;
|
||||
/**
|
||||
* 类型名称(非空)
|
||||
*/
|
||||
@Excel(name = "规格型号")
|
||||
private String typeName;
|
||||
private BigDecimal totalNum;
|
||||
|
||||
/**
|
||||
* 计量单位名称
|
||||
* 在库数量(默认0.00)
|
||||
*/
|
||||
private String unitName;
|
||||
private BigDecimal availableNum;
|
||||
|
||||
/**
|
||||
* 管理方式(0编号 1计数)
|
||||
* 在用数量(默认0.00)
|
||||
*/
|
||||
private String manageType;
|
||||
private BigDecimal inNum;
|
||||
|
||||
/**
|
||||
* 在库数量(库存中可用的数量)
|
||||
* 维修数量(默认0.00)
|
||||
*/
|
||||
@Excel(name = "在库数量")
|
||||
private float stockQuantity;
|
||||
private BigDecimal repairNum;
|
||||
|
||||
/**
|
||||
* 自用数量(本单位内部使用的数量)
|
||||
* 报废数量(默认0.00)
|
||||
*/
|
||||
@Excel(name = "自用数量")
|
||||
private float selfUseQuantity;
|
||||
private BigDecimal scrapNum;
|
||||
|
||||
/**
|
||||
* 共享数量(对外共享/借出的数量)
|
||||
* 厂家id(默认0)
|
||||
*/
|
||||
@Excel(name = "共享数量")
|
||||
private float shareQuantity;
|
||||
private Integer supplierId = 0;
|
||||
|
||||
/**
|
||||
* 在修数量(正在维修的数量)
|
||||
* 采购日期
|
||||
*/
|
||||
@Excel(name = "在修数量")
|
||||
private float repairingQuantity;
|
||||
private LocalDate purchaseDate;
|
||||
|
||||
/**
|
||||
* 设备总数
|
||||
* 出厂日期
|
||||
*/
|
||||
private float count;
|
||||
private LocalDate productionDate;
|
||||
|
||||
/**
|
||||
* 最近检验日期
|
||||
*/
|
||||
private LocalDate lastCheckDate;
|
||||
|
||||
/**
|
||||
* 当前状态:0在库 1在用 2在修 3已报废(默认0)
|
||||
*/
|
||||
private String status = "0";
|
||||
|
||||
/**
|
||||
* 1上架 0下架(默认0)
|
||||
*/
|
||||
private String upDownStatus = "0";
|
||||
|
||||
/**
|
||||
* 所属公司ID
|
||||
*/
|
||||
private Long companyId;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建时间(默认当前时间)
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间(默认当前时间,更新时自动刷新)
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import com.bonus.common.core.web.controller.BaseController;
|
|||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.material.tool.domain.ToolEntity;
|
||||
import com.bonus.material.toolLedger.domain.ToolLedgerEntity;
|
||||
import com.bonus.material.toolProcess.domain.ToolApplyDetailsEntity;
|
||||
import com.bonus.material.toolProcess.domain.ToolApplyEntity;
|
||||
import com.bonus.material.toolProcess.service.ToolApplyService;
|
||||
import io.swagger.annotations.Api;
|
||||
|
|
@ -33,7 +33,47 @@ public class ToolApplyController extends BaseController {
|
|||
public TableDataInfo list(ToolApplyEntity entity) {
|
||||
try {
|
||||
startPage();
|
||||
List<ToolLedgerEntity> list = toolApplyService.list(entity);
|
||||
List<ToolApplyEntity> list = toolApplyService.list(entity);
|
||||
return getDataTable(list);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
}
|
||||
return getDataTableError(new ArrayList<>());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 工具申请单表格
|
||||
*
|
||||
* @param entity 实体
|
||||
* @return 表格
|
||||
*/
|
||||
@ApiOperation(value = "工具录入表格")
|
||||
@GetMapping("/listReview")
|
||||
public TableDataInfo listReview(ToolApplyEntity entity) {
|
||||
try {
|
||||
startPage();
|
||||
List<ToolApplyEntity> list = toolApplyService.listReview(entity);
|
||||
return getDataTable(list);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
}
|
||||
return getDataTableError(new ArrayList<>());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 工具申请单表格
|
||||
*
|
||||
* @param entity 实体
|
||||
* @return 表格
|
||||
*/
|
||||
@ApiOperation(value = "工具录入表格")
|
||||
@GetMapping("/listEncoding")
|
||||
public TableDataInfo listEncoding(ToolApplyDetailsEntity entity) {
|
||||
try {
|
||||
startPage();
|
||||
List<ToolApplyDetailsEntity> list = toolApplyService.listEncoding(entity);
|
||||
return getDataTable(list);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
|
|
@ -55,7 +95,65 @@ public class ToolApplyController extends BaseController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 工具录入修改
|
||||
* 工具录入删除
|
||||
*
|
||||
* @param entity 实体
|
||||
* @return 结果
|
||||
*/
|
||||
@ApiOperation(value = "工具录入删除")
|
||||
@PostMapping("/delete")
|
||||
public AjaxResult delete(@RequestBody ToolApplyEntity entity) {
|
||||
return toolApplyService.delete(entity);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 工具录入删除
|
||||
*
|
||||
* @param entity 实体
|
||||
* @return 结果
|
||||
*/
|
||||
@ApiOperation(value = "工具录入删除")
|
||||
@PostMapping("/deleteDetail")
|
||||
public AjaxResult delete(@RequestBody ToolApplyDetailsEntity entity) {
|
||||
return toolApplyService.deleteDetail(entity);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 工具录入申请单表格
|
||||
*
|
||||
* @param entity 实体
|
||||
* @return 表格
|
||||
*/
|
||||
@ApiOperation(value = "工具录入申请单表格")
|
||||
@GetMapping("/listByApplyId")
|
||||
public TableDataInfo listByApplyId(ToolApplyDetailsEntity entity) {
|
||||
try {
|
||||
startPage();
|
||||
List<ToolApplyDetailsEntity> list = toolApplyService.listByApplyId(entity);
|
||||
return getDataTable(list);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
}
|
||||
return getDataTableError(new ArrayList<>());
|
||||
}
|
||||
|
||||
/**
|
||||
* 工具录入新增
|
||||
*
|
||||
* @param entity 实体
|
||||
* @return 结果
|
||||
*/
|
||||
@ApiOperation(value = "工具录入新增")
|
||||
@PostMapping("/addDetail")
|
||||
public AjaxResult addDetail(@RequestBody List<ToolApplyDetailsEntity> entity) {
|
||||
return toolApplyService.addDetail(entity);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 工具录入新增
|
||||
*
|
||||
* @param entity 实体
|
||||
* @return 结果
|
||||
|
|
@ -68,15 +166,42 @@ public class ToolApplyController extends BaseController {
|
|||
|
||||
|
||||
/**
|
||||
* 工具录入删除
|
||||
* 工具录入新增
|
||||
*
|
||||
* @param entity 实体
|
||||
* @return 结果
|
||||
*/
|
||||
@ApiOperation(value = "工具录入删除")
|
||||
@PostMapping("/delete")
|
||||
public AjaxResult delete(@RequestBody ToolApplyEntity entity) {
|
||||
return toolApplyService.delete(entity);
|
||||
@ApiOperation(value = "工具录入修改")
|
||||
@PostMapping("/updateDetail")
|
||||
public AjaxResult updateDetail(@RequestBody ToolApplyDetailsEntity entity) {
|
||||
return toolApplyService.updateDetail(entity);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 工具录入新增
|
||||
*
|
||||
* @param entity 实体
|
||||
* @return 结果
|
||||
*/
|
||||
@ApiOperation(value = "工具录入修改")
|
||||
@PostMapping("/updateAllDetail")
|
||||
public AjaxResult updateAllDetail(@RequestBody ToolApplyDetailsEntity entity) {
|
||||
return toolApplyService.updateAllDetail(entity);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 工具类型树
|
||||
*
|
||||
* @param entity 实体
|
||||
* @return 树结构
|
||||
*/
|
||||
@ApiOperation(value = "工具类型树")
|
||||
@GetMapping("/getTreeSelect")
|
||||
public AjaxResult getTreeSelect(ToolEntity entity) {
|
||||
return toolApplyService.getTreeSelect(entity);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,75 @@
|
|||
package com.bonus.material.toolProcess.domain;
|
||||
|
||||
import com.bonus.material.tool.domain.ToolEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ToolApplyDetailsEntity extends ToolEntity {
|
||||
|
||||
/**
|
||||
* 主键(对应字段:id)
|
||||
* 数据库类型:int unsigned NOT NULL AUTO_INCREMENT
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 所属申请单号(对应字段:apply_id)
|
||||
* 关联 tool_apply 表的 id 字段
|
||||
* 数据库类型:bigint DEFAULT NULL
|
||||
*/
|
||||
private Long applyId;
|
||||
/**
|
||||
* 装备编码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 原始编码
|
||||
*/
|
||||
private String identifyCode;
|
||||
|
||||
/**
|
||||
* 生产厂家(对应字段:supplier_id)
|
||||
* 注:字段名注释为“生产厂家”,数据库字段类型为 int,推测是厂家ID(非厂家名称)
|
||||
* 数据库类型:int DEFAULT NULL
|
||||
*/
|
||||
private Integer supplierId;
|
||||
|
||||
/**
|
||||
* 申请数量(对应字段:apply_num)
|
||||
* 数据库类型:decimal(10,2) DEFAULT NULL
|
||||
* 用 BigDecimal 存储高精度小数,避免浮点运算误差
|
||||
*/
|
||||
private BigDecimal applyNum;
|
||||
|
||||
/**
|
||||
* 资产原值(对应字段:tool_price)
|
||||
* 数据库类型:decimal(10,2) DEFAULT NULL
|
||||
*/
|
||||
private BigDecimal toolPrice;
|
||||
/**
|
||||
* 出厂日期(对应字段:production_date)
|
||||
* 数据库类型:datetime DEFAULT NULL
|
||||
* 用 Java 8 新时间类型 LocalDateTime(推荐,替代 Date)
|
||||
* 若项目未兼容 Java 8,可改为 java.util.Date,需配合时间序列化配置
|
||||
*/
|
||||
private LocalDate productionDate;
|
||||
|
||||
/**
|
||||
* 状态(对应字段:status)
|
||||
* 枚举说明:1-待审核,2-通过,3-驳回
|
||||
* 数据库类型:char(1) DEFAULT '1'
|
||||
* 用 String 存储 char 类型,避免类型转换问题
|
||||
*/
|
||||
private String status;
|
||||
|
||||
private String supplierName;
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.material.toolProcess.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
|
@ -23,14 +24,28 @@ public class ToolApplyEntity {
|
|||
private String code;
|
||||
|
||||
/**
|
||||
* 申请人(用户ID)
|
||||
* 申请人
|
||||
*/
|
||||
private Long createBy;
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 申请时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
/**
|
||||
* 总数
|
||||
*/
|
||||
private Integer total;
|
||||
|
||||
/**
|
||||
* 已通过数量
|
||||
*/
|
||||
private Integer passed;
|
||||
/**
|
||||
* 已驳回数量
|
||||
*/
|
||||
private Integer quantity;
|
||||
|
||||
/**
|
||||
* 状态(0草稿 1审批中 2通过 3驳回)
|
||||
|
|
@ -45,6 +60,17 @@ public class ToolApplyEntity {
|
|||
/**
|
||||
* 审批时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime reviewTime;
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private String startTime;
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private String endTime;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
package com.bonus.material.toolProcess.mapper;
|
||||
|
||||
import com.bonus.material.tool.domain.ToolEntity;
|
||||
import com.bonus.material.toolProcess.domain.ToolApplyDetailsEntity;
|
||||
import com.bonus.material.toolProcess.domain.ToolApplyEntity;
|
||||
import io.swagger.models.auth.In;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -21,7 +24,88 @@ public interface ToolApplyMapper {
|
|||
*/
|
||||
Integer delete(ToolApplyEntity entity);
|
||||
|
||||
/**
|
||||
* 工具录入订单删除
|
||||
*
|
||||
* @param entity 实体
|
||||
* @return 结果
|
||||
*/
|
||||
Integer deleteDetail(ToolApplyDetailsEntity entity);
|
||||
|
||||
/**
|
||||
* 新增订单
|
||||
*
|
||||
* @param entity 实体
|
||||
* @return 结果
|
||||
*/
|
||||
Integer add(ToolApplyEntity entity);
|
||||
|
||||
/**
|
||||
* 新增设备详情
|
||||
*
|
||||
* @param entity 实体
|
||||
* @return 结果
|
||||
*/
|
||||
|
||||
Integer addDetail(List<ToolApplyDetailsEntity> entity);
|
||||
|
||||
/**
|
||||
* 工具录入申请单表格
|
||||
*
|
||||
* @param entity 实体
|
||||
* @return 表格
|
||||
*/
|
||||
List<ToolApplyDetailsEntity> listByApplyId(ToolApplyDetailsEntity entity);
|
||||
|
||||
/**
|
||||
* 获取下拉选
|
||||
*
|
||||
* @param entity 实体
|
||||
* @return 集合
|
||||
*/
|
||||
|
||||
List<ToolEntity> getTreeSelect(ToolEntity entity);
|
||||
|
||||
/**
|
||||
* 修改订单状态
|
||||
*
|
||||
* @param entity 条件
|
||||
* @return 条数
|
||||
*/
|
||||
|
||||
Integer update(ToolApplyEntity entity);
|
||||
|
||||
/**
|
||||
* 修改订单装备状态
|
||||
*
|
||||
* @param entity 条件
|
||||
* @return 条数
|
||||
*/
|
||||
Integer updateDetail(ToolApplyDetailsEntity entity);
|
||||
|
||||
/**
|
||||
* 修改订单装备状态
|
||||
*
|
||||
* @param entity 条件
|
||||
* @return 条数
|
||||
*/
|
||||
Integer updateAllDetail(ToolApplyDetailsEntity entity);
|
||||
|
||||
/**
|
||||
* 获取审核列表
|
||||
*
|
||||
* @param entity 实体
|
||||
* @return 集合
|
||||
*/
|
||||
List<ToolApplyEntity> listReview(ToolApplyEntity entity);
|
||||
|
||||
/**
|
||||
* 获取未审批的数量
|
||||
*
|
||||
* @param applyId
|
||||
* @return
|
||||
*/
|
||||
Integer getCount(Long applyId);
|
||||
|
||||
List<ToolApplyDetailsEntity> listEncoding(ToolApplyDetailsEntity entity);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package com.bonus.material.toolProcess.service.Impl;
|
||||
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.material.toolLedger.domain.ToolLedgerEntity;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.material.tool.domain.ToolEntity;
|
||||
import com.bonus.material.toolProcess.domain.ToolApplyDetailsEntity;
|
||||
import com.bonus.material.toolProcess.domain.ToolApplyEntity;
|
||||
import com.bonus.material.toolProcess.mapper.ToolApplyMapper;
|
||||
import com.bonus.material.toolProcess.service.ToolApplyService;
|
||||
|
|
@ -12,6 +14,7 @@ import org.springframework.stereotype.Service;
|
|||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class ToolApplyServiceImpl implements ToolApplyService {
|
||||
|
|
@ -26,7 +29,7 @@ public class ToolApplyServiceImpl implements ToolApplyService {
|
|||
* @return 表格
|
||||
*/
|
||||
@Override
|
||||
public List<ToolLedgerEntity> list(ToolApplyEntity entity) {
|
||||
public List<ToolApplyEntity> list(ToolApplyEntity entity) {
|
||||
return toolApplyMapper.list(entity);
|
||||
}
|
||||
|
||||
|
|
@ -39,30 +42,15 @@ public class ToolApplyServiceImpl implements ToolApplyService {
|
|||
@Override
|
||||
public AjaxResult add(ToolApplyEntity entity) {
|
||||
try {
|
||||
entity.setCreateBy(SecurityUtils.getLoginUser().getSysUser().getNickName());
|
||||
Integer num = toolApplyMapper.add(entity);
|
||||
return num > 0 ? AjaxResult.success("新增成功") : AjaxResult.error("新增失败");
|
||||
return num > 0 ? AjaxResult.success(entity) : AjaxResult.error("新增失败");
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
return AjaxResult.error("新增失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 工具录入修改
|
||||
*
|
||||
* @param entity 实体
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult update(ToolApplyEntity entity) {
|
||||
try {
|
||||
Integer num = toolApplyMapper.update(entity);
|
||||
return num > 0 ? AjaxResult.success("修改成功") : AjaxResult.error("修改失败");
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
return AjaxResult.error("修改失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 工具录入删除
|
||||
|
|
@ -75,9 +63,175 @@ public class ToolApplyServiceImpl implements ToolApplyService {
|
|||
try {
|
||||
Integer num = toolApplyMapper.delete(entity);
|
||||
return num > 0 ? AjaxResult.success("删除成功") : AjaxResult.error("删除失败");
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
return AjaxResult.error("删除失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 工具录入申请单表格
|
||||
*
|
||||
* @param entity 实体
|
||||
* @return 表格
|
||||
*/
|
||||
@Override
|
||||
public List<ToolApplyDetailsEntity> listByApplyId(ToolApplyDetailsEntity entity) {
|
||||
return toolApplyMapper.listByApplyId(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 工具录入订单删除
|
||||
*
|
||||
* @param entity 实体
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult deleteDetail(ToolApplyDetailsEntity entity) {
|
||||
try {
|
||||
Integer num = toolApplyMapper.deleteDetail(entity);
|
||||
return num > 0 ? AjaxResult.success("删除成功") : AjaxResult.error("删除失败");
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
return AjaxResult.error("删除失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备详情
|
||||
*
|
||||
* @param entity 实体
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult addDetail(List<ToolApplyDetailsEntity> entity) {
|
||||
try {
|
||||
Integer num = toolApplyMapper.addDetail(entity);
|
||||
return num > 0 ? AjaxResult.success(entity) : AjaxResult.error("新增失败");
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
return AjaxResult.error("新增失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 工具类型树
|
||||
*
|
||||
* @param entity 实体
|
||||
* @return 树结构
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult getTreeSelect(ToolEntity entity) {
|
||||
// 1. 按条件查询目标节点(符合筛选条件的节点)
|
||||
List<ToolEntity> allNodes = toolApplyMapper.getTreeSelect(entity);
|
||||
// 2. 找出所有根节点(parent_id = null 或 parent_id = 0,根据业务调整)
|
||||
List<ToolEntity> rootNodes = allNodes.stream().filter(node -> node.getParentId() == null || node.getParentId() == 0).collect(Collectors.toList());
|
||||
// 3. 为每个根节点递归添加子节点
|
||||
for (ToolEntity root : rootNodes) {
|
||||
addChildren(root, allNodes);
|
||||
}
|
||||
return AjaxResult.success(rootNodes);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单状态
|
||||
*
|
||||
* @param entity 条件
|
||||
* @return 条数
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult update(ToolApplyEntity entity) {
|
||||
try {
|
||||
Integer num = toolApplyMapper.update(entity);
|
||||
return num > 0 ? AjaxResult.success("修改成功") : AjaxResult.error("修改失败");
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
return AjaxResult.error("修改失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单装备状态
|
||||
*
|
||||
* @param entity 条件
|
||||
* @return 条数
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult updateDetail(ToolApplyDetailsEntity entity) {
|
||||
try {
|
||||
|
||||
Integer num = toolApplyMapper.updateDetail(entity);
|
||||
Integer i = toolApplyMapper.getCount(entity.getApplyId());
|
||||
if (i == 0) {
|
||||
ToolApplyEntity applyEntity = new ToolApplyEntity();
|
||||
applyEntity.setId(entity.getApplyId());
|
||||
applyEntity.setStatus("2");
|
||||
toolApplyMapper.update(applyEntity);
|
||||
}
|
||||
return num > 0 ? AjaxResult.success("修改成功") : AjaxResult.error("修改失败");
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
return AjaxResult.error("修改失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单装备状态
|
||||
*
|
||||
* @param entity 条件
|
||||
* @return 条数
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult updateAllDetail(ToolApplyDetailsEntity entity) {
|
||||
try {
|
||||
ToolApplyEntity applyEntity = new ToolApplyEntity();
|
||||
applyEntity.setId(entity.getApplyId());
|
||||
applyEntity.setStatus("2");
|
||||
toolApplyMapper.update(applyEntity);
|
||||
Integer num = toolApplyMapper.updateAllDetail(entity);
|
||||
return num > 0 ? AjaxResult.success("修改成功") : AjaxResult.error("修改失败");
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
return AjaxResult.error("修改失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取审核列表
|
||||
*
|
||||
* @param entity 实体
|
||||
* @return 表格
|
||||
*/
|
||||
@Override
|
||||
public List<ToolApplyEntity> listReview(ToolApplyEntity entity) {
|
||||
return toolApplyMapper.listReview(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<ToolApplyDetailsEntity> listEncoding(ToolApplyDetailsEntity entity) {
|
||||
return toolApplyMapper.listEncoding(entity);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 递归为父节点添加子节点
|
||||
*
|
||||
* @param parent 父节点
|
||||
* @param allNodes 所有节点列表
|
||||
*/
|
||||
private void addChildren(ToolEntity parent, List<ToolEntity> allNodes) {
|
||||
// 筛选当前父节点的子节点(parent_id = 父节点的 type_id)
|
||||
List<ToolEntity> children = allNodes.stream().filter(node -> parent.getTypeId().equals(node.getParentId())).collect(Collectors.toList());
|
||||
// 为父节点设置子节点
|
||||
parent.setChildren(children);
|
||||
|
||||
// 递归为子节点添加它们的子节点
|
||||
for (ToolEntity child : children) {
|
||||
addChildren(child, allNodes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package com.bonus.material.toolProcess.service;
|
||||
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.material.tool.domain.ToolEntity;
|
||||
import com.bonus.material.toolLedger.domain.ToolLedgerEntity;
|
||||
import com.bonus.material.toolProcess.domain.ToolApplyDetailsEntity;
|
||||
import com.bonus.material.toolProcess.domain.ToolApplyEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -13,7 +15,7 @@ public interface ToolApplyService {
|
|||
* @param entity 实体
|
||||
* @return 表格
|
||||
*/
|
||||
List<ToolLedgerEntity> list(ToolApplyEntity entity);
|
||||
List<ToolApplyEntity> list(ToolApplyEntity entity);
|
||||
|
||||
/**
|
||||
* 工具录入新增
|
||||
|
|
@ -23,14 +25,6 @@ public interface ToolApplyService {
|
|||
*/
|
||||
AjaxResult add(ToolApplyEntity entity);
|
||||
|
||||
/**
|
||||
* 工具录入修改
|
||||
*
|
||||
* @param entity 实体
|
||||
* @return 结果
|
||||
*/
|
||||
AjaxResult update(ToolApplyEntity entity);
|
||||
|
||||
/**
|
||||
* 工具录入删除
|
||||
*
|
||||
|
|
@ -38,4 +32,76 @@ public interface ToolApplyService {
|
|||
* @return 结果
|
||||
*/
|
||||
AjaxResult delete(ToolApplyEntity entity);
|
||||
|
||||
/**
|
||||
* 工具录入申请单表格
|
||||
*
|
||||
* @param entity 实体
|
||||
* @return 表格
|
||||
*/
|
||||
List<ToolApplyDetailsEntity> listByApplyId(ToolApplyDetailsEntity entity);
|
||||
|
||||
/**
|
||||
* 工具录入订单删除
|
||||
*
|
||||
* @param entity 实体
|
||||
* @return 结果
|
||||
*/
|
||||
AjaxResult deleteDetail(ToolApplyDetailsEntity entity);
|
||||
|
||||
|
||||
/**
|
||||
* 新增设备详情
|
||||
*
|
||||
* @param entity 实体
|
||||
* @return 结果
|
||||
*/
|
||||
|
||||
AjaxResult addDetail(List<ToolApplyDetailsEntity> entity);
|
||||
|
||||
|
||||
/**
|
||||
* 获取下拉选
|
||||
*
|
||||
* @param entity 实体
|
||||
* @return 集合
|
||||
*/
|
||||
AjaxResult getTreeSelect(ToolEntity entity);
|
||||
|
||||
|
||||
/**
|
||||
* 修改订单状态
|
||||
*
|
||||
* @param entity 条件
|
||||
* @return 条数
|
||||
*/
|
||||
|
||||
AjaxResult update(ToolApplyEntity entity);
|
||||
|
||||
/**
|
||||
* 修改订单装备状态
|
||||
*
|
||||
* @param entity 条件
|
||||
* @return 条数
|
||||
*/
|
||||
AjaxResult updateDetail(ToolApplyDetailsEntity entity);
|
||||
|
||||
|
||||
/**
|
||||
* 修改订单装备状态
|
||||
*
|
||||
* @param entity 条件
|
||||
* @return 条数
|
||||
*/
|
||||
AjaxResult updateAllDetail(ToolApplyDetailsEntity entity);
|
||||
|
||||
/**
|
||||
* 获取审核列表
|
||||
*
|
||||
* @param entity 实体
|
||||
* @return 表格
|
||||
*/
|
||||
List<ToolApplyEntity> listReview(ToolApplyEntity entity);
|
||||
|
||||
List<ToolApplyDetailsEntity> listEncoding(ToolApplyDetailsEntity entity);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,6 +98,7 @@
|
|||
AND type_name LIKE CONCAT('%', #{typeName}, '%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="list" resultType="com.bonus.material.tool.domain.ToolEntity">
|
||||
SELECT
|
||||
tt.type_id AS typeId,
|
||||
|
|
|
|||
|
|
@ -12,12 +12,11 @@
|
|||
tt2.type_name AS grandparentTypeName, -- 2级父节点名称
|
||||
tt3.type_name AS greatGrandparentName, -- 3级父节点名称
|
||||
tt4.type_name AS fourthParentName, -- 4级父节点名称
|
||||
tl.stock_quantity / 1000 AS stockQuantity,
|
||||
tl.self_use_quantity / 1000 AS selfUseQuantity,
|
||||
tl.share_quantity / 1000 AS shareQuantity,
|
||||
tl.repairing_quantity / 1000 AS repairingQuantity,
|
||||
(IFNULL(tl.stock_quantity, 0) + IFNULL(tl.self_use_quantity, 0) +
|
||||
IFNULL(tl.share_quantity, 0) + IFNULL(tl.repairing_quantity, 0)) / 1000 AS count
|
||||
tl.available_num / 1000 AS availableNum,
|
||||
tl.in_num / 1000 AS inNum,
|
||||
tl.scrap_num / 1000 AS scrapNum,
|
||||
tl.repair_num / 1000 AS repairNum,
|
||||
tl.total_num / 1000 AS totalNum
|
||||
FROM
|
||||
tool_type tt
|
||||
INNER JOIN tool_ledger tl ON tl.type_id = tt.type_id
|
||||
|
|
|
|||
|
|
@ -1,19 +1,251 @@
|
|||
<?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.bonus.material.toolProcess.mapper.ToolApplyMapper">
|
||||
<insert id="add" parameterType="com.bonus.material.toolProcess.domain.ToolApplyEntity" useGeneratedKeys="true"
|
||||
keyProperty="id">
|
||||
INSERT INTO tool_apply (code, create_by, create_time)
|
||||
VALUES (CONCAT(
|
||||
DATE_FORMAT(NOW(), '%Y%m%d'), -- 日期前缀:yyyyMMdd
|
||||
'-', -- 添加分隔符
|
||||
LPAD(
|
||||
-- 外层子查询规避 MySQL 表引用限制
|
||||
(SELECT inner_count + 1
|
||||
FROM (SELECT COUNT(*) AS inner_count
|
||||
FROM tool_apply
|
||||
WHERE DATE(create_time) = CURDATE()
|
||||
AND del_flag = '0') AS temp_table),
|
||||
4, '0' -- 序号补0到3位(可调整为4位:LPAD(...,4,'0'))
|
||||
)
|
||||
), #{createBy}, now())
|
||||
</insert>
|
||||
<insert id="addDetail" parameterType="java.util.List">
|
||||
INSERT INTO tool_apply_details (
|
||||
<!-- 批量插入时,字段列表只需拼接一次(所有实体共用同一组非空字段) -->
|
||||
<trim suffixOverrides=","> <!-- 去除最后一个多余的逗号 -->
|
||||
<if test="list != null and list.size() > 0">
|
||||
<!-- 取 List 中第一个非空实体的字段作为基准(避免字段列表为空) -->
|
||||
<if test="list[0].applyId != null">apply_id,</if>
|
||||
<if test="list[0].typeId != null">type_id,</if>
|
||||
<if test="list[0].supplierId != null">supplier_id,</if>
|
||||
<if test="list[0].applyNum != null">apply_num,</if>
|
||||
<if test="list[0].toolPrice != null">tool_price,</if>
|
||||
<if test="list[0].productionDate != null">production_date,</if>
|
||||
<if test="list[0].code != null">code,</if>
|
||||
<if test="list[0].identifyCode != null">identify_code,</if>
|
||||
</if>
|
||||
</trim>
|
||||
) VALUES
|
||||
<!-- 遍历 List,为每个实体拼接 VALUES 子句 -->
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
<trim suffixOverrides=","> <!-- 去除每个 VALUES 后多余的逗号 -->
|
||||
<if test="item.applyId != null">#{item.applyId},</if>
|
||||
<if test="item.typeId != null">#{item.typeId},</if>
|
||||
<if test="item.supplierId != null">#{item.supplierId},</if>
|
||||
<if test="item.applyNum != null">#{item.applyNum},</if>
|
||||
<if test="item.toolPrice != null">#{item.toolPrice},</if>
|
||||
<if test="item.productionDate != null">#{item.productionDate},</if>
|
||||
<if test="item.code != null">#{item.code},</if>
|
||||
<if test="item.identifyCode != null">#{item.identifyCode},</if>
|
||||
</trim>
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
<update id="delete">
|
||||
UPDATE tool_apply
|
||||
set del_flag = '1'
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
<update id="deleteDetail">
|
||||
UPDATE tool_apply_details
|
||||
set del_flag = '1'
|
||||
WHERE type_id = #{typeId}
|
||||
AND apply_id = #{applyId}
|
||||
</update>
|
||||
|
||||
<update id="update">
|
||||
UPDATE tool_apply
|
||||
set status = #{status}
|
||||
WHERE id = #{id}
|
||||
and del_flag = '0'
|
||||
</update>
|
||||
|
||||
<update id="updateDetail">
|
||||
UPDATE tool_apply_details
|
||||
set status = #{status}
|
||||
WHERE type_id = #{typeId}
|
||||
AND apply_id = #{applyId}
|
||||
and del_flag = '0'
|
||||
</update>
|
||||
|
||||
<update id="updateAllDetail">
|
||||
UPDATE tool_apply_details
|
||||
set status = #{status}
|
||||
WHERE apply_id = #{applyId}
|
||||
and status = '1'
|
||||
and del_flag = '0'
|
||||
</update>
|
||||
|
||||
<select id="list" resultType="com.bonus.material.toolProcess.domain.ToolApplyEntity">
|
||||
SELECT id AS id,
|
||||
code AS code,
|
||||
create_by AS createBy,
|
||||
create_time AS createTime,
|
||||
status AS status,
|
||||
review_by AS reviewBy,
|
||||
review_time AS reviewTime
|
||||
from tool_apply
|
||||
SELECT ta.id AS id,
|
||||
ta.code AS code,
|
||||
ta.create_by AS createBy,
|
||||
ta.create_time AS createTime,
|
||||
ta.status AS status,
|
||||
ta.review_by AS reviewBy,
|
||||
ta.review_time AS reviewTime,
|
||||
SUM(IF(tad.del_flag = '0', tad.apply_num, 0)) AS total, -- 待审核明细数
|
||||
SUM(IF(tad.status = '2', tad.apply_num, 0)) AS passed, -- 通过明细数
|
||||
SUM(IF(tad.status = '3', tad.apply_num, 0)) AS quantity -- 驳回明细数
|
||||
FROM tool_apply ta
|
||||
LEFT JOIN tool_apply_details tad ON tad.apply_id = ta.id and tad.del_flag ='0'
|
||||
WHERE ta.del_flag = '0'
|
||||
<!-- 类型名称:非空且非空字符串才更新 -->
|
||||
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
||||
AND ta.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
AND ta.create_by LIKE CONCAT('%', #{createBy}, '%')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND ta.status = #{status}
|
||||
</if>
|
||||
GROUP BY ta.id, ta.`code`
|
||||
ORDER BY
|
||||
ta.create_time DESC,
|
||||
ta.status ASC
|
||||
</select>
|
||||
|
||||
<select id="getTreeSelect" resultType="com.bonus.material.tool.domain.ToolEntity">
|
||||
SELECT type_id AS typeId,
|
||||
type_name AS typeName,
|
||||
parent_id AS parentId,
|
||||
unit_name AS unitName,
|
||||
manage_type AS manageType,
|
||||
level AS level
|
||||
FROM tool_type
|
||||
WHERE del_flag = '0'
|
||||
and (manage_type = #{manageType} OR manage_type is null)
|
||||
</select>
|
||||
|
||||
<select id="listByApplyId" resultType="com.bonus.material.toolProcess.domain.ToolApplyDetailsEntity">
|
||||
SELECT tt.type_id AS typeId,
|
||||
tt.type_name AS typeName,
|
||||
tt.manage_type AS manageType,
|
||||
SUM(tad.apply_num) AS applyNum,
|
||||
tt.level AS level,
|
||||
tad.id AS id,
|
||||
tad.status AS status,
|
||||
tt1.type_name AS parentTypeName, -- 1级父节点名称
|
||||
tt2.type_name AS grandparentTypeName, -- 2级父节点名称
|
||||
tt3.type_name AS greatGrandparentName, -- 3级父节点名称
|
||||
tt4.type_name AS fourthParentName -- 4级父节点名称
|
||||
FROM tool_apply_details tad
|
||||
LEFT JOIN tool_type tt ON tad.type_id = tt.type_id
|
||||
-- 关联1级父节点(直接父节点)
|
||||
INNER JOIN tool_type tt1 ON tt.parent_id = tt1.type_id
|
||||
-- 关联2级父节点(祖父节点)
|
||||
INNER JOIN tool_type tt2 ON tt1.parent_id = tt2.type_id
|
||||
-- 关联3级父节点(曾祖父节点)
|
||||
INNER JOIN tool_type tt3 ON tt2.parent_id = tt3.type_id
|
||||
-- 关联4级父节点
|
||||
INNER JOIN tool_type tt4 ON tt3.parent_id = tt4.type_id
|
||||
WHERE tad.del_flag = '0'
|
||||
AND tt.del_flag = '0'
|
||||
AND tt1.del_flag = '0'
|
||||
AND tt2.del_flag = '0'
|
||||
AND tt3.del_flag = '0'
|
||||
AND tt4.del_flag = '0'
|
||||
AND tad.apply_id = #{applyId}
|
||||
<if test="typeName != null and typeName != ''">
|
||||
AND tt.type_name LIKE CONCAT('%', #{typeName}, '%')
|
||||
</if>
|
||||
<if test="parentTypeName != null and parentTypeName != ''">
|
||||
AND tt1.type_name LIKE CONCAT('%', #{parentTypeName}, '%')
|
||||
</if>
|
||||
<if test="manageType != null and manageType != ''">
|
||||
AND tt.manage_type = #{manageType}
|
||||
</if>
|
||||
GROUP BY tt.type_id
|
||||
|
||||
</select>
|
||||
<select id="listReview" resultType="com.bonus.material.toolProcess.domain.ToolApplyEntity">
|
||||
SELECT ta.id AS id,
|
||||
ta.code AS code,
|
||||
ta.create_by AS createBy,
|
||||
ta.create_time AS createTime,
|
||||
ta.status AS status,
|
||||
ta.review_by AS reviewBy,
|
||||
ta.review_time AS reviewTime,
|
||||
SUM(IF(tad.del_flag = '0', tad.apply_num, 0)) AS total, -- 待审核明细数
|
||||
SUM(IF(tad.status = '2', tad.apply_num, 0)) AS passed, -- 通过明细数
|
||||
SUM(IF(tad.status = '3', tad.apply_num, 0)) AS quantity -- 驳回明细数
|
||||
FROM tool_apply ta
|
||||
LEFT JOIN tool_apply_details tad ON tad.apply_id = ta.id and tad.del_flag ='0'
|
||||
WHERE ta.del_flag = '0' AND ta.status !='0'
|
||||
<!-- 类型名称:非空且非空字符串才更新 -->
|
||||
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
||||
AND ta.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
AND ta.create_by LIKE CONCAT('%', #{createBy}, '%')
|
||||
</if>
|
||||
<if test="status != null and status != 0">
|
||||
AND ta.status = #{status}
|
||||
</if>
|
||||
GROUP BY ta.id, ta.`code`
|
||||
ORDER BY
|
||||
ta.create_time DESC,
|
||||
ta.status ASC
|
||||
</select>
|
||||
<select id="getCount" resultType="java.lang.Integer">
|
||||
select COUNT(1)
|
||||
from tool_apply_details
|
||||
where apply_id = #{applyId}
|
||||
and status = 1
|
||||
and del_flag = '0'
|
||||
</select>
|
||||
<select id="listEncoding" resultType="com.bonus.material.toolProcess.domain.ToolApplyDetailsEntity">
|
||||
SELECT
|
||||
tt.type_name AS typeName,
|
||||
tt.unit_name AS unitName,
|
||||
tad.id AS id,
|
||||
tad.status AS status,
|
||||
tad.identify_code AS identifyCode,
|
||||
ms.supplier_name AS supplierName,
|
||||
tad.tool_price AS toolPrice,
|
||||
tad.production_date AS productionDate,
|
||||
tt1.type_name AS parentTypeName, -- 1级父节点名称
|
||||
tt2.type_name AS grandparentTypeName, -- 2级父节点名称
|
||||
tt3.type_name AS greatGrandparentName, -- 3级父节点名称
|
||||
tt4.type_name AS fourthParentName -- 4级父节点名称
|
||||
FROM tool_apply_details tad
|
||||
INNER JOIN ma_supplier ms ON ms.supplier_id = tad.supplier_id
|
||||
INNER JOIN tool_type tt ON tad.type_id = tt.type_id
|
||||
-- 关联1级父节点(直接父节点)
|
||||
INNER JOIN tool_type tt1 ON tt.parent_id = tt1.type_id
|
||||
-- 关联2级父节点(祖父节点)
|
||||
INNER JOIN tool_type tt2 ON tt1.parent_id = tt2.type_id
|
||||
-- 关联3级父节点(曾祖父节点)
|
||||
INNER JOIN tool_type tt3 ON tt2.parent_id = tt3.type_id
|
||||
-- 关联4级父节点
|
||||
INNER JOIN tool_type tt4 ON tt3.parent_id = tt4.type_id
|
||||
WHERE tad.del_flag = '0'
|
||||
AND tt.del_flag = '0'
|
||||
AND tt1.del_flag = '0'
|
||||
AND tt2.del_flag = '0'
|
||||
AND tt3.del_flag = '0'
|
||||
AND tt4.del_flag = '0'
|
||||
AND tad.type_id = #{typeId}
|
||||
AND tad.apply_id = #{applyId}
|
||||
<if test="typeName != null and typeName != ''">
|
||||
AND tt.type_name LIKE CONCAT('%', #{typeName}, '%')
|
||||
</if>
|
||||
<if test="parentTypeName != null and parentTypeName != ''">
|
||||
AND tt1.type_name LIKE CONCAT('%', #{parentTypeName}, '%')
|
||||
</if>
|
||||
<if test="manageType != null and manageType != ''">
|
||||
AND tt.manage_type = #{manageType}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue