Commit 8c721552 authored by co_dengxiongwen's avatar co_dengxiongwen

接口调整

parent 0770843d
...@@ -181,6 +181,10 @@ public class LiResource implements Serializable { ...@@ -181,6 +181,10 @@ public class LiResource implements Serializable {
/** 图标路径*/ /** 图标路径*/
private java.lang.String imageSrc; private java.lang.String imageSrc;
@ApiModelProperty(value = "人工模式", name = "mode_types")
/** 人工模式*/
private java.lang.String modeTypes;
@TableField(exist = false) @TableField(exist = false)
/** 地图层级*/ /** 地图层级*/
private String tierName; private String tierName;
......
...@@ -147,6 +147,9 @@ public class LiResourceModel extends BaseModel { ...@@ -147,6 +147,9 @@ public class LiResourceModel extends BaseModel {
*/ */
private java.lang.String byx3; private java.lang.String byx3;
/** 人工模式*/
private java.lang.String modeTypes;
/** /**
* 多种资源点类型 * 多种资源点类型
*/ */
......
package com.devplatform.admin.modules.sys.bean; package com.devplatform.admin.modules.sys.bean;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
...@@ -70,4 +71,8 @@ public class SysCommandLog implements Serializable { ...@@ -70,4 +71,8 @@ public class SysCommandLog implements Serializable {
/** 备用项3 */ /** 备用项3 */
@ApiModelProperty(value="备用项3",name="byx3") @ApiModelProperty(value="备用项3",name="byx3")
private java.lang.String byx3; private java.lang.String byx3;
@TableField(exist = false)
/** 资源点类型名称*/
private String resourceName;
} }
...@@ -109,7 +109,7 @@ public class SysCommandLogController extends AbstractController{ ...@@ -109,7 +109,7 @@ public class SysCommandLogController extends AbstractController{
@ApiImplicitParam(name = "id", value = "主键", required = true, dataType = "String") @ApiImplicitParam(name = "id", value = "主键", required = true, dataType = "String")
@GetMapping("/getId/{id}") @GetMapping("/getId/{id}")
public R getId(@PathVariable String 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); return R.ok().put("bean", bean);
} }
......
...@@ -6,6 +6,7 @@ import com.devplatform.admin.modules.sys.bean.SysCommandLog; ...@@ -6,6 +6,7 @@ import com.devplatform.admin.modules.sys.bean.SysCommandLog;
import com.devplatform.common.dao.MyBaseMapper; import com.devplatform.common.dao.MyBaseMapper;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* SysCommandLog Mapper * SysCommandLog Mapper
...@@ -29,4 +30,6 @@ public interface SysCommandLogDao extends MyBaseMapper<SysCommandLog> { ...@@ -29,4 +30,6 @@ public interface SysCommandLogDao extends MyBaseMapper<SysCommandLog> {
* @return * @return
*/ */
List<SysCommandLog> queryPageList(SysCommandLogModel model); List<SysCommandLog> queryPageList(SysCommandLogModel model);
Map<String, Object> getBeanById(String id);
} }
...@@ -6,6 +6,7 @@ import com.devplatform.admin.modules.sys.bean.SysCommandLog; ...@@ -6,6 +6,7 @@ import com.devplatform.admin.modules.sys.bean.SysCommandLog;
import com.devplatform.admin.modules.sys.model.SysCommandLogModel; import com.devplatform.admin.modules.sys.model.SysCommandLogModel;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 指令日志表的service接口 * 指令日志表的service接口
...@@ -21,4 +22,6 @@ public interface SysCommandLogService extends MyBaseService<SysCommandLog> { ...@@ -21,4 +22,6 @@ public interface SysCommandLogService extends MyBaseService<SysCommandLog> {
* @return * @return
*/ */
List<SysCommandLog> queryPageList(SysCommandLogModel model); List<SysCommandLog> queryPageList(SysCommandLogModel model);
Map<String, Object> getBeanById(String id);
} }
...@@ -8,6 +8,7 @@ import com.devplatform.common.service.impl.MyBaseServiceImpl; ...@@ -8,6 +8,7 @@ import com.devplatform.common.service.impl.MyBaseServiceImpl;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 指令日志表的service接口实现类 * 指令日志表的service接口实现类
...@@ -24,4 +25,9 @@ public class SysCommandLogServiceImpl extends MyBaseServiceImpl<SysCommandLogDao ...@@ -24,4 +25,9 @@ public class SysCommandLogServiceImpl extends MyBaseServiceImpl<SysCommandLogDao
model.getPager().setRowCount(rowCount); model.getPager().setRowCount(rowCount);
return baseMapper.queryPageList(model); return baseMapper.queryPageList(model);
} }
@Override
public Map<String, Object> getBeanById(String id) {
return baseMapper.getBeanById(id);
}
} }
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
<result column="xlongit" property="xlongit"/> <result column="xlongit" property="xlongit"/>
<result column="ylat" property="ylat"/> <result column="ylat" property="ylat"/>
<result column="image_src" property="imageSrc"/> <result column="image_src" property="imageSrc"/>
<result column="mode_types" property="modeTypes"/>
</resultMap> </resultMap>
<!-- li_resource table all fields --> <!-- li_resource table all fields -->
...@@ -49,7 +50,7 @@ ...@@ -49,7 +50,7 @@
id,name,code,type,station_id,station_name,tier_id,address_code,port, 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, 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, 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> </sql>
<!-- 公共查询条件 --> <!-- 公共查询条件 -->
...@@ -89,6 +90,7 @@ ...@@ -89,6 +90,7 @@
<if test="byx2!=null and byx2!=''">and byx2 = #{byx2}</if> <if test="byx2!=null and byx2!=''">and byx2 = #{byx2}</if>
<if test="byx3!=null and byx3!=''">and byx3 = #{byx3}</if> <if test="byx3!=null and byx3!=''">and byx3 = #{byx3}</if>
<if test="brand!=null and brand!=''">and brand = #{brand}</if> <if test="brand!=null and brand!=''">and brand = #{brand}</if>
<if test="modeTypes!=null and modeTypes!=''">and mode_types = #{modeTypes}</if>
</sql> </sql>
<!--查询总数--> <!--查询总数-->
...@@ -99,8 +101,9 @@ ...@@ -99,8 +101,9 @@
<select id="queryPageByList" parameterType="Object" resultMap="BaseResultMap"> <select id="queryPageByList" parameterType="Object" resultMap="BaseResultMap">
select li.*,sdb.name as brandName, select li.*,sdb.name as brandName,
(CASE WHEN li.status = 1 THEN '在线' (CASE WHEN li.status = 1 THEN '运行'
WHEN li.status = 2 THEN '离线' WHEN li.status = 2 THEN '停止'
WHEN li.status = 3 THEN '离线'
ELSE '故障' END) as statusName ELSE '故障' END) as statusName
from li_resource li from li_resource li
left join sys_dictionary sdb on sdb.id = li.brand left join sys_dictionary sdb on sdb.id = li.brand
...@@ -149,6 +152,7 @@ ...@@ -149,6 +152,7 @@
<if test="byx2!=null and byx2!=''">and byx2 = #{byx2}</if> <if test="byx2!=null and byx2!=''">and byx2 = #{byx2}</if>
<if test="byx3!=null and byx3!=''">and byx3 = #{byx3}</if> <if test="byx3!=null and byx3!=''">and byx3 = #{byx3}</if>
<if test="brand!=null and brand!=''">and brand = #{brand}</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"> <if test="list!=null and list.size()>0">
and type in and type in
<foreach close=")" collection="list" index="index" item="item" open="(" separator=","> <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
...@@ -193,6 +197,7 @@ ...@@ -193,6 +197,7 @@
<if test="byx2!=null and byx2!=''">and li.byx2 = #{byx2}</if> <if test="byx2!=null and byx2!=''">and li.byx2 = #{byx2}</if>
<if test="byx3!=null and byx3!=''">and li.byx3 = #{byx3}</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="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"> <if test="list!=null and list.size()>0">
and li.type in and li.type in
<foreach close=")" collection="list" index="index" item="item" open="(" separator=","> <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
......
...@@ -55,7 +55,8 @@ ...@@ -55,7 +55,8 @@
</select> </select>
<select id="queryPageList" parameterType="Object" resultMap="BaseResultMap"> <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"/> <include refid="Example_Where_Clause"/>
<if test="pager.orderCondition != null and pager.orderCondition != ''"> <if test="pager.orderCondition != null and pager.orderCondition != ''">
${pager.orderCondition} ${pager.orderCondition}
...@@ -64,6 +65,16 @@ ...@@ -64,6 +65,16 @@
${pager.mysqlQueryCondition} ${pager.mysqlQueryCondition}
</if> </if>
</select> </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> </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