This commit is contained in:
parent
6ce0c46d19
commit
32ee1d5816
|
|
@ -7,7 +7,7 @@ public class IDUtils {
|
|||
private static final byte[] LOCK = new byte[0];
|
||||
|
||||
// 位数,默认是8位
|
||||
private final static long W = 100000000;
|
||||
private final static long W = 1000;
|
||||
|
||||
/**
|
||||
* 传入文件 名称
|
||||
|
|
|
|||
|
|
@ -19,6 +19,9 @@ import org.springframework.scheduling.annotation.EnableScheduling;
|
|||
@EnableRyFeignClients
|
||||
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
|
||||
public class BonusBaseApplication {
|
||||
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(BonusBaseApplication.class, args);
|
||||
System.err.println("(♥◠‿◠)ノ゙ 2024博诺思智慧工地平台启动成功 ლ(´ڡ`ლ)゙ \n" +
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.bonus.base.basic.controller;
|
||||
|
||||
import com.bonus.base.basic.domain.CollectDevVo;
|
||||
import com.bonus.base.basic.domain.ConstInfoVo;
|
||||
import com.bonus.base.basic.domain.DeviceTypeVo;
|
||||
import com.bonus.base.basic.domain.DeviceVo;
|
||||
import com.bonus.base.basic.service.ConstInfoService;
|
||||
import com.bonus.base.common.annotation.PreventRepeatSubmit;
|
||||
|
|
@ -15,6 +17,7 @@ import io.swagger.annotations.ApiOperation;
|
|||
import lombok.Data;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -34,13 +37,45 @@ public class ConstInfoController extends BaseController {
|
|||
@ApiOperation(value = "查询施工现场信息")
|
||||
@RequiresPermissions("tb:const:list")
|
||||
@GetMapping("/getPageList")
|
||||
@SysLog(title = "施工现场管理", businessType = OperaType.QUERY, logType = 1,module = "设备管理->施工现场管理信息")
|
||||
@SysLog(title = "施工现场管理", businessType = OperaType.QUERY, logType = 1,module = "施工现场管理->施工现场管理信息查询")
|
||||
public TableDataInfo getPageList(ConstInfoVo deviceVo) {
|
||||
startPage();
|
||||
List<ConstInfoVo> list = service.getPageList(deviceVo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "新增施工现场")
|
||||
@PreventRepeatSubmit
|
||||
@RequiresPermissions("tb:const:add")
|
||||
@SysLog(title = "施工现场管理信息", businessType = OperaType.INSERT, logType = 1,module = "施工现场管理信息->新增施工现场")
|
||||
@PostMapping("insertData")
|
||||
public AjaxResult insertData(ConstInfoVo vo, @RequestParam(value = "file",required = false) MultipartFile image) {
|
||||
return service.insertData(vo,image);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改施工现场")
|
||||
@PreventRepeatSubmit
|
||||
@RequiresPermissions("tb:const:update")
|
||||
@SysLog(title = "施工现场管理信息", businessType = OperaType.UPDATE, logType = 1,module = "施工现场管理信息->修改施工现场")
|
||||
@PostMapping("updateData")
|
||||
public AjaxResult updateData(ConstInfoVo vo, @RequestParam(value = "file",required = false) MultipartFile image) {
|
||||
return service.updateData(vo,image);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除施工现场")
|
||||
@RequiresPermissions("tb:const:del")
|
||||
@SysLog(title = "施工现场管理信息", businessType = OperaType.DELETE,module = "施工现场管理信息->删除现场")
|
||||
@PostMapping("deleteData")
|
||||
public AjaxResult deleteData(@RequestBody ConstInfoVo vo) {
|
||||
return service.deleteData(vo);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询详情数据")
|
||||
@PostMapping("queryDetail")
|
||||
public AjaxResult queryDetail(@RequestBody ConstInfoVo vo) {
|
||||
return service.queryDetail(vo);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询施工信息下拉选")
|
||||
@PostMapping("querySelected")
|
||||
public AjaxResult querySelected(@RequestBody ConstInfoVo deviceVo) {
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ public class DevModelController extends BaseController {
|
|||
@RequiresPermissions("dev:model:add")
|
||||
@SysLog(title = "高支模分组", businessType = OperaType.INSERT, logType = 1,module = "高支模分组->新增高支模分组")
|
||||
@PostMapping("insertData")
|
||||
public AjaxResult insertData( DevModelVo vo ,@RequestParam(value = "file",required = false) MultipartFile image) {
|
||||
public AjaxResult insertData(@RequestBody DevModelVo vo ,@RequestParam(value = "file",required = false) MultipartFile image) {
|
||||
return service.insertData(vo,image);
|
||||
}
|
||||
|
||||
|
|
@ -61,7 +61,7 @@ public class DevModelController extends BaseController {
|
|||
@RequiresPermissions("dev:model:update")
|
||||
@SysLog(title = "高支模分组", businessType = OperaType.UPDATE, logType = 1,module = "高支模分组->修改高支模分组")
|
||||
@PostMapping("updateData")
|
||||
public AjaxResult updateData( DevModelVo vo ,@RequestParam(value = "file",required = false) MultipartFile image) {
|
||||
public AjaxResult updateData(@RequestBody DevModelVo vo ,@RequestParam(value = "file",required = false) MultipartFile image) {
|
||||
return service.updateData(vo,image);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -61,6 +61,14 @@ public class CollectDevAttrVo {
|
|||
* 更新时间
|
||||
*/
|
||||
private String updateTime;
|
||||
/**
|
||||
* 是否告警
|
||||
*/
|
||||
private String isWarn;
|
||||
/**
|
||||
* 变化值
|
||||
*/
|
||||
private String changeVal;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,11 +20,13 @@ public class CollectDevVo {
|
|||
*/
|
||||
private String typeId;
|
||||
/**
|
||||
* 类型名称
|
||||
* 设备类型
|
||||
*/
|
||||
private String devType;
|
||||
/**
|
||||
* 类型编码
|
||||
*/
|
||||
private String typeCode;
|
||||
|
||||
private String devType;
|
||||
/**
|
||||
* 类型名称
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -8,12 +8,23 @@ import lombok.Data;
|
|||
*/
|
||||
@Data
|
||||
public class ConstInfoVo {
|
||||
|
||||
/**
|
||||
* 删除的文件
|
||||
*/
|
||||
private String delFile;
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* 施工信息名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 施工信息编码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 类型编码
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.bonus.base.basic.mapper;
|
|||
|
||||
import com.bonus.base.basic.domain.ConstInfoVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -24,4 +25,47 @@ public interface ConstInfoMapper {
|
|||
* @return
|
||||
*/
|
||||
List<ConstInfoVo> querySelected(ConstInfoVo deviceVo);
|
||||
|
||||
/**
|
||||
* 查询数据重复校验
|
||||
* @param vo
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
int getNumByParam(@Param("param") ConstInfoVo vo,@Param("type") String type);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
int insertData(ConstInfoVo vo);
|
||||
|
||||
/**
|
||||
* 通过id查询详情
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
ConstInfoVo queryDetail(ConstInfoVo vo);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
int updateData(ConstInfoVo vo);
|
||||
|
||||
/**
|
||||
* 查询是否有设备占用
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
int getDevById(ConstInfoVo vo);
|
||||
|
||||
/**
|
||||
* 删除施工区域设备
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
int deleteData(ConstInfoVo vo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.bonus.base.basic.service;
|
|||
|
||||
import com.bonus.base.basic.domain.ConstInfoVo;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -22,4 +23,34 @@ public interface ConstInfoService {
|
|||
* @return
|
||||
*/
|
||||
AjaxResult querySelected(ConstInfoVo deviceVo);
|
||||
|
||||
/**
|
||||
* 新增施工现场
|
||||
* @param vo
|
||||
* @param image
|
||||
* @return
|
||||
*/
|
||||
AjaxResult insertData(ConstInfoVo vo, MultipartFile image);
|
||||
|
||||
/**
|
||||
* 修改施工现场
|
||||
* @param vo
|
||||
* @param image
|
||||
* @return
|
||||
*/
|
||||
AjaxResult updateData(ConstInfoVo vo, MultipartFile image);
|
||||
|
||||
/**
|
||||
* 通过id查询数据详情
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
AjaxResult queryDetail(ConstInfoVo vo);
|
||||
|
||||
/**
|
||||
* 删除施工现场
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
AjaxResult deleteData(ConstInfoVo vo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
|
|||
import com.bonus.base.basic.domain.*;
|
||||
import com.bonus.base.basic.mapper.CollectDeviceMapper;
|
||||
import com.bonus.base.basic.service.CollectDeviceService;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import com.bonus.common.core.utils.IDUtils;
|
||||
import com.bonus.common.core.utils.uuid.IdUtils;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
|
|
@ -133,7 +134,9 @@ public class CollectDeviceServiceImpl implements CollectDeviceService {
|
|||
vo.setBackImage(url);
|
||||
|
||||
}
|
||||
|
||||
if(StringHelper.isNullOrEmptyString(vo.getUpdateTime())){
|
||||
vo.setUpdateTime(DateUtils.getTime());
|
||||
}
|
||||
vo.setId(IDUtils.createId());
|
||||
num=mapper.insertData(vo);
|
||||
if(num>0){
|
||||
|
|
@ -172,6 +175,9 @@ public class CollectDeviceServiceImpl implements CollectDeviceService {
|
|||
CollectDevVo data=mapper.queryDetail(vo);
|
||||
remoteFileService.deleteFile(data.getBackImage());
|
||||
}
|
||||
if(StringHelper.isNullOrEmptyString(vo.getUpdateTime())){
|
||||
vo.setUpdateTime(DateUtils.getTime());
|
||||
}
|
||||
num=mapper.updateData(vo);
|
||||
if(num>0){
|
||||
return AjaxResult.success("修改成功");
|
||||
|
|
|
|||
|
|
@ -1,15 +1,24 @@
|
|||
package com.bonus.base.basic.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.nacos.common.utils.UuidUtils;
|
||||
import com.bonus.base.basic.domain.ConstInfoVo;
|
||||
import com.bonus.base.basic.domain.DeviceTypeVo;
|
||||
import com.bonus.base.basic.mapper.ConstInfoMapper;
|
||||
import com.bonus.base.basic.service.ConstInfoService;
|
||||
import com.bonus.common.core.utils.IDUtils;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.system.api.RemoteFileService;
|
||||
import com.bonus.system.api.domain.SysFile;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.hibernate.validator.internal.util.StringHelper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -23,6 +32,9 @@ public class ConstInfoServiceImpl implements ConstInfoService {
|
|||
@Autowired
|
||||
private ConstInfoMapper mapper;
|
||||
|
||||
@Resource
|
||||
private RemoteFileService remoteFileService;
|
||||
|
||||
@Override
|
||||
public List<ConstInfoVo> getPageList(ConstInfoVo deviceVo) {
|
||||
try{
|
||||
|
|
@ -50,6 +62,146 @@ public class ConstInfoServiceImpl implements ConstInfoService {
|
|||
return AjaxResult.success("查询异常",new ArrayList<>());
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
* @param vo
|
||||
* @param image
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult insertData(ConstInfoVo vo, MultipartFile image) {
|
||||
try{
|
||||
if(!StringHelper.isNullOrEmptyString(vo.getConfigData())){
|
||||
if(!isJson(vo.getConfigData())){
|
||||
return AjaxResult.error("配置数据格式不正确,必须是JSON格式");
|
||||
}
|
||||
}
|
||||
int num=mapper.getNumByParam(vo,"1");
|
||||
if(num>0){
|
||||
return AjaxResult.error("设备编码已存在");
|
||||
}
|
||||
num=mapper.getNumByParam(vo,"2");
|
||||
if(num>0){
|
||||
return AjaxResult.error("设备名称已存在");
|
||||
}
|
||||
if(image!=null){
|
||||
AjaxResult ajax=remoteFileService.upload(image);
|
||||
if(!ajax.isSuccess()){
|
||||
return AjaxResult.error("图片上传失败,请联系管理员");
|
||||
}
|
||||
SysFile data=ajax.getDataAs(SysFile.class);
|
||||
String url=data.getName();
|
||||
vo.setBackImage(url);
|
||||
}
|
||||
vo.setId(IDUtils.createId());
|
||||
num=mapper.insertData(vo);
|
||||
if (num>0){
|
||||
return AjaxResult.success("新增成功");
|
||||
}
|
||||
|
||||
|
||||
}catch (Exception e){
|
||||
log.error(e.toString());
|
||||
}
|
||||
return AjaxResult.error("新增失败,服务异常");
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param vo
|
||||
* @param image
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult updateData(ConstInfoVo vo, MultipartFile image) {
|
||||
try{
|
||||
if(!StringHelper.isNullOrEmptyString(vo.getConfigData())){
|
||||
if(!isJson(vo.getConfigData())){
|
||||
return AjaxResult.error("配置数据格式不正确,必须是JSON格式");
|
||||
}
|
||||
}
|
||||
int num=mapper.getNumByParam(vo,"1");
|
||||
if(num>0){
|
||||
return AjaxResult.error("设备编码已存在");
|
||||
}
|
||||
num=mapper.getNumByParam(vo,"2");
|
||||
if(num>0){
|
||||
return AjaxResult.error("设备名称已存在");
|
||||
}
|
||||
if(!StringHelper.isNullOrEmptyString(vo.getDelFile()) || image!=null){
|
||||
ConstInfoVo data=mapper.queryDetail(vo);
|
||||
remoteFileService.deleteFile(data.getBackImage());
|
||||
vo.setBackImage("");
|
||||
}
|
||||
if(image!=null){
|
||||
AjaxResult ajax=remoteFileService.upload(image);
|
||||
if(!ajax.isSuccess()){
|
||||
return AjaxResult.error("图片上传失败,请联系管理员");
|
||||
}
|
||||
SysFile data=ajax.getDataAs(SysFile.class);
|
||||
String url=data.getName();
|
||||
vo.setBackImage(url);
|
||||
}
|
||||
num=mapper.updateData(vo);
|
||||
if (num>0){
|
||||
return AjaxResult.success("修改成功");
|
||||
}
|
||||
|
||||
}catch (Exception e){
|
||||
log.error(e.toString());
|
||||
}
|
||||
return AjaxResult.error("修改失败,服务异常");
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情数据
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult queryDetail(ConstInfoVo vo) {
|
||||
try{
|
||||
ConstInfoVo data=mapper.queryDetail(vo);
|
||||
return AjaxResult.success(data);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return AjaxResult.error("查询失败");
|
||||
}
|
||||
|
||||
/**'
|
||||
* 删除数据
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult deleteData(ConstInfoVo vo) {
|
||||
try{
|
||||
int num=mapper.getDevById(vo);
|
||||
if(num>0){
|
||||
return AjaxResult.error("该施工区域存在设备,不允许删除");
|
||||
}
|
||||
num=mapper.deleteData(vo);
|
||||
if(num>0){
|
||||
return AjaxResult.success("修改成功");
|
||||
}
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return AjaxResult.error("删除失败,系统异常");
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证 数据是不是json
|
||||
* @param string
|
||||
* @return
|
||||
*/
|
||||
public boolean isJson(String string) {
|
||||
try {
|
||||
JSONObject jsonObject = JSON.parseObject(string);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,37 @@
|
|||
package com.bonus.base.screen.controller;
|
||||
|
||||
import com.bonus.base.basic.domain.vo.DevModelVo;
|
||||
import com.bonus.base.screen.service.ScreenDevModelService;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author 黑子
|
||||
* 大屏高支模 模块查询
|
||||
*/
|
||||
@Api(tags = "高支模分组")
|
||||
@RestController
|
||||
@RequestMapping("/screen/devModel")
|
||||
public class ScreenDevModelController {
|
||||
|
||||
|
||||
|
||||
@Autowired
|
||||
private ScreenDevModelService service;
|
||||
|
||||
@ApiOperation(value = "查询高支模分组")
|
||||
@PostMapping("getModeGroup")
|
||||
public AjaxResult getModeGroup(@RequestBody DevModelVo vo) {
|
||||
return null;
|
||||
// return service.queryDetail(vo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
package com.bonus.base.screen.service;
|
||||
|
||||
/**
|
||||
* 大屏高支模 模块业务接口查询
|
||||
* @author 黑子
|
||||
*/
|
||||
public interface ScreenDevModelService {
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.bonus.base.screen.service;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 大屏高支模模块统计数据查询
|
||||
* @author 黑子
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class ScreenDevModelServiceImpl implements ScreenDevModelService{
|
||||
}
|
||||
|
|
@ -7,7 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
INSERT INTO tb_collect_device(
|
||||
id, dev_name, dev_type_id, dev_code,
|
||||
dev_type, is_active, is_online,dev_location, background_image, remark,
|
||||
config_data, del_flag, create_time,update_time, const_id,
|
||||
config_data, del_flag, create_time,update_time, const_id
|
||||
)values (#{id},#{devName},#{typeId},#{devCode},#{devType} ,#{isActive},#{isOnline},#{devLocation},#{backImage},
|
||||
#{remark},#{configData},0,now(),now(),#{constId} )
|
||||
|
||||
|
|
@ -16,9 +16,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
INSERT INTO tb_collect_device_attr(
|
||||
dev_id, attr_id,attr_name,remark,
|
||||
data_type, unit, attr_code, attr_val, create_time,
|
||||
update_time, max_value, min_value
|
||||
update_time, max_value, min_value,change_val ,is_warn
|
||||
)values (#{devId},#{attrId},#{attrName},#{remark},#{dataType},#{unit},#{attrCode},
|
||||
#{attrVal},#{createTime},now(),#{maxVal},#{minVal})
|
||||
#{attrVal},now(),#{updateTime},#{maxVal},#{minVal},#{changeVal},#{isWarn})
|
||||
|
||||
</insert>
|
||||
<update id="updateData">
|
||||
|
|
@ -26,13 +26,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
dev_name=#{devName}, dev_type_id=#{typeId}, dev_code=#{devCode},
|
||||
dev_type=#{devType}, is_active=#{isActive}, is_online=#{isOnline},dev_location=#{devLocation},
|
||||
background_image=#{backImage}, remark=#{remark},
|
||||
config_data=#{configData},update_time=now(), const_id=#{constId}
|
||||
config_data=#{configData},update_time=#{updateTime}, const_id=#{constId}
|
||||
where id=#{id}
|
||||
</update>
|
||||
<update id="updateAttrData">
|
||||
update tb_collect_device_attr set attr_name=#{attrName},remark=#{remark},
|
||||
data_type=#{dataType}, unit=#{unit}, attr_code=#{attrCode}, attr_val=#{attrVal},
|
||||
update_time=now(), max_value=#{maxVal}, min_value=#{minVal}
|
||||
update_time=now(), max_value=#{maxVal}, min_value=#{minVal},change_val=#{changeVal},is_warn=#{isWarn}
|
||||
where attr_id=#{attrId}
|
||||
</update>
|
||||
<update id="delData">
|
||||
|
|
@ -64,7 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</if>
|
||||
<if test="keyWord!=null and keyWord!=''">
|
||||
and (tcd.dev_code like concat('%',#{keyWord},'%') or
|
||||
tcd.dev_name like concat('%',#{keyWord},'%')
|
||||
tcd.dev_name like concat('%',#{keyWord},'%') or
|
||||
)
|
||||
</if>
|
||||
|
||||
|
|
@ -100,7 +100,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
remark, data_type dataType, unit,
|
||||
attr_code attrCode, attr_val attrVal,
|
||||
create_time createTime, update_time updateTime,
|
||||
max_value maxVal, min_value minVal
|
||||
max_value maxVal, min_value minVal,change_val changeVal,is_warn isWarn
|
||||
from tb_collect_device_attr
|
||||
where dev_id=#{devId}
|
||||
<if test="attrName!=null and attrName!=''">
|
||||
|
|
@ -132,7 +132,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
remark, data_type dataType, unit,
|
||||
attr_code attrCode, attr_val attrVal,
|
||||
create_time createTime, update_time updateTime,
|
||||
max_value maxVal, min_value minVal
|
||||
max_value maxVal, min_value minVal,change_val changeVal,is_warn isWarn
|
||||
from tb_collect_device_attr
|
||||
where attr_id=#{attrId}
|
||||
</select>
|
||||
|
|
|
|||
|
|
@ -3,6 +3,21 @@
|
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.base.basic.mapper.ConstInfoMapper">
|
||||
<insert id="insertData">
|
||||
insert into tb_const_info (id, name, type_id, type_code, type_name,
|
||||
create_time, update_time, is_active,
|
||||
del_flag, remark, background_image, config_data, code
|
||||
) values (#{id},#{name},#{typeId},#{typeCode},#{typeName},now(),now(),0,0,#{remark},#{backImage},#{configData},#{code});
|
||||
</insert>
|
||||
<update id="updateData">
|
||||
update tb_const_info set name=#{name},type_id=#{typeId},update_time=now(),
|
||||
remark=#{remark},background_image=#{backImage},config_data=#{configData},code=#{code},
|
||||
is_active=#{isActive}
|
||||
where id=#{id}
|
||||
</update>
|
||||
<update id="deleteData">
|
||||
update tb_const_info set del_flag=1 and update_time=now() where id=#{id}
|
||||
</update>
|
||||
|
||||
<select id="getPageList" resultType="com.bonus.base.basic.domain.ConstInfoVo">
|
||||
select tci.id, tci.name, tci.type_id typeId ,tdt.type_code typeCode ,tdt.type_name typeName, tci.create_time createTime ,tci.update_time updateTime , tci.is_active isActive ,
|
||||
|
|
@ -19,4 +34,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and tci.type_id=#{typeId}
|
||||
</if>
|
||||
</select>
|
||||
<!--数据查询-->
|
||||
<select id="getNumByParam" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
from tb_const_info
|
||||
where del_flag=0
|
||||
<if test="param.id!=null and param.id!=''">
|
||||
and id!=#{param.id}
|
||||
</if>
|
||||
<if test='type=="1"'>
|
||||
<if test="param.code!=null and param.code!=''">
|
||||
and tci.code=#{param.code}
|
||||
</if>
|
||||
</if>
|
||||
<if test='type=="2"'>
|
||||
<if test="param.name!=null and param.name!=''">
|
||||
and tci.name=#{param.name}
|
||||
</if>
|
||||
</if>
|
||||
</select>
|
||||
<!--查询详情-->
|
||||
<select id="queryDetail" resultType="com.bonus.base.basic.domain.ConstInfoVo">
|
||||
select tci.id, tci.name, tci.type_id typeId ,tdt.type_code typeCode ,tdt.type_name typeName, tci.create_time createTime ,tci.update_time updateTime , tci.is_active isActive ,
|
||||
tci.remark, tci.background_image backImage , tci.config_data configData
|
||||
from tb_const_info tci
|
||||
left join tb_dev_type tdt on tdt.id=tci.type_id
|
||||
where tci.id=#{id}
|
||||
</select>
|
||||
<select id="getDevById" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
from tb_collect_device
|
||||
WHERE const_id=#{id} and del_flag=0
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -57,7 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and id!=#{param.id}
|
||||
</if>
|
||||
<if test='type=="1"'>
|
||||
<if test="param.name!=null and param.name!=''">
|
||||
<if test="param.modelName!=null and param.modelName!=''">
|
||||
and model_name=#{param.modelName}
|
||||
</if>
|
||||
</if>
|
||||
|
|
|
|||
|
|
@ -20,8 +20,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
|
|||
@EnableScheduling
|
||||
public class BonusSystemApplication
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(BonusSystemApplication.class, args);
|
||||
System.out.println("(♥◠‿◠)ノ゙ 系统模块启动成功 ლ(´ڡ`ლ)゙ \n" +
|
||||
" .-------. ____ __ \n" +
|
||||
|
|
|
|||
Loading…
Reference in New Issue