Commit 3f93ff52 by 赵剑炜

修复物资类别代码

parent 2961416a
......@@ -5,33 +5,16 @@ import com.junmp.v2.common.bean.request.ValidationApi;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;
@Data
@EqualsAndHashCode(callSuper = true)
public class QueryEquipmentTypeReq extends BaseRequest {
@NotNull(message = "装备主键不能为空", groups = {ValidationApi.edit.class, ValidationApi.delete.class, ValidationApi.detail.class})
private String id;
@NotNull(message = "状态不能为空", groups = { ValidationApi.delete.class})
private String state;
private String unitType;
private String code;
private String name;
private String note;
private String parentId;
private int warrantyPeriod;
private int maintenancePeriod;
private int type;
private List<String> supplierList;
}
......@@ -3,12 +3,35 @@ package com.junmp.jyzb.api.bean.req;
import com.junmp.v2.common.bean.request.ValidationApi;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;
@Data
public class UpdateEquipmentTypeReq {
@NotNull(message = "装备主键不能为空", groups = {ValidationApi.edit.class, ValidationApi.delete.class, ValidationApi.detail.class})
private String id;
@NotNull(message = "状态不能为空", groups = { ValidationApi.delete.class})
@NotNull(message = "状态不能为空", groups = { ValidationApi.updateStatus.class})
private String state;
private String unitType;
private String code;
private String name;
private String note;
@NotBlank(message = "上级不能为空", groups = {ValidationApi.edit.class, ValidationApi.add.class})
private String parentId;
@NotBlank(message = "上级集合不能为空", groups = {ValidationApi.edit.class, ValidationApi.add.class})
private String parentIds;
private int warrantyPeriod;
private int maintenancePeriod;
private int type;
private List<String> supplierList;
}
......@@ -28,27 +28,20 @@ public class EquipmentTypeController {
@PostMapping("/AddEquipment")
@ApiOperation("添加物资")
public ApiRes<Boolean> addEquipment(@RequestBody @Validated(QueryEquipmentTypeReq.add.class) QueryEquipmentTypeReq req) {
public ApiRes<Boolean> addEquipment(@RequestBody @Validated(ValidationApi.add.class) UpdateEquipmentTypeReq req) {
return ApiRes.success(equipmentTypeService.addEquipment(req));
}
//添加装备时计算id
@PostMapping("/CalculationEquipmentId")
public ResponseResult calculationEquipmentId() {
ResponseResult returnMsg = equipmentTypeService.calculationEquipmentId();
return returnMsg;
}
@PostMapping("/DeleteEquipment")
@ApiOperation("删除装备信息")
public ApiRes<Boolean> deleteEquipment(@RequestBody @Validated(ValidationApi.delete.class) QueryEquipmentTypeReq req) {
public ApiRes<Boolean> deleteEquipment(@RequestBody @Validated(ValidationApi.delete.class) UpdateEquipmentTypeReq req) {
return ApiRes.success(equipmentTypeService.deleteEquipment(req));
}
@PostMapping("/ChangeEquipmentState")
@ApiOperation("禁用/启用装备类型")
public ApiRes<Boolean> changeEquipmentState(@RequestBody UpdateEquipmentTypeReq req) {
public ApiRes<Boolean> changeEquipmentState(@RequestBody @Validated(ValidationApi.updateStatus.class) UpdateEquipmentTypeReq req) {
return ApiRes.success(equipmentTypeService.changeEquipmentState(req));
}
......@@ -67,16 +60,10 @@ public class EquipmentTypeController {
@PostMapping("/UpdateEquipment")
@ApiOperation("修改物资信息")
public ApiRes<Boolean> updateEquipment(@RequestBody @Validated(ValidationApi.edit.class) QueryEquipmentTypeReq req) {
public ApiRes<Boolean> updateEquipment(@RequestBody @Validated(ValidationApi.edit.class) UpdateEquipmentTypeReq req) {
return ApiRes.success(equipmentTypeService.updateEquipment(req));
}
@PostMapping("/ShowEquipmentChildren")
@ApiOperation("根据类别查询装备")
public ResponseResult showEquipmentChildren(@RequestBody Map<String,Object> msg) {
ResponseResult responseMsg = equipmentTypeService.showEquipmentChildren(msg);
return responseMsg;
}
@PostMapping("/SetTypeParentIds")
@ApiOperation("填充装备类型的parent_ids字段")
......@@ -85,10 +72,4 @@ public class EquipmentTypeController {
return returnMsg;
}
@PostMapping("/GetEquipmentDevelop")
@ApiOperation("获取装备表所有信息(非树表)")
public ResponseResult getEquipmentDevelop() {
ResponseResult returnMsg = equipmentTypeService.getEquipmentDevelop();
return returnMsg;
}
}
package com.junmp.jyzb.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
......@@ -64,20 +61,14 @@ public class EquipmentType implements Serializable {
@TableField("parent_ids")
private String parentIds;
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
@TableField(fill = FieldFill.INSERT_UPDATE, value = "create_time")
private Date createTime;
/**
* 最后更新时间
*/
@ApiModelProperty(value = "最后更新时间")
@TableField("update_time")
@TableField(fill = FieldFill.INSERT_UPDATE, value = "update_time")
private Date updateTime;
/**
* 当前状态:0关闭/1启用
*/
......
......@@ -48,12 +48,12 @@ public class Supplier implements Serializable {
@TableField(value = "phone")
private String phone;
/**
* 创建时间
*/
@TableField(value = "create_time")
@TableField(fill = FieldFill.INSERT_UPDATE, value = "create_time")
private Date createTime;
@TableField(fill = FieldFill.INSERT_UPDATE, value = "update_time")
private Date updateTime;
/**
* 创建人员
......@@ -61,11 +61,6 @@ public class Supplier implements Serializable {
@TableField(value = "create_time", fill = FieldFill.INSERT)
private String createUser;
/**
* 最后更新时间
*/
@TableField(value = "update_time", fill = FieldFill.UPDATE)
private Date updateTime;
/**
* 更新人ID
......
package com.junmp.jyzb.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@ApiModel(value = "com-junmp-jyzb-domain-SupplierEquipment")
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("base_supplier_type")
public class SupplierEquipment implements Serializable {
/**
* 供应商产品ID
*/
@TableField(value = "id")
private String id;
/**
* 供应商代码
*/
@TableField(value = "supplier_id")
private String supplierId;
/**
* 产品代码
*/
@TableField(value = "type_id")
private String typeId;
/**
* 状态,0:启用,1:停用
*/
@TableField(value = "state")
private Integer state;
/**
* 创建时间
*/
@TableField(value = "create_time")
private Date createTime;
/**
* 最后更新时间
*/
@TableField(value = "update_time")
private Date updateTime;
/**
* 更新人ID
*/
@TableField(value = "update_user")
private String updateUser;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package com.junmp.jyzb.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
......@@ -40,16 +41,10 @@ public class SupplierType implements Serializable {
@TableField(value = "state")
private Integer state;
/**
* 创建时间
*/
@TableField(value = "create_time")
@TableField(fill = FieldFill.INSERT_UPDATE, value = "create_time")
private Date createTime;
/**
* 最后更新时间
*/
@TableField(value = "update_time")
@TableField(fill = FieldFill.INSERT_UPDATE, value = "update_time")
private Date updateTime;
/**
......
......@@ -11,46 +11,11 @@ import java.util.Map;
@Mapper
public interface EquipmentTypeMapper extends BaseMapper<EquipmentType> {
void addEquipment(EquipmentType equipmentType);
//Map<String, Object> getOneEquipment(String id);
void deleteEquipment(String id);
void updateEquipment(EquipmentType msg);
List<String> getAllEquipmentId(String orgId);
void changeEquipmentState(EquipmentType msg);
List<EquipmentType> selectAllEquipment();
List<Map<String,Object>> getAll();
void addData(List<Map<String, Object>> resultList);
String getIdByParentId(String parentId);
//添加商品的供应商
void addSupplier(@Param("uuid") String uuid,@Param("equipmentType") EquipmentType equipmentType, @Param("supplierList") List<String> supplierList);
void setCalculationId(@Param("numStr") String numStr,@Param("parentId") String parentId);
String getOneEquipmentId(String numStr);
void deleteSupplier(String id);
Map<String,Object> getOneEquipment(EquipmentType equipment);
List<Map<String, Object>> getSupplierByTypeId(EquipmentType equipment);
List<String> getLowestTypeId();
List<Map<String, Object>> getChildByParentId(String equipmentId);
void wipeParentIdsData();
void setTypeParentIds();
List<Map<String, Object>> getEquipmentDevelop();
}
\ No newline at end of file
package com.junmp.jyzb.mapper;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface SupplierEquipmentMapper {
}
\ No newline at end of file
......@@ -13,13 +13,12 @@ import java.util.Map;
public interface EquipmentTypeService extends IService<EquipmentType> {
Boolean addEquipment(QueryEquipmentTypeReq req );
Boolean addEquipment(UpdateEquipmentTypeReq req );
ResponseResult calculationEquipmentId();
Boolean deleteEquipment(QueryEquipmentTypeReq req);
Boolean deleteEquipment(UpdateEquipmentTypeReq req);
Boolean updateEquipment(QueryEquipmentTypeReq msg);
Boolean updateEquipment(UpdateEquipmentTypeReq msg);
Boolean changeEquipmentState(UpdateEquipmentTypeReq req);
......@@ -27,10 +26,7 @@ public interface EquipmentTypeService extends IService<EquipmentType> {
EquipmentTypeDto getEquipment(QueryEquipmentTypeReq req );
ResponseResult showEquipmentChildren(Map<String, Object> msg);
ResponseResult setTypeParentIds();
ResponseResult getEquipmentDevelop();
}
package com.junmp.jyzb.service;
public interface SupplierEquipmentService{
}
......@@ -3,6 +3,7 @@ package com.junmp.jyzb.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.junmp.jyzb.api.bean.dto.EquipmentTreeDto;
......@@ -26,6 +27,7 @@ import com.junmp.jyzb.mapper.EquipmentTypeMapper;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.stream.Collectors;
import static com.junmp.jyzb.utils.CheckBlank.checkNotBlank;
......@@ -49,8 +51,6 @@ public class EquipmentTypeServiceImpl extends ServiceImpl<EquipmentTypeMapper, E
public List<EquipmentTreeDto> getEquipmentList(QueryEquipmentTypeReq req) {
String selfCode="00000000-0000-0000-0000-000000000000";
List<EquipmentTreeDto> equipmentTypeDTOList = new ArrayList<>();
LambdaQueryWrapper<EquipmentType> wrapper = new LambdaQueryWrapper<>();
String setNewCode="";
......@@ -124,7 +124,7 @@ public class EquipmentTypeServiceImpl extends ServiceImpl<EquipmentTypeMapper, E
@Transactional
@Override
public Boolean addEquipment(QueryEquipmentTypeReq req) {
public Boolean addEquipment(UpdateEquipmentTypeReq req) {
EquipmentType type = new EquipmentType();
......@@ -134,11 +134,11 @@ public class EquipmentTypeServiceImpl extends ServiceImpl<EquipmentTypeMapper, E
//先增加code码
BeanPlusUtil.copyProperties(req, type);
EquipmentType parentType = this.getById(this.getById(req.getId()).getParentId());
EquipmentType parentType = this.getById(req.getParentId());
int newcode = parentType.getMaxCode() + 1;
type.setId(String.valueOf(newcode));
parentType.setMaxCode(newcode);
parentType.setCode(String.valueOf(newcode));
List<SupplierType> supplierType = new ArrayList<>();
req.getSupplierList().forEach(supply -> {
SupplierType st = new SupplierType();
......@@ -150,33 +150,18 @@ public class EquipmentTypeServiceImpl extends ServiceImpl<EquipmentTypeMapper, E
}
);
supplierTypeService.saveBatch(supplierType);
this.save(parentType);
this.updateById(parentType);
return this.save(type);
} else {
throw new JYZBAppException(EquipmentTypeExceptionEnum.SUPPLIER_NOT_EXIST, String.join(",", chekResult));
String msg="以下供应商不存在:" +String.join(",", chekResult);
throw new JYZBAppException(EquipmentTypeExceptionEnum.SUPPLIER_NOT_EXIST, msg);
}
}
@Override
public ResponseResult calculationEquipmentId() {
List<Map<String, Object>> inputList = equipmentTypeMapper.getAll();
// 假设您已经有了填充数据的inputList
List<Map<String, Object>> resultList = new ArrayList<>();
for (int i = 0; i < inputList.size() - 1; i++) {
Map<String, Object> currentMap = inputList.get(i);
Map<String, Object> nextMap = inputList.get(i + 1);
int currentId = (int) currentMap.get("id");
int nextId = (int) nextMap.get("id");
if (currentId + 1 != nextId) {
resultList.add(currentMap);
}
}
equipmentTypeMapper.addData(resultList);
return new ResponseResult(99200, ReturnMsg.PASS, resultList);
}
@Override
public Boolean deleteEquipment(QueryEquipmentTypeReq req) {
public Boolean deleteEquipment(UpdateEquipmentTypeReq req) {
LambdaQueryWrapper<EquipmentType> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(ObjectUtil.isNotEmpty(req.getId()), EquipmentType::getParentId, req.getParentId());
List<EquipmentType> eqList = list(wrapper);
......@@ -188,15 +173,67 @@ public class EquipmentTypeServiceImpl extends ServiceImpl<EquipmentTypeMapper, E
return true;
}
@Transactional
@Override
public Boolean updateEquipment(QueryEquipmentTypeReq req) {
public Boolean updateEquipment(UpdateEquipmentTypeReq req) {
EquipmentType type = this.queryEqType(req);
BeanPlusUtil.copyProperties(req, type);
return this.updateById(type);
List<String> chekResult = supplierService.CheckSupplierList(req.getSupplierList());
if (chekResult.size() == 0) {
// 先增加code码
BeanPlusUtil.copyProperties(req, type);
// 获取当前type对应的所有关联的供应商
List<SupplierType> currentSupplierList = supplierTypeService.list(new LambdaQueryWrapper<SupplierType>()
.eq(SupplierType::getTypeId, type.getId()));
// 获取当前type对应的所有关联的供应商ID集合
Set<String> currentSupplierIds = currentSupplierList.stream()
.map(SupplierType::getSupplierId)
.collect(Collectors.toSet());
// 获取传入的supplierList中的所有供应商ID集合
Set<String> newSupplierIds = new HashSet<>(req.getSupplierList());
// 需要新增的供应商关联数据
List<SupplierType> supplierTypeToAdd = new ArrayList<>();
for (String supplierId : newSupplierIds) {
if (!currentSupplierIds.contains(supplierId)) {
SupplierType st = new SupplierType();
st.setId(String.valueOf(UUID.randomUUID()));
st.setState(0);
st.setSupplierId(supplierId);
st.setTypeId(String.valueOf(type.getId()));
supplierTypeToAdd.add(st);
}
}
// 需要删除的供应商关联数据
List<SupplierType> supplierTypeToDelete = new ArrayList<>();
for (SupplierType currentSupplier : currentSupplierList) {
if (!newSupplierIds.contains(currentSupplier.getSupplierId())) {
supplierTypeToDelete.add(currentSupplier);
}
}
// 保存新增的供应商关联数据
supplierTypeService.saveBatch(supplierTypeToAdd);
// 删除需要删除的供应商关联数据
if (!supplierTypeToDelete.isEmpty()) {
supplierTypeService.removeByIds(supplierTypeToDelete.stream()
.map(SupplierType::getId)
.collect(Collectors.toList()));
}
// 保存type
return this.updateById(type);
} else {
String msg="以下供应商不存在:" +String.join(",", chekResult);
throw new JYZBAppException(EquipmentTypeExceptionEnum.SUPPLIER_NOT_EXIST, msg);
}
}
private EquipmentType queryEqType(QueryEquipmentTypeReq req) {
private EquipmentType queryEqType(UpdateEquipmentTypeReq req) {
EquipmentType type = this.getById(req.getId());
if (ObjectUtil.isNull(type)) {
......@@ -223,19 +260,6 @@ public class EquipmentTypeServiceImpl extends ServiceImpl<EquipmentTypeMapper, E
return equipment;
}
@Override
public ResponseResult showEquipmentChildren(Map<String, Object> msg) {
try {
checkNotBlank(msg.get("equipmentId"), "equipmentId不能为空");
} catch (IllegalArgumentException e) {
return new ResponseResult(HttpStatus.ERROR, ReturnMsg.ERROR, e.getMessage());
}
String equipmentId = msg.get("equipmentId").toString();
List<Map<String, Object>> equipmentMsg = equipmentTypeMapper.getChildByParentId(equipmentId);
return new ResponseResult(HttpStatus.SUCCESS, ReturnMsg.PASS, equipmentMsg);
}
@Override
public ResponseResult setTypeParentIds() {
......@@ -247,51 +271,11 @@ public class EquipmentTypeServiceImpl extends ServiceImpl<EquipmentTypeMapper, E
}
@Override
public ResponseResult getEquipmentDevelop() {
List<Map<String, Object>> returnMsg = equipmentTypeMapper.getEquipmentDevelop();
return new ResponseResult(HttpStatus.SUCCESS, ReturnMsg.PASS, returnMsg);
}
private List<Map<String, Object>> getChildMenus(String parentId, List<EquipmentType> menuList) {
List<Map<String, Object>> childList = new ArrayList<>();
for (EquipmentType menu : menuList) {
if (menu.getParentId().equals(parentId)) {
Map<String, Object> map = new HashMap<>();
map.put("id", menu.getId());
map.put("name", menu.getName());
map.put("unit", menu.getUnit());
map.put("unitType", menu.getUnitType());
map.put("code", menu.getCode());
map.put("parentId", menu.getParentId());
map.put("state", menu.getState());
map.put("note", menu.getNote());
map.put("createTime", menu.getCreateTime());
map.put("updateTime", menu.getUpdateTime());
List<Map<String, Object>> children = getChildMenus(menu.getId(), menuList);
if (!children.isEmpty()) {
map.put("children", children);
}
childList.add(map);
}
}
return childList;
}
private LambdaQueryWrapper<EquipmentType> createWrapper(QueryEquipmentTypeReq req) {
LambdaQueryWrapper<EquipmentType> wrapper = new LambdaQueryWrapper<>();
if (ObjectUtil.isEmpty(req)) {
return wrapper;
}
wrapper.like(ObjectUtil.isNotEmpty(req.getName()), EquipmentType::getName, req.getName());
wrapper.orderByDesc(EquipmentType::getCreateTime);
return wrapper;
......
package com.junmp.jyzb.service.impl;
import com.junmp.jyzb.service.SupplierEquipmentService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.junmp.jyzb.mapper.SupplierEquipmentMapper;
@Service
public class SupplierEquipmentServiceImpl implements SupplierEquipmentService {
@Resource
private SupplierEquipmentMapper supplierEquipmentMapper;
}
......@@ -18,144 +18,6 @@
id, `name`, code, parent_id, create_time, update_time, `state`, note
</sql>
<select id="selectAllEquipment" resultType="com.junmp.jyzb.entity.EquipmentType">
SELECT id,name,unit,unit_type,code,parent_id,state,note,code,create_time,update_time,type
FROM base_equipment_type
where type = 0
</select>
<!-- <where>-->
<!-- <if test="SelectTypeId != null">-->
<!-- AND id LIKE CONCAT(#{SelectTypeId})-->
<!-- </if>-->
<!-- <if test="SelectState != null">-->
<!-- AND state LIKE CONCAT(#{SelectState})-->
<!-- </if>-->
<!-- </where>-->
<!-- <if test="SelectTypeId != null and SelectTypeId != ''">-->
<!-- AND id LIKE CONCAT(#{SelectTypeId})-->
<!-- </if>-->
<!-- <if test="SelectState != null and SelectState != ''">-->
<!-- AND state LIKE CONCAT(#{SelectState})-->
<!-- </if>-->
<!--SELECT id,name,unit,unit_type,code,parent_id,state,note,-->
<!-- CASE-->
<!-- WHEN update_time IS NULL THEN create_time-->
<!-- ELSE update_time-->
<!-- END AS update_time-->
<!-- FROM base_equipment_type-->
<insert id="addEquipment" parameterType="com.junmp.jyzb.entity.EquipmentType">
insert into base_equipment_type
(id,name,unit_type,code,parent_id,create_time,update_time,state,note)
values
(#{id},#{name},#{unitType},#{id},#{parentId},#{createTime},#{updateTime},1,#{note})
</insert>
<update id="changeEquipmentState">
update base_equipment_type w
set w.state = #{state}
where w.id = #{id}
</update>
<!--<update id="changeEquipmentState">-->
<!-- update base_equipment_type w,base_supplier_id i-->
<!-- set w.state = #{state},i.state = #{state}-->
<!-- where w.id =#{id} and i.type_id = #{id}-->
<!-- </update>-->
<delete id="deleteEquipment">
delete from base_equipment_type w
where id =#{id}
</delete>
<update id="updateEquipment">
update base_equipment_type p
set name = #{name},unit_type=#{unitType},code=#{id},update_time=#{updateTime},parent_id=#{parentId},note=#{note}
where p.id =#{id}
</update>
<select id="getAllEquipmentId" resultType="String">
select id
from base_equipment_type w
</select>
<select id="getAll" resultType="Map">
select id,parent_id as parentId from base_equipment_type
</select>
<insert id="addData" parameterType="java.util.List">
INSERT INTO base_equipment_id (id, parent_id)
VALUES
<foreach collection="list" item="item" index="index" separator=",">
(#{item.id}, #{item.parentId})
</foreach>
</insert>
<select id="getIdByParentId" resultType="String">
select id
from base_equipment_id i
where parent_id = #{parentId}
</select>
<insert id="addSupplier" parameterType="com.junmp.jyzb.entity.EquipmentType">
INSERT INTO base_supplier_type (id,supplier_id,type_id,state,create_time,update_time)
VALUES
<foreach collection="supplierList" item="supplier" separator=",">
(#{uuid}, #{supplier},#{equipmentType.id},1,#{equipmentType.createTime},#{equipmentType.updateTime})
</foreach>
</insert>
<update id="setCalculationId">
update base_equipment_id i
set id = #{numStr}
where i.parent_id =#{parentId}
</update>
<select id="getOneEquipmentId" resultType="String">
select id
from base_equipment_type t
where t.id =#{numStr}
</select>
<delete id="deleteSupplier">
delete from base_supplier_type w
where type_id =#{id}
</delete>
<select id="getOneEquipment" resultType="Map">
select id,parent_id as parentId,name,unit_type as unitType,code,create_time as createTime,update_time as updateTime,state from base_equipment_type
</select>
<select id="getSupplierByTypeId" resultType="java.util.Map">
SELECT s.name
FROM base_supplier_type t
left join base_supplier s on t.supplier_id = s.id
WHERE type_id = #{id}
</select>
<select id="getLowestTypeId" resultType="String">
select id
from base_equipment_type w
</select>
<select id="getChildByParentId" resultType="Map">
select
id,
name,
unit,
unit_type as unitType,
code,
parent_id as parentId,
state,
note,
create_time as createTime,
update_time as updateTime
from base_equipment_type
where parent_id = #{equipmentId}
</select>
<update id="wipeParentIdsData">
UPDATE base_equipment_type t
......@@ -183,9 +45,4 @@ JOIN cte ON p.id = cte.id
SET p.parent_ids = cte.parent_ids;
</update>
<select id="getEquipmentDevelop" resultType="Map">
select
*
from base_equipment_type
</select>
</mapper>
\ No newline at end of file
<?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.junmp.jyzb.mapper.SupplierEquipmentMapper">
<resultMap id="BaseResultMap" type="com.junmp.jyzb.entity.SupplierEquipment">
<!--@mbg.generated-->
<!--@Table base_supplier_equipment-->
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="supplier_id" jdbcType="VARCHAR" property="supplierId" />
<result column="type_id" jdbcType="VARCHAR" property="typeId" />
<result column="state" jdbcType="INTEGER" property="state" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="update_user" jdbcType="VARCHAR" property="updateUser" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, supplier_id, type_id, `state`, create_time, update_time, update_user
</sql>
</mapper>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论