Commit 8c721552 authored by co_dengxiongwen's avatar co_dengxiongwen

接口调整

parent 0770843d
......@@ -181,6 +181,10 @@ public class LiResource implements Serializable {
/** 图标路径*/
private java.lang.String imageSrc;
@ApiModelProperty(value = "人工模式", name = "mode_types")
/** 人工模式*/
private java.lang.String modeTypes;
@TableField(exist = false)
/** 地图层级*/
private String tierName;
......
......@@ -147,6 +147,9 @@ public class LiResourceModel extends BaseModel {
*/
private java.lang.String byx3;
/** 人工模式*/
private java.lang.String modeTypes;
/**
* 多种资源点类型
*/
......
package com.devplatform.admin.modules.sys.bean;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
......@@ -70,4 +71,8 @@ public class SysCommandLog implements Serializable {
/** 备用项3 */
@ApiModelProperty(value="备用项3",name="byx3")
private java.lang.String byx3;
@TableField(exist = false)
/** 资源点类型名称*/
private String resourceName;
}
......@@ -109,7 +109,7 @@ public class SysCommandLogController extends AbstractController{
@ApiImplicitParam(name = "id", value = "主键", required = true, dataType = "String")
@GetMapping("/getId/{id}")
public R getId(@PathVariable String id) {
SysCommandLog bean = sysCommandLogService.getById(id);
Map<String, Object> bean = sysCommandLogService.getBeanById(id);
return R.ok().put("bean", bean);
}
......
......@@ -6,6 +6,7 @@ import com.devplatform.admin.modules.sys.bean.SysCommandLog;
import com.devplatform.common.dao.MyBaseMapper;
import java.util.List;
import java.util.Map;
/**
* SysCommandLog Mapper
......@@ -29,4 +30,6 @@ public interface SysCommandLogDao extends MyBaseMapper<SysCommandLog> {
* @return
*/
List<SysCommandLog> queryPageList(SysCommandLogModel model);
Map<String, Object> getBeanById(String id);
}
......@@ -6,6 +6,7 @@ import com.devplatform.admin.modules.sys.bean.SysCommandLog;
import com.devplatform.admin.modules.sys.model.SysCommandLogModel;
import java.util.List;
import java.util.Map;
/**
* 指令日志表的service接口
......@@ -21,4 +22,6 @@ public interface SysCommandLogService extends MyBaseService<SysCommandLog> {
* @return
*/
List<SysCommandLog> queryPageList(SysCommandLogModel model);
Map<String, Object> getBeanById(String id);
}
......@@ -8,6 +8,7 @@ import com.devplatform.common.service.impl.MyBaseServiceImpl;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
* 指令日志表的service接口实现类
......@@ -24,4 +25,9 @@ public class SysCommandLogServiceImpl extends MyBaseServiceImpl<SysCommandLogDao
model.getPager().setRowCount(rowCount);
return baseMapper.queryPageList(model);
}
@Override
public Map<String, Object> getBeanById(String id) {
return baseMapper.getBeanById(id);
}
}
......@@ -42,6 +42,7 @@
<result column="xlongit" property="xlongit"/>
<result column="ylat" property="ylat"/>
<result column="image_src" property="imageSrc"/>
<result column="mode_types" property="modeTypes"/>
</resultMap>
<!-- li_resource table all fields -->
......@@ -49,7 +50,7 @@
id,name,code,type,station_id,station_name,tier_id,address_code,port,
username,password,xpoint,ypoint,width,rotate,deploy_location,operator_id,operator_name,
attached_info,remark,icon,status,deleted,create_user_id,create_time,update_user_id,update_time,
byx1,byx2,byx3,brand,xlongit,ylat,image_src,equipment_model,max_power,install_date,maintenance_date,region
byx1,byx2,byx3,brand,xlongit,ylat,image_src,equipment_model,max_power,install_date,maintenance_date,region,mode_types
</sql>
<!-- 公共查询条件 -->
......@@ -89,6 +90,7 @@
<if test="byx2!=null and byx2!=''">and byx2 = #{byx2}</if>
<if test="byx3!=null and byx3!=''">and byx3 = #{byx3}</if>
<if test="brand!=null and brand!=''">and brand = #{brand}</if>
<if test="modeTypes!=null and modeTypes!=''">and mode_types = #{modeTypes}</if>
</sql>
<!--查询总数-->
......@@ -99,8 +101,9 @@
<select id="queryPageByList" parameterType="Object" resultMap="BaseResultMap">
select li.*,sdb.name as brandName,
(CASE WHEN li.status = 1 THEN '在线'
WHEN li.status = 2 THEN '离线'
(CASE WHEN li.status = 1 THEN '运行'
WHEN li.status = 2 THEN '停止'
WHEN li.status = 3 THEN '离线'
ELSE '故障' END) as statusName
from li_resource li
left join sys_dictionary sdb on sdb.id = li.brand
......@@ -149,6 +152,7 @@
<if test="byx2!=null and byx2!=''">and byx2 = #{byx2}</if>
<if test="byx3!=null and byx3!=''">and byx3 = #{byx3}</if>
<if test="brand!=null and brand!=''">and brand = #{brand}</if>
<if test="modeTypes!=null and modeTypes!=''">and mode_types = #{modeTypes}</if>
<if test="list!=null and list.size()>0">
and type in
<foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
......@@ -193,6 +197,7 @@
<if test="byx2!=null and byx2!=''">and li.byx2 = #{byx2}</if>
<if test="byx3!=null and byx3!=''">and li.byx3 = #{byx3}</if>
<if test="brand!=null and brand!=''">and li.brand = #{brand}</if>
<if test="modeTypes!=null and modeTypes!=''">and li.mode_types = #{modeTypes}</if>
<if test="list!=null and list.size()>0">
and li.type in
<foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
......
......@@ -55,7 +55,8 @@
</select>
<select id="queryPageList" parameterType="Object" resultMap="BaseResultMap">
select t.* from sys_command_log t
select t.*,lr.name as resourceName from sys_command_log t
left join li_resource lr on lr.id = t.resource_id
<include refid="Example_Where_Clause"/>
<if test="pager.orderCondition != null and pager.orderCondition != ''">
${pager.orderCondition}
......@@ -64,6 +65,16 @@
${pager.mysqlQueryCondition}
</if>
</select>
<select id="getBeanById" resultType="java.util.Map">
select t.id,su.username as createUserName, t.create_time as createTime,t.result,t.com_type as comType,
t.com_mark as comMark,t.com_source as comSource,
lr.status,lr.code,lr.name as resourceName,sd.name as type from
sys_command_log t
left join li_resource lr on lr.id = t.resource_id
left join sys_dictionary sd on sd.id = t.resource_type
left join sys_user su on su.user_id = t.create_user_id
where t.id = #{id}
</select>
</mapper>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment