lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcWorkshopInfoController.java
@@ -23,6 +23,7 @@ import org.jeecg.modules.mdc.service.IMdcWorkshopInfoService; import org.jeecg.modules.mdc.vo.MdcWorkshopEquipmentVo; import org.jeecg.modules.mdc.vo.WorkshopEquipmentVo; import org.jeecg.modules.system.entity.MdcProduction; import org.springframework.web.bind.annotation.*; import org.springframework.web.servlet.ModelAndView; @@ -292,4 +293,17 @@ } } /** * 查询车间 */ @AutoLog(value = "大屏车间信息-查询车间") @ApiOperation(value = "大屏车间信息-查询车间", notes = "大屏车间信息-查询车间") @GetMapping(value = "/getProductionList") public Result<List<MdcProduction>> getProductionList() { LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); String userId = user.getId(); List<MdcProduction> list = mdcWorkshopInfoService.productionListByUser(userId); return Result.OK(list); } } lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcWorkshopInfoMapper.java
@@ -5,6 +5,7 @@ import org.apache.ibatis.annotations.Param; import org.jeecg.modules.mdc.dto.MdcBigScreenEquipmentDto; import org.jeecg.modules.mdc.entity.MdcWorkshopInfo; import org.jeecg.modules.system.entity.MdcProduction; import java.util.List; @@ -31,4 +32,12 @@ * @return */ List<MdcWorkshopInfo> listByUser(@Param("userId") String userId); /** * 查询车间 * * @param userId * @return */ List<MdcProduction> productionListByUser(@Param("userId") String userId); } lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcWorkshopInfoMapper.xml
@@ -38,4 +38,15 @@ WHERE t5.user_id = #{ userId } </select> <select id="productionListByUser" resultType="org.jeecg.modules.system.entity.MdcProduction"> SELECT t1.* FROM mdc_production t1 LEFT JOIN mdc_user_production t2 ON t1.id = t2.pro_id WHERE t1.org_type = 2 AND t2.user_id = #{userId} ORDER BY t1.production_name </select> </mapper> lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcWorkshopInfoService.java
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService; import org.jeecg.modules.mdc.dto.MdcBigScreenEquipmentDto; import org.jeecg.modules.mdc.entity.MdcWorkshopInfo; import org.jeecg.modules.system.entity.MdcProduction; import java.util.List; @@ -22,8 +23,17 @@ /** * 车间大屏列表 * * @param userId * @return */ List<MdcWorkshopInfo> listByUser(String userId); /** * 查询车间 * * @param userId * @return */ List<MdcProduction> productionListByUser(String userId); } lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcWorkshopInfoServiceImpl.java
@@ -6,6 +6,7 @@ import org.jeecg.modules.mdc.entity.MdcWorkshopInfo; import org.jeecg.modules.mdc.mapper.MdcWorkshopInfoMapper; import org.jeecg.modules.mdc.service.IMdcWorkshopInfoService; import org.jeecg.modules.system.entity.MdcProduction; import org.springframework.stereotype.Service; import java.util.List; @@ -38,4 +39,14 @@ public List<MdcWorkshopInfo> listByUser(String userId) { return this.baseMapper.listByUser(userId); } /** * 查询车间 * @param userId * @return */ @Override public List<MdcProduction> productionListByUser(String userId) { return this.baseMapper.productionListByUser(userId); } }