增加设备信息模型中的类型等级字段,并更新相关查询

This commit is contained in:
syruan 2025-09-16 19:43:28 +08:00
parent dcc6e79df1
commit d5282ab3f8
5 changed files with 21 additions and 11 deletions

View File

@ -382,4 +382,7 @@ public class DevInfo extends BaseEntity {
@ApiModelProperty(value = "检验有效状态") @ApiModelProperty(value = "检验有效状态")
private String verifyStatus; private String verifyStatus;
@ApiModelProperty(value = "类型等级 存入字符串")
private String levelType;
} }

View File

@ -183,4 +183,5 @@ public class DevInfoVo extends DevInfo {
@ApiModelProperty(value = "设备类型级别") @ApiModelProperty(value = "设备类型级别")
private Integer typeLevel; private Integer typeLevel;
} }

View File

@ -356,6 +356,7 @@ public class DevInfoServiceImpl implements DevInfoService {
bmFileInfo.setFileType(0L); bmFileInfo.setFileType(0L);
List<BmFileInfo> mainFileInfoList = bmFileInfoMapper.selectBmFileInfoList(bmFileInfo); List<BmFileInfo> mainFileInfoList = bmFileInfoMapper.selectBmFileInfoList(bmFileInfo);
if (!CollectionUtils.isEmpty(mainFileInfoList)) { if (!CollectionUtils.isEmpty(mainFileInfoList)) {
devInfoVo.setMainFileList(mainFileInfoList);
devInfoVo.setPicUrl(mainFileInfoList.get(0).getFileUrl()); devInfoVo.setPicUrl(mainFileInfoList.get(0).getFileUrl());
} }
} }
@ -408,18 +409,15 @@ public class DevInfoServiceImpl implements DevInfoService {
return AjaxResult.error("详情页展示图不能为空"); return AjaxResult.error("详情页展示图不能为空");
} }
} }
String code = "";
for (int i = 0; i < devInfo.getTableList().size(); i++) { for (int i = 0; i < devInfo.getTableList().size(); i++) {
//获取用户信息 //获取用户信息
Long userId = SecurityUtils.getLoginUser().getUserid(); Long userId = SecurityUtils.getLoginUser().getUserid();
//保存用户信息 //保存用户信息
devInfo.setCreator(userId) devInfo.setCreator(userId).setOwnId(userId);
/*.setMaStatus(ON_HIRE.getCode())*/ // if (org.apache.commons.lang3.StringUtils.isBlank(code)) {
.setOwnId(userId); // code = getString();
if (org.apache.commons.lang3.StringUtils.isBlank(code)) { // }
code = getString(); // devInfo.setCode(code);
}
devInfo.setCode(code);
devInfo.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId().toString()); devInfo.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId().toString());
devInfo.setDeviceCount(devInfo.getDeviceCount()); devInfo.setDeviceCount(devInfo.getDeviceCount());
devInfo.setIdentifyCode(devInfo.getTableList().get(i).getIdentifyCode()); devInfo.setIdentifyCode(devInfo.getTableList().get(i).getIdentifyCode());
@ -428,7 +426,6 @@ public class DevInfoServiceImpl implements DevInfoService {
return AjaxResult.error("设备信息SQL保存失败请修改后重试"); return AjaxResult.error("设备信息SQL保存失败请修改后重试");
} }
devInfoMapper.updateTypeLeasePrice(devInfo); devInfoMapper.updateTypeLeasePrice(devInfo);
code = "";
//保存自定义属性值 //保存自定义属性值
if (!CollectionUtils.isEmpty(devInfo.getDevInfoProperties())) { if (!CollectionUtils.isEmpty(devInfo.getDevInfoProperties())) {
devInfoMapper.insertDevInfoProperties(devInfo.getMaId(), devInfo.getDevInfoProperties()); devInfoMapper.insertDevInfoProperties(devInfo.getMaId(), devInfo.getDevInfoProperties());

View File

@ -45,7 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectDevInfoVo"> <sql id="selectDevInfoVo">
select ma_id, device_name, device_weight, device_count, code, identify_code, type_id, ma_status, lease_scope, location, province_id, city_id, area_id, brand, model_name, production_date, working_hours, serial_number, select ma_id, device_name, device_weight, device_count, code, identify_code, type_id, ma_status, lease_scope, location, province_id, city_id, area_id, brand, model_name, production_date, working_hours, serial_number,
pic_url, js_month_price, js_day_price, description, gps_code, own_co, create_time, pic_url, js_month_price, js_day_price, description, gps_code, own_co, create_time, level_type,
creator, update_time, person, person_phone, update_by, specification, deposit, is_operator, is_active, update_time, update_by creator, update_time, person, person_phone, update_by, specification, deposit, is_operator, is_active, update_time, update_by
from ma_dev_info from ma_dev_info
</sql> </sql>
@ -73,6 +73,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
d.create_time as createTime, d.create_time as createTime,
d.update_time as updateTime, d.update_time as updateTime,
d.own_co as companyId, d.own_co as companyId,
d.purchaseSource,
d.assetValue,
d.profession,
d.main_process AS mainProcess,
d.sub_process as subProcess,
d.level_type as levelType,
sd.dept_name as companyName, sd.dept_name as companyName,
c.operate_address as operateAddress, c.operate_address as operateAddress,
mt3.type_id as thirdId, mt3.type_id as thirdId,
@ -266,6 +272,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
d.profession as profession, d.profession as profession,
d.main_process as mainProcess, d.main_process as mainProcess,
d.sub_process as subProcess, d.sub_process as subProcess,
d.level_type as levelType,
mt4.level as typeLevel, mt4.level as typeLevel,
CASE CASE
WHEN check_date IS NULL THEN '未设置检验日期' WHEN check_date IS NULL THEN '未设置检验日期'
@ -319,6 +326,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="companyId != null and companyId != ''">own_co,</if> <if test="companyId != null and companyId != ''">own_co,</if>
<if test="person != null and person != ''">person,</if> <if test="person != null and person != ''">person,</if>
<if test="personPhone != null and personPhone != ''">person_phone,</if> <if test="personPhone != null and personPhone != ''">person_phone,</if>
<if test="levelType != null and levelType != ''">level_type</if>
<if test="assetValue != null and assetValue != ''">assetValue,</if> <if test="assetValue != null and assetValue != ''">assetValue,</if>
<if test="purchaseSource != null and purchaseSource != ''">purchaseSource,</if> <if test="purchaseSource != null and purchaseSource != ''">purchaseSource,</if>
create_time, create_time,
@ -366,6 +374,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="companyId != null and companyId != ''">#{companyId},</if> <if test="companyId != null and companyId != ''">#{companyId},</if>
<if test="person != null and person != ''">#{person},</if> <if test="person != null and person != ''">#{person},</if>
<if test="personPhone != null and personPhone != ''">#{personPhone},</if> <if test="personPhone != null and personPhone != ''">#{personPhone},</if>
<if test="levelType != null and levelType != ''">#{levelType}</if>
<if test="assetValue != null and assetValue != ''">#{assetValue},</if> <if test="assetValue != null and assetValue != ''">#{assetValue},</if>
<if test="purchaseSource != null and purchaseSource != ''">#{purchaseSource},</if> <if test="purchaseSource != null and purchaseSource != ''">#{purchaseSource},</if>
now(), now(),

View File

@ -172,7 +172,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND moi.code = #{code} AND moi.code = #{code}
</if> </if>
<if test="maId != null and maId != ''"> <if test="maId != null and maId != ''">
AND moi.maId = #{maId} AND moi.ma_id = #{maId}
</if> </if>
<if test="startTime != null and endTime != null "> <if test="startTime != null and endTime != null ">
AND ((hh.rent_begin_time BETWEEN #{startTime} AND #{endTime}) AND ((hh.rent_begin_time BETWEEN #{startTime} AND #{endTime})