代码规范化

This commit is contained in:
redamancy-qian
2022-04-16 13:57:26 +08:00
parent 00d9340825
commit 36afa809c4
28 changed files with 60 additions and 56 deletions

View File

@@ -65,7 +65,7 @@ spring:
# 数据库索引 # 数据库索引
database: 0 database: 0
# 密码 # 密码
password: wumei-smart # password: wumei-smart
# password: 123456 # password: 123456
# 连接超时时间 # 连接超时时间
timeout: 10s timeout: 10s

View File

@@ -54,7 +54,7 @@ public class CategoryController extends BaseController
{ {
list = categoryService.selectCategoryList(category); list = categoryService.selectCategoryList(category);
}else { }else {
list = categoryService.selectCategoryList1(category); list = categoryService.selectCategoryListAccurate(category);
} }
return getDataTable(list); return getDataTable(list);
@@ -73,7 +73,7 @@ public class CategoryController extends BaseController
{ {
list = categoryService.selectCategoryShortList(); list = categoryService.selectCategoryShortList();
}else { }else {
list = categoryService.selectCategoryShortList1(category); list = categoryService.selectCategoryShortListAccurate(category);
} }
return AjaxResult.success(list); return AjaxResult.success(list);
} }

View File

@@ -48,11 +48,9 @@ public class DeviceController extends BaseController
if(device.getUserName()==null || device.getUserName()=="" ) if(device.getUserName()==null || device.getUserName()=="" )
{ {
list = deviceService.selectDeviceList(device); list = deviceService.selectDeviceList(device);
System.out.print("进入模糊查询");
}else { }else {
// 精确查询 // 精确查询
System.out.print("进入精准查询"+device.getUserName()); list = deviceService.selectDeviceListAccurate(device);
list = deviceService.selectDeviceList1(device);
} }
return getDataTable(list); return getDataTable(list);
} }
@@ -72,7 +70,7 @@ public class DeviceController extends BaseController
list = deviceService.selectDeviceShortList(device); list = deviceService.selectDeviceShortList(device);
}else { }else {
// 精确查询 // 精确查询
list = deviceService.selectDeviceShortList1(device); list = deviceService.selectDeviceShortListAccurate(device);
} }
return getDataTable(list); return getDataTable(list);
} }
@@ -85,7 +83,13 @@ public class DeviceController extends BaseController
@ApiOperation("查询所有设备简短列表") @ApiOperation("查询所有设备简短列表")
public TableDataInfo allShortList(Device device) public TableDataInfo allShortList(Device device)
{ {
List<DeviceAllShortOutput> list = deviceService.selectAllDeviceShortList1(device.getUserName()); List<DeviceAllShortOutput> list = new ArrayList<>();
if(device.getUserName()==null || device.getUserName() == "")
{
list = deviceService.selectAllDeviceShortList();
}else {
list = deviceService.selectAllDeviceShortListAccurate(device.getUserName());
}
return getDataTable(list); return getDataTable(list);
} }

View File

@@ -58,7 +58,7 @@ public class GroupController extends BaseController
}else { }else {
// 精准查询 // 精准查询
list = groupService.selectGroupList1(group); list = groupService.selectGroupListAccurate(group);
} }
return getDataTable(list); return getDataTable(list);
} }

View File

@@ -48,7 +48,7 @@ public class ProductController extends BaseController
{ {
list = productService.selectProductList(product); list = productService.selectProductList(product);
}else { }else {
list = productService.selectProductList1(product); list = productService.selectProductListAccurate(product);
} }
return getDataTable(list); return getDataTable(list);
} }

View File

@@ -53,7 +53,7 @@ public class ThingsModelTemplateController extends BaseController
list = thingsModelTemplateService.selectThingsModelTemplateList(thingsModelTemplate); list = thingsModelTemplateService.selectThingsModelTemplateList(thingsModelTemplate);
}else{ }else{
// 精准查询 // 精准查询
list = thingsModelTemplateService.selectThingsModelTemplateList1(thingsModelTemplate); list = thingsModelTemplateService.selectThingsModelTemplateListAccurate(thingsModelTemplate);
} }
return getDataTable(list); return getDataTable(list);
} }

View File

@@ -78,7 +78,7 @@ public interface CategoryMapper
*/ */
public int productCountInCategorys(Long[] categoryIds); public int productCountInCategorys(Long[] categoryIds);
// 精准查询 // 精准查询
List<Category> selectCategoryList1(Category category); List<Category> selectCategoryListAccurate(Category category);
List<IdAndName> selectCategoryShortList1(Category category); List<IdAndName> selectCategoryShortListAccurate(Category category);
} }

