提交 0d859e2f 作者: 张小凤

new model and bind (add)

上级 34e024d8
...@@ -50,6 +50,18 @@ public class WebDeviceController { ...@@ -50,6 +50,18 @@ public class WebDeviceController {
return webDeviceService.model(); return webDeviceService.model();
} }
@ApiOperation("设备品牌")
@GetMapping("/deviceBrand")
public ResultBody<BrandDTO> deviceBrand() {
return webDeviceService.deviceBrand();
}
@ApiOperation("设备型号")
@GetMapping("/deviceModel")
public ResultBody<ModelDTO> deviceModel() {
return webDeviceService.deviceModel();
}
@ApiOperation(value = "设备详情") @ApiOperation(value = "设备详情")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("/detail") @GetMapping("/detail")
......
...@@ -20,8 +20,12 @@ public interface WebDeviceDao { ...@@ -20,8 +20,12 @@ public interface WebDeviceDao {
List<Brand> brand(); List<Brand> brand();
List<Brand> deviceBrand();
List<Model> model(); List<Model> model();
List<Model> deviceModel();
List<DeviceListDO> deviceList( List<DeviceListDO> deviceList(
Integer districtId, Integer categoryId, Integer brandId, Integer modelId); Integer districtId, Integer categoryId, Integer brandId, Integer modelId);
......
...@@ -62,6 +62,19 @@ public class WebDeviceServiceImpl implements WebDeviceService { ...@@ -62,6 +62,19 @@ public class WebDeviceServiceImpl implements WebDeviceService {
} }
@Override @Override
public ResultBody deviceBrand() {
List<Brand> brand = webDeviceDao.deviceBrand();
List<BrandDTO> collect =
brand.stream()
.map(
t -> {
return t.brandDTO();
})
.collect(Collectors.toList());
return ResultBody.success(collect);
}
@Override
public ResultBody model() { public ResultBody model() {
List<Model> model = webDeviceDao.model(); List<Model> model = webDeviceDao.model();
List<ModelDTO> collect = List<ModelDTO> collect =
...@@ -75,6 +88,19 @@ public class WebDeviceServiceImpl implements WebDeviceService { ...@@ -75,6 +88,19 @@ public class WebDeviceServiceImpl implements WebDeviceService {
} }
@Override @Override
public ResultBody deviceModel() {
List<Model> model = webDeviceDao.deviceModel();
List<ModelDTO> collect =
model.stream()
.map(
t -> {
return t.modelDTO();
})
.collect(Collectors.toList());
return ResultBody.success(collect);
}
@Override
public ResultBody deviceList( public ResultBody deviceList(
Integer districtId, Integer categoryId, Integer brandId, Integer modelId) { Integer districtId, Integer categoryId, Integer brandId, Integer modelId) {
List<DeviceListDO> deviceList = List<DeviceListDO> deviceList =
......
...@@ -17,8 +17,12 @@ public interface WebDeviceService { ...@@ -17,8 +17,12 @@ public interface WebDeviceService {
ResultBody brand(); ResultBody brand();
ResultBody deviceBrand();
ResultBody model(); ResultBody model();
ResultBody deviceModel();
ResultBody deviceList(Integer districtId, Integer categoryId, Integer brandId, Integer modelId); ResultBody deviceList(Integer districtId, Integer categoryId, Integer brandId, Integer modelId);
ResultBody update(LeaseVo param); ResultBody update(LeaseVo param);
......
...@@ -79,11 +79,21 @@ ...@@ -79,11 +79,21 @@
from brand; from brand;
</select> </select>
<select id="deviceBrand" resultType="com.mmc.pms.entity.Brand">
select id, `name`
from device_brand;
</select>
<select id="model" resultType="com.mmc.pms.entity.Model"> <select id="model" resultType="com.mmc.pms.entity.Model">
select id, `name` select id, `name`
from model; from model;
</select> </select>
<select id="deviceModel" resultType="com.mmc.pms.entity.Model">
select id, `name`
from device_model;
</select>
<select id="deviceList" resultType="com.mmc.pms.entity.DeviceListDO"> <select id="deviceList" resultType="com.mmc.pms.entity.DeviceListDO">
SELECT d.id, SELECT d.id,
d.`name` AS deviceName, d.`name` AS deviceName,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论