设备类型下拉选

This commit is contained in:
hayu 2025-03-05 14:48:59 +08:00
parent f0bf68a8cd
commit 40b6fa35b9
6 changed files with 44 additions and 1 deletions

View File

@ -46,6 +46,15 @@ public class SelectController {
return service.getMaTypeData(dto); return service.getMaTypeData(dto);
} }
/**
* 根据三级查四级
*/
@ApiOperation(value = "机具类型下拉选")
@PostMapping("getMaTypeDataById")
public AjaxResult getMaTypeDataById(@RequestBody SelectDto dto){
return service.getMaTypeDataById(dto);
}
@ApiOperation(value = "数据字典下拉选") @ApiOperation(value = "数据字典下拉选")
@PostMapping("getDictByPidCbx") @PostMapping("getDictByPidCbx")
public AjaxResult getDictByPidCbx(@RequestBody SelectDto dto){ public AjaxResult getDictByPidCbx(@RequestBody SelectDto dto){

View File

@ -197,4 +197,11 @@ public interface SelectMapper {
* @return List<SelectVo> * @return List<SelectVo>
*/ */
List<SelectVo> getLevelTwoUnitData(SelectDto dto); List<SelectVo> getLevelTwoUnitData(SelectDto dto);
/**
* 机具类型下拉选
* @param dto
* @return
*/
List<SelectVo> getMaTypeDataById(SelectDto dto);
} }

View File

@ -182,4 +182,11 @@ public interface SelectService {
* @return AjaxResult * @return AjaxResult
*/ */
AjaxResult getLevelTwoUnitData(SelectDto dto); AjaxResult getLevelTwoUnitData(SelectDto dto);
/**
* 机具类型下拉选 根据三级查四级
* @param dto
* @return
*/
AjaxResult getMaTypeDataById(SelectDto dto);
} }

View File

@ -74,6 +74,18 @@ public class SelectServiceImpl implements SelectService {
return AjaxResult.success(list); return AjaxResult.success(list);
} }
@Override
public AjaxResult getMaTypeDataById(SelectDto dto) {
List<SelectVo> list = new ArrayList<>();
try {
list = mapper.getMaTypeDataById(dto);
} catch (Exception e) {
log.error("机具类型-查询失败", e);
}
return AjaxResult.success(list);
}
@Override @Override
public AjaxResult getDictByPidCbx(SelectDto dto) { public AjaxResult getDictByPidCbx(SelectDto dto) {
List<SelectVo> list = new ArrayList<>(); List<SelectVo> list = new ArrayList<>();

View File

@ -168,7 +168,7 @@
<if test="facModel != null">fac_model = #{facModel},</if> <if test="facModel != null">fac_model = #{facModel},</if>
<if test="intelligentCode != null">intelligent_code = #{intelligentCode},</if> <if test="intelligentCode != null">intelligent_code = #{intelligentCode},</if>
<if test="isReplace != null">is_replace = #{isReplace},</if> <if test="isReplace != null">is_replace = #{isReplace},</if>
<if test="isStoage != null">is_storage = #{isStorage},</if> <if test="isStorage != null">is_storage = #{isStorage},</if>
</trim> </trim>
where type_id = #{typeId} where type_id = #{typeId}
</update> </update>

View File

@ -49,6 +49,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
FROM ma_type FROM ma_type
WHERE `level` = #{type} AND del_flag = '0' WHERE `level` = #{type} AND del_flag = '0'
</select> </select>
<select id="getMaTypeDataById" resultType="com.bonus.sgzb.material.domain.SelectVo">
SELECT type_id AS id,
type_name AS `name`
FROM ma_type
WHERE del_flag = '0'
AND parent_id = #{id}
</select>
<!--数据字典下拉选--> <!--数据字典下拉选-->
<select id="getDictByPidCbx" resultType="com.bonus.sgzb.material.domain.SelectVo"> <select id="getDictByPidCbx" resultType="com.bonus.sgzb.material.domain.SelectVo">
SELECT sd2.id,sd2.`name` SELECT sd2.id,sd2.`name`