装备管理
This commit is contained in:
parent
b6e3fe369e
commit
c76dc2809d
|
|
@ -56,4 +56,9 @@ public class SysDeptController extends BaseController {
|
|||
public AjaxResult selectConfigList(@RequestBody DeptEquipmentConfig user) {
|
||||
return service.selectConfigList(user);
|
||||
}
|
||||
//装备名称下拉框获取
|
||||
@PostMapping("/getTree")
|
||||
public AjaxResult getTree() {
|
||||
return service.getTree();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bonus.material.equipment.domain;
|
|||
import com.bonus.system.api.domain.SysDept;
|
||||
import com.bonus.system.api.domain.SysMenu;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
|
@ -13,6 +14,7 @@ import java.util.stream.Collectors;
|
|||
*
|
||||
* @author bonus
|
||||
*/
|
||||
@Data
|
||||
public class DeptTreeSelect implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
|
@ -21,6 +23,8 @@ public class DeptTreeSelect implements Serializable {
|
|||
*/
|
||||
private Long id;
|
||||
|
||||
private String name;
|
||||
|
||||
/** 父部门ID */
|
||||
private Long parentId;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.bonus.material.equipment.mapper;
|
|||
|
||||
import com.bonus.material.equipment.domain.ConfigEntity;
|
||||
import com.bonus.material.equipment.domain.DeptEquipmentConfig;
|
||||
import com.bonus.material.equipment.domain.DeptTreeSelect;
|
||||
import com.bonus.material.equipment.domain.SysDept;
|
||||
import com.bonus.system.api.domain.SysUser;
|
||||
|
||||
|
|
@ -16,4 +17,6 @@ public interface SysDeptMapper {
|
|||
|
||||
|
||||
List<ConfigEntity> selectConfigList(DeptEquipmentConfig user);
|
||||
|
||||
List<DeptTreeSelect> getTree();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package com.bonus.material.equipment.service;
|
||||
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.material.equipment.domain.ConfigEntity;
|
||||
import com.bonus.material.equipment.domain.DeptEquipmentConfig;
|
||||
import com.bonus.material.equipment.domain.DeptTreeSelect;
|
||||
import com.bonus.system.api.domain.SysDept;
|
||||
|
|
@ -17,4 +16,6 @@ public interface ISysDeptService {
|
|||
|
||||
|
||||
AjaxResult selectConfigList(DeptEquipmentConfig user);
|
||||
|
||||
AjaxResult getTree();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,6 +57,17 @@ public class SysDeptServiceImpl implements ISysDeptService {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getTree() {
|
||||
try {
|
||||
List<DeptTreeSelect> sysDepts = mapper.getTree();
|
||||
return ObjectUtils.isNotEmpty(sysDepts) ? AjaxResult.success(sysDepts) : AjaxResult.success();
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询部门管理数据
|
||||
*
|
||||
|
|
|
|||
|
|
@ -88,6 +88,19 @@
|
|||
WHERE dept_id = #{deptId}
|
||||
AND type_id = #{typeId}
|
||||
</select>
|
||||
<select id="getTree" resultType="com.bonus.material.equipment.domain.DeptTreeSelect">
|
||||
SELECT
|
||||
mt.type_id AS id,
|
||||
|
||||
mt.type_name AS name
|
||||
FROM ma_type mt
|
||||
LEFT JOIN ma_type mt2 ON mt.parent_id = mt2.type_id
|
||||
LEFT JOIN ma_dept_config mdc
|
||||
ON mdc.type_id = mt.type_id
|
||||
|
||||
WHERE mt.level = 3
|
||||
GROUP BY mt.type_id, mt2.type_name, mt.type_name
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -27,9 +27,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</update>
|
||||
|
||||
<select id="list" resultType="com.bonus.material.owner.domain.Ownerdomin">
|
||||
select id, ma_type as maType, ma_name as maName, model_id as modelId,ma_model as maModel,
|
||||
ma_num as maNum, create_time as createTime, creator, remark
|
||||
from ma_own_manage
|
||||
SELECT
|
||||
m.id,
|
||||
m.ma_type AS maType,
|
||||
t.type_name AS maName,
|
||||
m.model_id AS modelId,
|
||||
m.ma_model AS maModel,
|
||||
m.ma_num AS maNum,
|
||||
m.create_time AS createTime,
|
||||
m.creator,
|
||||
m.remark
|
||||
FROM
|
||||
ma_own_manage m
|
||||
LEFT JOIN
|
||||
ma_type t ON m.ma_name = t.type_id
|
||||
<where>
|
||||
is_active = 0
|
||||
<if test="type!= null and type != ''">
|
||||
|
|
|
|||
Loading…
Reference in New Issue