型号图片

This commit is contained in:
邱贞招 2024-12-30 17:02:38 +08:00
parent cc11bdac13
commit 5ef6cdb92c
17 changed files with 586 additions and 44 deletions

View File

@ -19,6 +19,7 @@ import com.ruoyi.system.domain.EtArticle;
import com.ruoyi.system.domain.EFunction;
import com.ruoyi.system.domain.device.EDeviceVO;
import com.ruoyi.e.order.domain.order.EOrderQuery;
import com.ruoyi.system.domain.modelPic.EModelPic;
import com.ruoyi.system.domain.rule.EFeeRule;
import com.ruoyi.system.domain.vo.PriceVO;
import com.ruoyi.system.service.*;
@ -76,6 +77,9 @@ public class AppController extends BaseController
@Autowired
private IEHardwareVersionService hardwareVersionService;
@Autowired
private IEModelPicService eModelPicService;
/**
* 验证码登录
@ -398,4 +402,14 @@ public class AppController extends BaseController
return success(asDevices);
}
/**
* 查询车辆型号图片列表
*/
@GetMapping("/modelPic/list")
public AjaxResult list(EModelPic eModelPic)
{
List<EModelPic> list = eModelPicService.selectEModelPicList(eModelPic);
return success(list);
}
}

View File

@ -17,7 +17,6 @@ import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.ServiceUtil;
import com.ruoyi.common.utils.verify.vo.IDResponse;
import com.ruoyi.common.utils.wx.vo.PrepayResponseVO;
import com.ruoyi.e.order.domain.order.EOrder;
@ -57,8 +56,6 @@ import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import static com.ruoyi.common.constant.ServiceConstants.USER_TYPE_INDIVIDUAL;
import static com.ruoyi.common.constant.ServiceConstants.USER_TYPE_MERCHANT;
/**
* app接口需要登录校验的

View File

@ -185,9 +185,9 @@ public class ReceiveController {
EModel model = etModelService.selectEModelByModelId(device.getModelId());
Integer remainingMileage = 0;
if(StrUtil.isNotBlank(device.getVoltage())){
remainingMileage = CommonUtil.getRemainingMileage(device.getVoltage(), model.getFullVoltage(), model.getLowVoltage(), model.getFullEndurance());
remainingMileage = CommonUtil.getRemainingMileage(device.getVoltage(), device.getFullVoltage(), device.getLowVoltage(), device.getFullEndurance());
}
Integer electricQuantity = CommonUtil.getElectricQuantity(device.getVoltage(), model.getFullVoltage(), model.getLowVoltage());//电量百分百
Integer electricQuantity = CommonUtil.getElectricQuantity(device.getVoltage(), device.getFullVoltage(), device.getLowVoltage());//电量百分百
device.setRemainingMileage(remainingMileage);
device.setRemainingPower(electricQuantity.toString());
device.setLastTime(DateUtils.getNowDate());
@ -242,9 +242,9 @@ public class ReceiveController {
EModel model = etModelService.selectEModelByModelId(device.getModelId());
Integer remainingMileage = 0;
if(StrUtil.isNotBlank(device.getVoltage())){
remainingMileage = CommonUtil.getRemainingMileage(device.getVoltage(), model.getFullVoltage(), model.getLowVoltage(), model.getFullEndurance());
remainingMileage = CommonUtil.getRemainingMileage(device.getVoltage(), device.getFullVoltage(), device.getLowVoltage(), device.getFullEndurance());
}
Integer electricQuantity = CommonUtil.getElectricQuantity(device.getVoltage(), model.getFullVoltage(), model.getLowVoltage());//电量百分百
Integer electricQuantity = CommonUtil.getElectricQuantity(device.getVoltage(), device.getFullVoltage(), device.getLowVoltage());//电量百分百
device.setRemainingMileage(remainingMileage);
device.setRemainingPower(electricQuantity.toString());
device.setLastTime(DateUtils.getNowDate());

View File

@ -0,0 +1,105 @@
package com.ruoyi.web.controller.system;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.domain.modelPic.EModelPic;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.service.IEModelPicService;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 车辆型号图片Controller
*
* @author qzz
* @date 2024-12-30
*/
@RestController
@RequestMapping("/system/modelPic")
public class EModelPicController extends BaseController
{
@Autowired
private IEModelPicService eModelPicService;
/**
* 查询车辆型号图片列表
*/
@PreAuthorize("@ss.hasPermi('system:modelPic:list')")
@GetMapping("/list")
public TableDataInfo list(EModelPic eModelPic)
{
startPage();
List<EModelPic> list = eModelPicService.selectEModelPicList(eModelPic);
return getDataTable(list);
}
/**
* 导出车辆型号图片列表
*/
@PreAuthorize("@ss.hasPermi('system:modelPic:export')")
@Log(title = "车辆型号图片", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, EModelPic eModelPic)
{
List<EModelPic> list = eModelPicService.selectEModelPicList(eModelPic);
ExcelUtil<EModelPic> util = new ExcelUtil<EModelPic>(EModelPic.class);
util.exportExcel(response, list, "车辆型号图片数据");
}
/**
* 获取车辆型号图片详细信息
*/
@PreAuthorize("@ss.hasPermi('system:modelPic:query')")
@GetMapping(value = "/{modelId}")
public AjaxResult getInfo(@PathVariable("modelId") Long modelId)
{
return success(eModelPicService.selectEModelPicByModelId(modelId));
}
/**
* 新增车辆型号图片
*/
@PreAuthorize("@ss.hasPermi('system:modelPic:add')")
@Log(title = "车辆型号图片", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody EModelPic eModelPic)
{
return toAjax(eModelPicService.insertEModelPic(eModelPic));
}
/**
* 修改车辆型号图片
*/
@PreAuthorize("@ss.hasPermi('system:modelPic:edit')")
@Log(title = "车辆型号图片", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody EModelPic eModelPic)
{
return toAjax(eModelPicService.updateEModelPic(eModelPic));
}
/**
* 删除车辆型号图片
*/
@PreAuthorize("@ss.hasPermi('system:modelPic:remove')")
@Log(title = "车辆型号图片", businessType = BusinessType.DELETE)
@DeleteMapping("/{modelIds}")
public AjaxResult remove(@PathVariable Long[] modelIds)
{
return toAjax(eModelPicService.deleteEModelPicByModelIds(modelIds));
}
}