View File

@@ -162,9 +162,9 @@ public interface DeviceMapper
*/ */
public int deleteDeviceGroupByDeviceIds(Long[] deviceIds); public int deleteDeviceGroupByDeviceIds(Long[] deviceIds);
// 查询所有简短设备列表 // 查询所有简短设备列表
List<DeviceAllShortOutput> selectAllDeviceShortList1(String userName); List<DeviceAllShortOutput> selectAllDeviceShortListAccurate(String userName);
//精准查询 //精准查询
List<Device> selectDeviceList1(Device device); List<Device> selectDeviceListAccurate(Device device);
List<DeviceShortOutput> selectDeviceShortList1(Device device); List<DeviceShortOutput> selectDeviceShortListAccurate(Device device);
} }

View File

@@ -85,5 +85,5 @@ public interface GroupMapper
public int deleteDeviceGroupByGroupIds(Long[] groupIds); public int deleteDeviceGroupByGroupIds(Long[] groupIds);
// 精准查询所有 // 精准查询所有
List<Group> selectGroupList1(Group group); List<Group> selectGroupListAccurate(Group group);
} }

View File

@@ -117,5 +117,5 @@ public interface ProductMapper
*/ */
public int thingsCountInProduct(Long productId); public int thingsCountInProduct(Long productId);
// 精准查询 // 精准查询
List<Product> selectProductList1(Product product); List<Product> selectProductListAccurate(Product product);
} }

View File

@@ -69,5 +69,5 @@ public interface ThingsModelTemplateMapper
*/ */
public int deleteThingsModelTemplateByTemplateIds(Long[] templateIds); public int deleteThingsModelTemplateByTemplateIds(Long[] templateIds);
// 精准查询 // 精准查询
List<ThingsModelTemplate> selectThingsModelTemplateList1(ThingsModelTemplate thingsModelTemplate); List<ThingsModelTemplate> selectThingsModelTemplateListAccurate(ThingsModelTemplate thingsModelTemplate);
} }

View File

@@ -70,7 +70,7 @@ public interface ICategoryService
public int deleteCategoryByCategoryId(Long categoryId); public int deleteCategoryByCategoryId(Long categoryId);
// 精准查询 // 精准查询
List<Category> selectCategoryList1(Category category); List<Category> selectCategoryListAccurate(Category category);
List<IdAndName> selectCategoryShortList1(Category category); List<IdAndName> selectCategoryShortListAccurate(Category category);
} }

View File

@@ -153,11 +153,11 @@ public interface IDeviceService
public String generationDeviceNum(); public String generationDeviceNum();
// 获取所有简短设备列表 // 获取所有简短设备列表
List<DeviceAllShortOutput> selectAllDeviceShortList1(String userName); List<DeviceAllShortOutput> selectAllDeviceShortListAccurate(String userName);
// 精准查询 // 精准查询
List<Device> selectDeviceList1(Device device); List<Device> selectDeviceListAccurate(Device device);
// 精准查询所有条件设备的简短信息 // 精准查询所有条件设备的简短信息
List<DeviceShortOutput> selectDeviceShortList1(Device device); List<DeviceShortOutput> selectDeviceShortListAccurate(Device device);
} }

View File

@@ -75,5 +75,5 @@ public interface IGroupService
public int deleteGroupByGroupId(Long groupId); public int deleteGroupByGroupId(Long groupId);
// 精准查询 // 精准查询
List<Group> selectGroupList1(Group group); List<Group> selectGroupListAccurate(Group group);
} }

View File

@@ -79,5 +79,5 @@ public interface IProductService
public int deleteProductByProductId(Long productId); public int deleteProductByProductId(Long productId);
// 精准查询 // 精准查询
List<Product> selectProductList1(Product product); List<Product> selectProductListAccurate(Product product);
} }

View File

@@ -60,5 +60,5 @@ public interface IThingsModelTemplateService
public int deleteThingsModelTemplateByTemplateId(Long templateId); public int deleteThingsModelTemplateByTemplateId(Long templateId);
// 精准查询 // 精准查询
List<ThingsModelTemplate> selectThingsModelTemplateList1(ThingsModelTemplate thingsModelTemplate); List<ThingsModelTemplate> selectThingsModelTemplateListAccurate(ThingsModelTemplate thingsModelTemplate);
} }

View File