View File

@ -1,5 +1,6 @@
package com.ruoyi.common.utils;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
@ -108,6 +109,9 @@ public class CommonUtil {
* @author qzz
*/
public static Integer getRemainingMileage(String voltage,Double fullVoltage,Double lowVoltage,Integer fullEndurance) {
if(ObjectUtil.isNull(voltage) || voltage.isEmpty() || fullVoltage ==null || lowVoltage == null || fullEndurance == null){
return 0;
}
// 满电电压减去亏电电压 乘以 满电续航里程 除以 满电电压
log.info(" 电压--voltage:{},满电电压--fullVoltage:{},亏电电压--lowVoltage:{},满电续航--fullEndurance:{}",voltage,fullVoltage,lowVoltage,fullEndurance);
BigDecimal vol = new BigDecimal(voltage);
@ -137,6 +141,9 @@ public class CommonUtil {
* @author qzz
*/
public static Integer getElectricQuantity(String voltage,Double fullVoltage,Double lowVoltage) {
if(ObjectUtil.isNull(voltage) || voltage.isEmpty() || fullVoltage ==null || lowVoltage == null){
return 0;
}
// 满电电压减去亏电电压 乘以 满电续航里程 除以 满电电压
BigDecimal vol = new BigDecimal(voltage);
BigDecimal current = new BigDecimal(fullVoltage).subtract(vol);

View File

@ -204,4 +204,16 @@ public class EDevice extends BaseEntityPlus implements Serializable {
/** 是否默认展示设备0-否1-是 */
private String isDefault;
/** 满电电压 */
@Excel(name = "满电电压")
private Double fullVoltage;
/** 亏电电压 */
@Excel(name = "亏电电压")
private Double lowVoltage;
/** 满电续航 */
@Excel(name = "满电续航")
private Integer fullEndurance;
}

View File

@ -32,18 +32,18 @@ public class EModel extends BaseEntity
/** 品牌商 */
@Excel(name = "品牌商")
private String brandName;
//
// /** 满电电压 */
// @Excel(name = "满电电压")
// private Double fullVoltage;
/** 满电电压 */
@Excel(name = "满电电压")
private Double fullVoltage;
// /** 亏电电压 */
// @Excel(name = "电电压")
// private Double lowVoltage;
/** 亏电电压 */
@Excel(name = "亏电电压")
private Double lowVoltage;
/** 满电续航 */
@Excel(name = "满电续航")
private Integer fullEndurance;
// /** 满电续航 */
// @Excel(name = "满电续航")
// private Integer fullEndurance;
/** 简介 */
@Excel(name = "简介")

View File

@ -0,0 +1,96 @@
package com.ruoyi.system.domain.modelPic;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 车辆型号图片对象 e_model_pic
*
* @author qzz
* @date 2024-12-30
*/
public class EModelPic extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 型号id */
private Long modelId;
/** 车型 */
@Excel(name = "车型")
private String model;
/** 品牌商id */
@Excel(name = "品牌商id")
private Long brandId;
/** 品牌商 */
@Excel(name = "品牌商")
private String brandName;
/** 图片 */
@Excel(name = "图片")
private String picture;
public void setModelId(Long modelId)
{
this.modelId = modelId;
}
public Long getModelId()
{
return modelId;
}
public void setModel(String model)
{
this.model = model;
}
public String getModel()
{
return model;
}
public void setBrandId(Long brandId)
{
this.brandId = brandId;
}
public Long getBrandId()
{
return brandId;
}
public void setBrandName(String brandName)
{
this.brandName = brandName;
}
public String getBrandName()
{
return brandName;
}
public void setPicture(String picture)
{
this.picture = picture;
}
public String getPicture()
{
return picture;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("modelId", getModelId())
.append("model", getModel())
.append("brandId", getBrandId())
.append("brandName", getBrandName())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("remark", getRemark())
.append("picture", getPicture())
.toString();
}
}

View File

@ -0,0 +1,7 @@
package com.ruoyi.system.domain.modelPic;
import lombok.Data;
@Data
public class EModelPicQuery extends EModelPic{
}

View File

@ -0,0 +1,7 @@
package com.ruoyi.system.domain.modelPic;
import lombok.Data;
@Data
public class EModelPicVO extends EModelPic{
}

View File

@ -0,0 +1,62 @@
package com.ruoyi.system.mapper;
import com.ruoyi.system.domain.modelPic.EModelPic;
import java.util.List;
/**
* 车辆型号图片Mapper接口
*
* @author qzz
* @date 2024-12-30
*/
public interface EModelPicMapper
{
/**
* 查询车辆型号图片
*
* @param modelId 车辆型号图片主键
* @return 车辆型号图片
*/
public EModelPic selectEModelPicByModelId(Long modelId);
/**
* 查询车辆型号图片列表
*
* @param eModelPic 车辆型号图片
* @return 车辆型号图片集合
*/
public List<EModelPic> selectEModelPicList(EModelPic eModelPic);
/**
* 新增车辆型号图片
*
* @param eModelPic 车辆型号图片
* @return 结果
*/
public int insertEModelPic(EModelPic eModelPic);
/**
* 修改车辆型号图片
*
* @param eModelPic 车辆型号图片
* @return 结果
*/
public int updateEModelPic(EModelPic eModelPic);
/**
* 删除车辆型号图片
*
* @param modelId 车辆型号图片主键
* @return 结果
*/
public int deleteEModelPicByModelId(Long modelId);
/**
* 批量删除车辆型号图片
*
* @param modelIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteEModelPicByModelIds(Long[] modelIds);
}

View File

@ -0,0 +1,62 @@
package com.ruoyi.system.service;
import com.ruoyi.system.domain.modelPic.EModelPic;
import java.util.List;
/**
* 车辆型号图片Service接口
*
* @author qzz
* @date 2024-12-30
*/
public interface IEModelPicService
{
/**
* 查询车辆型号图片
*
* @param modelId 车辆型号图片主键
* @return 车辆型号图片
*/
public EModelPic selectEModelPicByModelId(Long modelId);
/**
* 查询车辆型号图片列表
*
* @param eModelPic 车辆型号图片
* @return 车辆型号图片集合
*/
public List<EModelPic> selectEModelPicList(EModelPic eModelPic);
/**
* 新增车辆型号图片
*
* @param eModelPic 车辆型号图片
* @return 结果
*/
public int insertEModelPic(EModelPic eModelPic);
/**
* 修改车辆型号图片
*
* @param eModelPic 车辆型号图片
* @return 结果
*/
public int updateEModelPic(EModelPic eModelPic);
/**
* 批量删除车辆型号图片
*
* @param modelIds 需要删除的车辆型号图片主键集合
* @return 结果
*/
public int deleteEModelPicByModelIds(Long[] modelIds);
/**
* 删除车辆型号图片信息
*
* @param modelId 车辆型号图片主键
* @return 结果
*/
public int deleteEModelPicByModelId(Long modelId);
}

View File

@ -247,7 +247,7 @@ public class EDeviceServiceImpl extends ServiceImpl<EDeviceMapper, EDevice> impl
EModelVO rlModelVO = modelService.selectEModelByModelId(device.getModelId());
if(ObjectUtil.isNotNull(rlModelVO)){
if(StrUtil.isNotBlank(device.getVoltage())){
device.setRemainingMileage(CommonUtil.getRemainingMileage(device.getVoltage(),rlModelVO.getFullVoltage(),rlModelVO.getLowVoltage(),rlModelVO.getFullEndurance()));
device.setRemainingMileage(CommonUtil.getRemainingMileage(device.getVoltage(),device.getFullVoltage(),device.getLowVoltage(),device.getFullEndurance()));
}
device.setModel(rlModelVO.getModel());
}
@ -573,9 +573,9 @@ public class EDeviceServiceImpl extends ServiceImpl<EDeviceMapper, EDevice> impl
if(ObjectUtil.isNotNull(model)){
Integer remainingMileage = 0;
if(StrUtil.isNotBlank(device.getVoltage())){
remainingMileage = CommonUtil.getRemainingMileage(device.getVoltage(), model.getFullVoltage(), model.getLowVoltage(), model.getFullEndurance());
remainingMileage = CommonUtil.getRemainingMileage(device.getVoltage(), device.getFullVoltage(), device.getLowVoltage(), device.getFullEndurance());
}
Integer electricQuantity = CommonUtil.getElectricQuantity(device.getVoltage(), model.getFullVoltage(), model.getLowVoltage());//电量百分百
Integer electricQuantity = CommonUtil.getElectricQuantity(device.getVoltage(), device.getFullVoltage(), device.getLowVoltage());//电量百分百
device.setRemainingMileage(remainingMileage);
device.setRemainingPower(electricQuantity.toString());
}
@ -605,9 +605,9 @@ public class EDeviceServiceImpl extends ServiceImpl<EDeviceMapper, EDevice> impl
if(ObjectUtil.isNotNull(model)){
Integer remainingMileage = 0;
if(StrUtil.isNotBlank(device.getVoltage())){
remainingMileage = CommonUtil.getRemainingMileage(device.getVoltage(), model.getFullVoltage(), model.getLowVoltage(), model.getFullEndurance());
remainingMileage = CommonUtil.getRemainingMileage(device.getVoltage(), device.getFullVoltage(), device.getLowVoltage(), device.getFullEndurance());
}
Integer electricQuantity = CommonUtil.getElectricQuantity(device.getVoltage(), model.getFullVoltage(), model.getLowVoltage());//电量百分百
Integer electricQuantity = CommonUtil.getElectricQuantity(device.getVoltage(), device.getFullVoltage(), device.getLowVoltage());//电量百分百
device.setRemainingMileage(remainingMileage);
device.setRemainingPower(electricQuantity.toString());
}

View File

@ -0,0 +1,95 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.modelPic.EModelPic;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.EModelPicMapper;
import com.ruoyi.system.service.IEModelPicService;
/**
* 车辆型号图片Service业务层处理
*
* @author qzz
* @date 2024-12-30
*/
@Service
public class EModelPicServiceImpl implements IEModelPicService
{
@Autowired
private EModelPicMapper eModelPicMapper;
/**
* 查询车辆型号图片
*
* @param modelId 车辆型号图片主键
* @return 车辆型号图片
*/
@Override
public EModelPic selectEModelPicByModelId(Long modelId)
{
return eModelPicMapper.selectEModelPicByModelId(modelId);
}
/**
* 查询车辆型号图片列表
*
* @param eModelPic 车辆型号图片
* @return 车辆型号图片
*/
@Override
public List<EModelPic> selectEModelPicList(EModelPic eModelPic)
{
return eModelPicMapper.selectEModelPicList(eModelPic);
}
/**
* 新增车辆型号图片
*
* @param eModelPic 车辆型号图片
* @return 结果
*/
@Override
public int insertEModelPic(EModelPic eModelPic)
{
eModelPic.setCreateTime(DateUtils.getNowDate());
return eModelPicMapper.insertEModelPic(eModelPic);
}
/**
* 修改车辆型号图片
*
* @param eModelPic 车辆型号图片
* @return 结果
*/
@Override
public int updateEModelPic(EModelPic eModelPic)
{
return eModelPicMapper.updateEModelPic(eModelPic);
}
/**
* 批量删除车辆型号图片
*
* @param modelIds 需要删除的车辆型号图片主键
* @return 结果
*/
@Override
public int deleteEModelPicByModelIds(Long[] modelIds)
{
return eModelPicMapper.deleteEModelPicByModelIds(modelIds);
}
/**
* 删除车辆型号图片信息
*
* @param modelId 车辆型号图片主键
* @return 结果
*/
@Override
public int deleteEModelPicByModelId(Long modelId)
{
return eModelPicMapper.deleteEModelPicByModelId(modelId);
}
}

View File

@ -7,14 +7,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="EDeviceVO" id="EDeviceResult" autoMapping="true" />
<sql id="selectEDeviceVo">
select device_id, picture, device_name, mac, sn, model_id, hardware_version_id, vehicle_num, activation_time, online_status,
select device_id, picture, device_name, mac, sn, model_id, hardware_version_id, vehicle_num, activation_time, online_status,full_voltage, low_voltage, full_endurance,
create_by, create_time, update_by, update_time, last_time, last_location_time, gps, remark, status, lock_status, location,
remaining_power, voltage, qrcode, longitude, latitude, lock_status, location, remaining_power, voltage, is_default,
version, user_id, is_senseless_unlock, is_auto_shutdown, is_auto_defense, is_vibration_alarm, is_admin_unlocking from e_device
</sql>
<select id="selectEDeviceList" parameterType="EDevice" resultMap="EDeviceResult">
select de.device_id, de.picture, de.device_name, de.mac, de.sn, de.model_id, de.hardware_version_id, de.vehicle_num,
select de.device_id, de.picture, de.device_name, de.mac, de.sn, de.model_id, de.hardware_version_id, de.vehicle_num, de.full_voltage, de.low_voltage, de.full_endurance,
de.activation_time, de.online_status, de.create_by, de.create_time, de.update_by,de.is_default,
de.update_time, de.last_time, de.last_location_time, de.gps, de.remark, de.status, de.lock_status, de.location,
de.remaining_power, de.voltage, de.qrcode, de.longitude, de.latitude from e_device de
@ -33,7 +33,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectEDeviceListWithIsolate" parameterType="EDevice" resultMap="EDeviceResult">
select de.device_id, de.picture, de.device_name, de.mac, de.sn, de.model_id, de.hardware_version_id, de.vehicle_num,
select de.device_id, de.picture, de.device_name, de.mac, de.sn, de.model_id, de.hardware_version_id, de.vehicle_num, de.full_voltage, de.low_voltage, de.full_endurance,
de.activation_time, de.online_status, de.create_by, de.create_time, de.update_by,de.user_id,de.is_default,mo.model,
de.update_time, de.last_time, de.last_location_time, de.gps, de.remark, de.status, de.lock_status, de.location,m.user_name userName,
de.remaining_power, de.voltage, de.version, de.qrcode, de.longitude, de.latitude, de.signal_strength, de.satellites, de.quality from e_device de
@ -146,6 +146,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isAutoDefense != null">is_auto_defense,</if>
<if test="isVibrationAlarm != null">is_vibration_alarm,</if>
<if test="isDefault != null">is_default,</if>
<if test="fullVoltage != null">full_voltage,</if>
<if test="lowVoltage != null">low_voltage,</if>
<if test="fullEndurance != null">full_endurance,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="picture != null">#{picture},</if>
@ -184,6 +187,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isAutoDefense != null">#{isAutoDefense},</if>
<if test="isVibrationAlarm != null">#{isVibrationAlarm},</if>
<if test="isDefault != null">#{isDefault},</if>
<if test="fullVoltage != null">#{fullVoltage},</if>
<if test="lowVoltage != null">#{lowVoltage},</if>
<if test="fullEndurance != null">#{fullEndurance},</if>
</trim>
</insert>
@ -226,6 +232,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isAutoDefense != null">is_auto_defense = #{isAutoDefense},</if>
<if test="isVibrationAlarm != null">is_vibration_alarm = #{isVibrationAlarm},</if>
<if test="isDefault != null">is_default = #{isDefault},</if>
<if test="fullVoltage != null">full_voltage = #{fullVoltage},</if>
<if test="lowVoltage != null">low_voltage = #{lowVoltage},</if>
<if test="fullEndurance != null">full_endurance = #{fullEndurance},</if>
</trim>
where device_id = #{deviceId}
</update>
@ -269,6 +278,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isAutoDefense != null">is_auto_defense = #{isAutoDefense},</if>
<if test="isVibrationAlarm != null">is_vibration_alarm = #{isVibrationAlarm},</if>
<if test="isDefault != null">is_default = #{isDefault},</if>
<if test="fullVoltage != null">full_voltage = #{fullVoltage},</if>
<if test="lowVoltage != null">low_voltage = #{lowVoltage},</if>
<if test="fullEndurance != null">full_endurance = #{fullEndurance},</if>
</trim>
where device_id = #{deviceId}
</update>
@ -335,7 +347,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{deviceId}
</foreach>
</delete>
<delete id="oneClickOnline" parameterType="String">
update e_device d set d.status = '1' where device_id in
<foreach item="deviceId" collection="array" open="(" separator="," close=")">

View File

@ -7,7 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="EModelVO" id="EModelResult" autoMapping="true" />
<sql id="selectEModelVo">
select model_id, model, brand_id, brand_name, full_voltage, low_voltage, full_endurance, create_by, create_time,
select model_id, model, brand_id, brand_name, create_by, create_time,
update_by, update_time, remark, intro, deposit, merchant_id, picture, del_flag from e_model
</sql>
@ -17,9 +17,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mo.model,
mo.brand_id,
mo.brand_name,
mo.full_voltage,
mo.low_voltage,
mo.full_endurance,
mo.create_by,
mo.create_time,
mo.update_by,
@ -42,8 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectEModelByModelId" parameterType="Long" resultMap="EModelResult">
select mo.model_id, mo.model, mo.brand_id, mo.brand_name, mo.brand_name, mo.full_voltage, mo.low_voltage,
mo.full_endurance, mo.create_by, mo.create_time,mo.deposit,mo.picture,
select mo.model_id, mo.model, mo.brand_id, mo.brand_name, mo.brand_name, mo.create_by, mo.create_time,mo.deposit,mo.picture,
mo.update_by, mo.update_time, mo.remark from e_model mo
where mo.model_id = #{modelId}
</select>
@ -58,9 +54,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT
m.model_id,
m.model,
m.full_voltage,
m.low_voltage,
m.full_endurance,
m.create_by,
m.create_time,
m.update_by,
@ -99,9 +92,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="model != null">model,</if>
<if test="brandId != null">brand_id,</if>
<if test="brandName != null">brand_name,</if>
<if test="fullVoltage != null">full_voltage,</if>
<if test="lowVoltage != null">low_voltage,</if>
<if test="fullEndurance != null">full_endurance,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
@ -118,9 +108,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="model != null">#{model},</if>
<if test="brandId != null">#{brandId},</if>
<if test="brandName != null">#{brandName},</if>
<if test="fullVoltage != null">#{fullVoltage},</if>
<if test="lowVoltage != null">#{lowVoltage},</if>
<if test="fullEndurance != null">#{fullEndurance},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
@ -140,9 +127,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="model != null">model = #{model},</if>
<if test="brandId != null">brand_id = #{brandId},</if>
<if test="brandName != null">brand_name = #{brandName},</if>
<if test="fullVoltage != null">full_voltage = #{fullVoltage},</if>
<if test="lowVoltage != null">low_voltage = #{lowVoltage},</if>
<if test="fullEndurance != null">full_endurance = #{fullEndurance},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>

View File

@ -0,0 +1,83 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.EModelPicMapper">
<resultMap type="EModelPic" id="EModelPicResult">
<result property="modelId" column="model_id" />
<result property="model" column="model" />
<result property="brandId" column="brand_id" />
<result property="brandName" column="brand_name" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="remark" column="remark" />
<result property="picture" column="picture" />
</resultMap>
<sql id="selectEModelPicVo">
select model_id, model, brand_id, brand_name, create_by, create_time, remark, picture from e_model_pic
</sql>
<select id="selectEModelPicList" parameterType="EModelPic" resultMap="EModelPicResult">
<include refid="selectEModelPicVo"/>
<where>
<if test="model != null and model != ''"> and model = #{model}</if>
<if test="brandId != null "> and brand_id = #{brandId}</if>
<if test="brandName != null and brandName != ''"> and brand_name like concat('%', #{brandName}, '%')</if>
<if test="picture != null and picture != ''"> and picture = #{picture}</if>
</where>
</select>
<select id="selectEModelPicByModelId" parameterType="Long" resultMap="EModelPicResult">
<include refid="selectEModelPicVo"/>
where model_id = #{modelId}
</select>
<insert id="insertEModelPic" parameterType="EModelPic" useGeneratedKeys="true" keyProperty="modelId">
insert into e_model_pic
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="model != null">model,</if>
<if test="brandId != null">brand_id,</if>
<if test="brandName != null">brand_name,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="remark != null">remark,</if>
<if test="picture != null">picture,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="model != null">#{model},</if>
<if test="brandId != null">#{brandId},</if>
<if test="brandName != null">#{brandName},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="remark != null">#{remark},</if>
<if test="picture != null">#{picture},</if>
</trim>
</insert>
<update id="updateEModelPic" parameterType="EModelPic">
update e_model_pic
<trim prefix="SET" suffixOverrides=",">
<if test="model != null">model = #{model},</if>
<if test="brandId != null">brand_id = #{brandId},</if>
<if test="brandName != null">brand_name = #{brandName},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="picture != null">picture = #{picture},</if>
</trim>
where model_id = #{modelId}
</update>
<delete id="deleteEModelPicByModelId" parameterType="Long">
delete from e_model_pic where model_id = #{modelId}
</delete>
<delete id="deleteEModelPicByModelIds" parameterType="String">
delete from e_model_pic where model_id in
<foreach item="modelId" collection="array" open="(" separator="," close=")">
#{modelId}
</foreach>
</delete>
</mapper>