@@ -98,8 +98,8 @@ public class CategoryServiceImpl implements ICategoryService
} }
@Override @Override
public List<IdAndName> selectCategoryShortList1(Category category) { public List<IdAndName> selectCategoryShortListAccurate(Category category) {
return categoryMapper.selectCategoryShortList1(category); return categoryMapper.selectCategoryShortListAccurate(category);
} }
/** /**
@@ -134,7 +134,7 @@ public class CategoryServiceImpl implements ICategoryService
} }
@Override @Override
public List<Category> selectCategoryList1(Category category) { public List<Category> selectCategoryListAccurate(Category category) {
return categoryMapper.selectCategoryList1(category); return categoryMapper.selectCategoryListAccurate(category);
} }
} }

View File

@@ -252,8 +252,8 @@ public class DeviceServiceImpl implements IDeviceService {
// 精准查询所有条件的设备 // 精准查询所有条件的设备
@Override @Override
public List<DeviceShortOutput> selectDeviceShortList1(Device device) { public List<DeviceShortOutput> selectDeviceShortListAccurate(Device device) {
return deviceMapper.selectDeviceShortList1(device); return deviceMapper.selectDeviceShortListAccurate(device);
} }
/** /**
@@ -541,13 +541,13 @@ public class DeviceServiceImpl implements IDeviceService {
} }
@Override @Override
public List<DeviceAllShortOutput> selectAllDeviceShortList1(String userName) { public List<DeviceAllShortOutput> selectAllDeviceShortListAccurate(String userName) {
return deviceMapper.selectAllDeviceShortList1(userName); return deviceMapper.selectAllDeviceShortListAccurate(userName);
} }
// 精准查询 // 精准查询
@Override @Override
public List<Device> selectDeviceList1(Device device) { public List<Device> selectDeviceListAccurate(Device device) {
return deviceMapper.selectDeviceList1(device); return deviceMapper.selectDeviceListAccurate(device);
} }

View File

@@ -142,7 +142,7 @@ public class GroupServiceImpl implements IGroupService
// 精准查询所有 // 精准查询所有
@Override @Override
public List<Group> selectGroupList1(Group group) { public List<Group> selectGroupListAccurate(Group group) {
return groupMapper.selectGroupList1(group); return groupMapper.selectGroupListAccurate(group);
} }
} }

View File

@@ -196,7 +196,7 @@ public class ProductServiceImpl implements IProductService
} }
// 精准查询 // 精准查询
@Override @Override
public List<Product> selectProductList1(Product product) { public List<Product> selectProductListAccurate(Product product) {
return productMapper.selectProductList1(product); return productMapper.selectProductListAccurate(product);
} }
} }

View File

@@ -110,7 +110,7 @@ public class ThingsModelTemplateServiceImpl implements IThingsModelTemplateServi
} }
// 精准查询 // 精准查询
@Override @Override
public List<ThingsModelTemplate> selectThingsModelTemplateList1(ThingsModelTemplate thingsModelTemplate) { public List<ThingsModelTemplate> selectThingsModelTemplateListAccurate(ThingsModelTemplate thingsModelTemplate) {
return thingsModelTemplateMapper.selectThingsModelTemplateList1(thingsModelTemplate); return thingsModelTemplateMapper.selectThingsModelTemplateListAccurate(thingsModelTemplate);
} }
} }

View File

@@ -34,7 +34,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where> </where>
order by order_num order by order_num
</select> </select>
<select id="selectCategoryList1" parameterType="com.ruoyi.iot.domain.Category" resultMap="CategoryResult"> <select id="selectCategoryListAccurate" parameterType="com.ruoyi.iot.domain.Category" resultMap="CategoryResult">
<include refid="selectCategoryVo"/> <include refid="selectCategoryVo"/>
<where> <where>
<if test="categoryName != null and categoryName != ''"> and category_name = #{categoryName}</if> <if test="categoryName != null and categoryName != ''"> and category_name = #{categoryName}</if>
@@ -48,7 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from iot_category from iot_category
order by order_num order by order_num
</select> </select>
<select id="selectCategoryShortList1" resultMap="CategoryShortResult"> <select id="selectCategoryShortListAccurate" resultMap="CategoryShortResult">
select category_id, category_name select category_id, category_name
from iot_category from iot_category
<where> <where>

View File

@@ -105,7 +105,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select device_id, device_name,product_id, serial_number, status,is_shadow ,is_custom_location,things_model_value, active_time from iot_device select device_id, device_name,product_id, serial_number, status,is_shadow ,is_custom_location,things_model_value, active_time from iot_device
</sql> </sql>
<select id="selectAllDeviceShortList1" parameterType="com.ruoyi.iot.domain.Device" resultMap="DeviceAllShortResult"> <select id="selectAllDeviceShortListAccurate" parameterType="com.ruoyi.iot.domain.Device" resultMap="DeviceAllShortResult">
select device_id, device_name, product_name, user_name, serial_number, firmware_version, status,rssi,is_shadow , select device_id, device_name, product_name, user_name, serial_number, firmware_version, status,rssi,is_shadow ,
is_custom_location, active_time,network_address,longitude,latitude from iot_device is_custom_location, active_time,network_address,longitude,latitude from iot_device
<where> <where>
@@ -129,7 +129,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where> </where>
order by create_time desc order by create_time desc
</select> </select>
<select id="selectDeviceList1" parameterType="com.ruoyi.iot.domain.Device" resultMap="DeviceResult"> <select id="selectDeviceListAccurate" parameterType="com.ruoyi.iot.domain.Device" resultMap="DeviceResult">
<include refid="selectDeviceVo"/> <include refid="selectDeviceVo"/>
<where> <where>
<if test="deviceName != null and deviceName != ''"> and device_name = #{deviceName}</if> <if test="deviceName != null and deviceName != ''"> and device_name = #{deviceName}</if>
@@ -176,7 +176,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where> </where>
order by create_time desc order by create_time desc
</select> </select>
<select id="selectDeviceShortList1" parameterType="com.ruoyi.iot.domain.Device" resultMap="DeviceShortResult"> <select id="selectDeviceShortListAccurate" parameterType="com.ruoyi.iot.domain.Device" resultMap="DeviceShortResult">
<include refid="selectDeviceShortVo"/> <include refid="selectDeviceShortVo"/>
<where> <where>
<if test="deviceName != null and deviceName != ''"> and device_name = #{deviceName}</if> <if test="deviceName != null and deviceName != ''"> and device_name = #{deviceName}</if>

View File

@@ -31,7 +31,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where> </where>
order by group_order order by group_order
</select> </select>
<select id="selectGroupList1" parameterType="com.ruoyi.iot.domain.Group" resultMap="GroupResult"> <select id="selectGroupListAccurate" parameterType="com.ruoyi.iot.domain.Group" resultMap="GroupResult">
<include refid="selectGroupVo"/> <include refid="selectGroupVo"/>
<where> <where>
<if test="groupName != null and groupName != ''"> and group_name = #{groupName}</if> <if test="groupName != null and groupName != ''"> and group_name = #{groupName}</if>

View File

@@ -51,7 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where> </where>
order by create_time desc order by create_time desc
</select> </select>
<select id="selectProductList1" parameterType="com.ruoyi.iot.domain.Product" resultMap="ProductResult"> <select id="selectProductListAccurate" parameterType="com.ruoyi.iot.domain.Product" resultMap="ProductResult">
<include refid="selectProductVo"/> <include refid="selectProductVo"/>
<where> <where>
<if test="productName != null and productName != ''"> and product_name=#{productName}</if> <if test="productName != null and productName != ''"> and product_name=#{productName}</if>

View File

@@ -34,7 +34,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where> </where>
order by create_time desc order by create_time desc
</select> </select>
<select id="selectThingsModelTemplateList1" parameterType="com.ruoyi.iot.domain.ThingsModelTemplate" resultMap="ThingsModelTemplateResult"> <select id="selectThingsModelTemplateListAccurate" parameterType="com.ruoyi.iot.domain.ThingsModelTemplate" resultMap="ThingsModelTemplateResult">
<include refid="selectThingsModelTemplateVo"/> <include refid="selectThingsModelTemplateVo"/>
<where> <where>
<if test="templateName != null and templateName != ''"> and template_name = #{templateName}</if> <if test="templateName != null and templateName != ''"> and template_name = #{templateName}</if>

View File

@@ -96,9 +96,9 @@ export default {
getList() { getList() {
this.loading = true; this.loading = true;
// 判断是否是admin角色 // 判断是否是admin角色
if (this.$store.state.user.roles.indexOf("admin") === -1){ if (this.$store.state.user.roles.indexOf("admin") === -1){
this.queryParams.tenantName = this.$store.state.user.name this.queryParams.tenantName = this.$store.state.user.name
} }
listProduct(this.queryParams).then(response => { listProduct(this.queryParams).then(response => {
this.productList = response.rows; this.productList = response.rows;
this.total = response.total; this.total = response.total;