Commit d171aed5 authored by co_dengxiongwen's avatar co_dengxiongwen

tj

parent 49cd2919
package com.devplatform.admin.modules.event.bean;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
/**
* @author dxw
*/
@Data
@ApiModel(value="报警类型表对象",description="报警类型表对象")
@TableName("link_event")
......
package com.devplatform.admin.modules.liresource.bean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
/**
* @author dxw
*/
@Data
@ApiModel(value="场景表对象",description="场景表对象")
@TableName("li_room")
public class LiRoom implements Serializable {
private static final long serialVersionUID = 1L;
/** 主键id */
@ApiModelProperty(value="主键ID",name="id")
@TableId
private java.lang.String id;
/** 所属站点 */
@ApiModelProperty(value="所属站点",name="stationId")
private java.lang.String stationId;
/** 所属区域 */
@ApiModelProperty(value="所属区域",name="mapId")
private java.lang.String mapId;
/** 名称 */
@ApiModelProperty(value="名称",name="name")
private java.lang.String name;
/** 编号 */
@ApiModelProperty(value="编号",name="code")
private java.lang.String code;
/** 创建人 */
@ApiModelProperty(value="创建人",name="createUserId")
private java.lang.String createUserId;
/** 创建时间 */
@ApiModelProperty(value="创建时间",name="createTime")
private java.util.Date createTime;
/** 修改人 */
@ApiModelProperty(value="修改人",name="updateUserId")
private java.lang.String updateUserId;
/** 修改时间 */
@ApiModelProperty(value="修改时间",name="updateTime")
private java.util.Date updateTime;
/** 是否已删除(0未删除,1已删除) */
@ApiModelProperty(value="是否已删除(0未删除,1已删除)",name="deleted")
private Integer deleted;
/** 系统标识 */
@ApiModelProperty(value="系统标识",name="sysSign")
private java.lang.String sysSign;
/** 备用项1 */
@ApiModelProperty(value="备用项1",name="byx1")
private java.lang.String byx1;
/** 备用项2 */
@ApiModelProperty(value="备用项2",name="byx2")
private java.lang.String byx2;
/** 备用项3 */
@ApiModelProperty(value="备用项3",name="byx3")
private java.lang.String byx3;
}
package com.devplatform.admin.modules.liresource.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.devplatform.admin.common.annotation.SysLogMethod;
import com.devplatform.admin.common.utils.AbstractController;
import com.devplatform.admin.modules.liresource.bean.LiResourceIcon;
import com.devplatform.admin.modules.liresource.model.LiResourceIconModel;
import com.devplatform.admin.modules.liresource.service.LiResourceIconService;
import com.devplatform.common.base.annotation.SysLog;
import com.devplatform.common.base.validator.ValidatorUtils;
import com.devplatform.common.util.R;
import com.devplatform.common.util.StringUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
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 Administrator
*/
@Api(tags = {"资源点图标表接口"})
@RestController
@RequestMapping("/liResourceIcon")
public class LiResourceIconController extends AbstractController {
@Autowired private LiResourceIconService liResourceIconService;
/**
* 列表页面列表数据获取
*
* @param model 承接对象
* @return
*/
@ApiOperation(value = "根据条件获取资源点图标表分页数据列表", notes = "根据条件获取资源点图标表分页数据列表")
@ApiImplicitParam(
name = "params",
value = "参数",
required = true,
dataType = "LiResourceIconModel")
@PostMapping("/list")
public R list(@RequestBody LiResourceIconModel model) {
if (StringUtils.isBlank(model.getSort())) {
model.setSort("order_num");
model.setOrder("ASC");
}
List<LiResourceIcon> list = liResourceIconService.queryPageByList(model);
return R.ok().put("page", getMyPage(list, model));
}
/**
* 添加
*
* @param bean 资源点图标表对象
* @return
*/
@SysLog("添加资源点图标表")
@SysLogMethod(operation = "新增", blockName = "资源点图标表", detail = "新增资源点图标表数据")
@ApiOperation(value = "新增资源点图标表数据", notes = "新增资源点图标表数据")
@PostMapping("/save")
public R save(@RequestBody @ApiParam(value = "资源点图标表实体对象", required = true) LiResourceIcon bean) {
bean.setSysSign(getUser().getSysSystem().getCode());
ValidatorUtils.validateEntity(bean);
liResourceIconService.save(bean);
return R.ok();
}
/**
* 修改
*
* @param bean 资源点图标表对象
* @return
*/
@SysLog("修改资源点图标表")
@SysLogMethod(operation = "修改", blockName = "资源点图标表", detail = "修改资源点图标表数据")
@ApiOperation(value = "修改资源点图标表数据", notes = "修改资源点图标表数据")
@PostMapping("/update")
public R update(
@RequestBody @ApiParam(value = "资源点图标表实体对象", required = true) LiResourceIcon bean) {
ValidatorUtils.validateEntity(bean);
bean.setSysSign(getUser().getSysSystem().getCode());
liResourceIconService.update(
bean,
new QueryWrapper<LiResourceIcon>()
.eq(StringUtil.checkNotNull(bean.getId()), "id", bean.getId()));
return R.ok();
}
/**
* 根据ID获取资源点图标表对象
*
* @param id 对象主键
* @return
*/
@ApiOperation(value = "根据ID获取资源点图标表对象", notes = "根据ID获取资源点图标表对象")
@ApiImplicitParam(name = "id", value = "主键", required = true, dataType = "String")
@GetMapping("/getId/{id}")
public R getId(@PathVariable String id) {
LiResourceIcon bean = liResourceIconService.getById(id);
return R.ok().put("bean", bean);
}
/**
* 根据ID获取资源点图标表对象
*
* @param ids 资源点图标表对象主键数组
* @return
*/
@SysLog("删除资源点图标表")
@SysLogMethod(operation = "删除", blockName = "资源点图标表", detail = "删除资源点图标表数据")
@ApiOperation(value = "根据ID批量删除资源点图标表数据", notes = "根据ID批量删除资源点图标表数据")
@ApiImplicitParam(name = "ids", value = "主键数组", required = true, dataType = "String")
@PostMapping("/delete")
public R delete(@RequestBody String[] ids) {
liResourceIconService.removeByIds(Arrays.asList(ids));
return R.ok();
}
}
package com.devplatform.admin.modules.liresource.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.devplatform.admin.common.utils.AbstractController;
import com.devplatform.admin.modules.liresource.bean.LiRoom;
import com.devplatform.admin.modules.liresource.model.LiRoomModel;
import com.devplatform.admin.modules.liresource.service.LiRoomService;
import com.devplatform.common.base.annotation.SysLog;
import com.devplatform.common.base.validator.ValidatorUtils;
import com.devplatform.common.util.PageUtils;
import com.devplatform.common.util.R;
import com.devplatform.common.util.StringUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 场景表的Controller
* <br>
* @author 代码生成器产生
*/
@Api(tags={"场景表接口"})
@RestController
@RequestMapping("/liRoom")
public class LiRoomController extends AbstractController{
@Autowired
private LiRoomService liRoomService;
/**
* 列表页面列表数据获取
* @param params 承接对象
* @return
*/
@ApiOperation(value="根据条件获取场景表分页数据列表", notes="根据条件获取场景表分页数据列表")
@ApiImplicitParam(name = "params", value = "参数", required = true, dataType = "Map<String, Object>")
@PostMapping("/list")
public R list(@RequestParam Map<String, Object> params) {
//分页查询
PageUtils page = liRoomService.queryPage(params,null);
//返回分页结果
return R.ok().put("page", page);
}
/**
* 列表页面列表数据获取
* @param model 承接对象
* @return
*/
@ApiOperation(value="根据条件获取场景表分页数据列表", notes="根据条件获取场景表分页数据列表")
@ApiImplicitParam(name = "model", value = "参数", required = true, dataType = "LiRoomModel")
@PostMapping("/pageList")
public R pageList(@RequestBody LiRoomModel model) {
//如果model参数中没有设置排序方式,则默认以创建时间倒序排列
if(StringUtil.isEmpty(model.getSort())){
model.setSort("create_time desc");
}
//按条件查询分页数据
List<LiRoom> list = liRoomService.queryPageList(model);
//将查询结果中数据和数量封装起来做为接口返回值
return R.ok().put("page", getMyPage(list,model));
}
/**
* 添加
* @param bean 场景表对象
* @return
*/
@SysLog("添加场景表")
@ApiOperation(value="新增场景表数据", notes="新增场景表数据")
@PostMapping("/save")
public R save(@RequestBody @ApiParam(value="场景表实体对象", required = true)LiRoom bean) {
ValidatorUtils.validateEntity(bean);
bean.setCreateUserId(getUserId());
bean.setCreateTime(new Date());
liRoomService.save(bean);
return R.ok();
}
/**
* 修改
* @param bean 场景表对象
* @return
*/
@SysLog("修改场景表")
@ApiOperation(value="修改场景表数据", notes="修改场景表数据")
@PostMapping("/update")
public R update(@RequestBody @ApiParam(value="场景表实体对象", required = true)LiRoom bean) {
ValidatorUtils.validateEntity(bean);
bean.setUpdateUserId(getUserId());
bean.setUpdateTime(new Date());
liRoomService.update(bean,
new QueryWrapper<LiRoom>().eq(StringUtil.checkNotNull(bean.getId()),"id", bean.getId()));
return R.ok();
}
/**
* 根据ID获取场景表对象
* @param id 对象主键
* @return
*/
@ApiOperation(value="根据ID获取场景表对象", notes="根据ID获取场景表对象")
@ApiImplicitParam(name = "id", value = "主键", required = true, dataType = "String")
@GetMapping("/getId/{id}")
public R getId(@PathVariable String id) {
LiRoom bean = liRoomService.getById(id);
return R.ok().put("bean", bean);
}
/**
* 根据ID获取场景表对象
* @param ids 场景表对象主键数组
* @return
*/
@SysLog("删除场景表数据")
@ApiOperation(value="根据ID批量删除场景表数据", notes="根据ID批量删除场景表数据")
@ApiImplicitParam(name = "ids", value = "主键数组", required = true, dataType = "String")
@PostMapping("/delete")
public R delete(@RequestBody String[] ids) {
liRoomService.removeByIds(Arrays.asList(ids));
return R.ok();
}
/**
* 逻辑删除
* 根据ID删除场景表对象
* @param ids 场景表对象主键数组
* @return
*/
@SysLog("删除场景表数据")
@ApiOperation(value="根据ID批量删除场景表数据", notes="根据ID批量删除场景表数据")
@ApiImplicitParam(name = "ids", value = "主键数组", required = true, dataType = "String[]")
@PostMapping("/deleteByFlag")
public R deleteByFlag(@RequestBody String[] ids) {
//根据id数组删除
liRoomService.deleteByFlagByIds(ids, getUserId());
//返回成功
return R.ok();
}
}
package com.devplatform.admin.modules.liresource.dao;
import com.devplatform.admin.modules.liresource.bean.LiResourceIcon;
import com.devplatform.admin.modules.liresource.model.LiResourceIconModel;
import com.devplatform.common.dao.MyBaseMapper;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
/**
* LiResourceIcon Mapper 用于资源点图标表的数据库操作
*
* @author Administrator
*/
@Mapper
@Repository
public interface LiResourceIconDao extends MyBaseMapper<LiResourceIcon> {
/**
* 查询资源点图标数量
*
* @param model
* @return
*/
Integer queryPageByCount(LiResourceIconModel model);
/**
* 查询资源点图标分页数据
*
* @param model
* @return
*/
List<LiResourceIcon> queryPageByList(LiResourceIconModel model);
/**
* 获取资源点图标数据
*
* @param model
* @return
*/
List<LiResourceIcon> queryIconList(LiResourceIconModel model);
/**
* 获取资源点图标类型
*
* @param model
* @return
*/
List<LiResourceIcon> queryIconTypeList(LiResourceIconModel model);
}
package com.devplatform.admin.modules.liresource.dao;
import org.apache.ibatis.annotations.Mapper;
import com.devplatform.admin.modules.liresource.model.LiRoomModel;
import com.devplatform.admin.modules.liresource.bean.LiRoom;
import com.devplatform.common.dao.MyBaseMapper;
import java.util.List;
/**
* LiRoom Mapper
* 用于场景表的数据库操作
* @author 代码生成器产生
*
*/
@Mapper
public interface LiRoomDao extends MyBaseMapper<LiRoom> {
/**
* 查询分页数量
* @param model
* @return
*/
Integer queryPageByCount(LiRoomModel model);
/**
* 查询场景表分页数据
* @param model
* @return
*/
List<LiRoom> queryPageList(LiRoomModel model);
}
package com.devplatform.admin.modules.liresource.model;
import com.devplatform.admin.common.model.BaseModel;
/**
* 资源点图标表的Model <br>
*
* @author 代码生成器产生
*/
public class LiResourceIconModel extends BaseModel {
/** 主键*/
private java.lang.String id;
/** 图标类型(1默认)*/
private Integer type;
/** 图标类型名称*/
private String typeName;
/** 图标尺寸(1小,2中,3大)*/
private Integer size;
/** 图标路径*/
private java.lang.String path;
/** 名称*/
private java.lang.String name;
/** 排序值*/
private Integer orderNum;
/** 是否删除(0未删除,1已删除)*/
private Integer deleted;
/** 站点id*/
private java.lang.String stationId;
public String getStationId() {
return stationId;
}
public void setStationId(String stationId) {
this.stationId = stationId;
}
public String getTypeName() {
return typeName;
}
public void setTypeName(String typeName) {
this.typeName = typeName;
}
public Integer getOrderNum() {
return orderNum;
}
public void setOrderNum(Integer orderNum) {
this.orderNum = orderNum;
}
/** 主键的getter方法 */
public java.lang.String getId() {
return id;
}
/** 主键的setter方法 */
public void setId(java.lang.String id) {
this.id = id;
}
/** 图标类型(1默认)的getter方法 */
public Integer getType() {
return type;
}
/** 图标类型(1默认)的setter方法 */
public void setType(Integer type) {
this.type = type;
}
/** 图标尺寸(1小,2中,3大)的getter方法 */
public Integer getSize() {
return size;
}
/** 图标尺寸(1小,2中,3大)的setter方法 */
public void setSize(Integer size) {
this.size = size;
}
/** 图标路径的getter方法 */
public java.lang.String getPath() {
return path;
}
/** 图标路径的setter方法 */
public void setPath(java.lang.String path) {
this.path = path;
}
/** 名称的getter方法 */
public java.lang.String getName() {
return name;
}
/** 名称的setter方法 */
public void setName(java.lang.String name) {
this.name = name;
}
/** 是否删除(0未删除,1已删除)的getter方法 */
public Integer getDeleted() {
return deleted;
}
/** 是否删除(0未删除,1已删除)的setter方法 */
public void setDeleted(Integer deleted) {
this.deleted = deleted;
}
}
package com.devplatform.admin.modules.liresource.model;
import com.devplatform.admin.common.model.BaseModel;
import lombok.Data;
/**
* 场景表的Model
* <br>
* @author 代码生成器产生
*/
@Data
public class LiRoomModel extends BaseModel {
/** 主键id */
private java.lang.String id;
/** 所属站点 */
private java.lang.String stationId;
/** 所属区域 */
private java.lang.String mapId;
/** 名称 */
private java.lang.String name;
/** 编号 */
private java.lang.String code;
/** 创建人 */
private java.lang.String createUserId;
/** 创建时间 */
private java.util.Date createTime;
/** 修改人 */
private java.lang.String updateUserId;
/** 修改时间 */
private java.util.Date updateTime;
/** 是否已删除(0未删除,1已删除) */
private Integer deleted;
/** 系统标识 */
private java.lang.String sysSign;
/** 备用项1 */
private java.lang.String byx1;
/** 备用项2 */
private java.lang.String byx2;
/** 备用项3 */
private java.lang.String byx3;
}
package com.devplatform.admin.modules.liresource.service;
import com.devplatform.admin.modules.liresource.bean.LiResourceIcon;
import com.devplatform.admin.modules.liresource.model.LiResourceIconModel;
import com.devplatform.common.service.MyBaseService;
import java.util.List;
/**
* 资源点图标表的service接口 <br>
* <b>功能:</b>LiResourceIconService<br>
*
* @author 代码生成器产生
*/
public interface LiResourceIconService extends MyBaseService<LiResourceIcon> {
/**
* 查询资源点图标分页数据
*
* @param model
* @return
*/
List<LiResourceIcon> queryPageByList(LiResourceIconModel model);
/**
* 获取资源点图标数据
*
* @param model
* @return
*/
List<LiResourceIcon> queryIconList(LiResourceIconModel model);
/**
* 获取资源点图标类型
*
* @param model
* @return
*/
List<LiResourceIcon> queryIconTypeList(LiResourceIconModel model);
}
package com.devplatform.admin.modules.liresource.service;
import com.devplatform.common.service.MyBaseService;
import com.devplatform.admin.modules.liresource.bean.LiRoom;
import com.devplatform.admin.modules.liresource.model.LiRoomModel;
import java.util.List;
/**
* 场景表的service接口
* <br>
* <b>功能:</b>LiRoomService<br>
* @author 代码生成器产生
*/
public interface LiRoomService extends MyBaseService<LiRoom> {
/**
* 查询场景表分页数据
* @param model
* @return
*/
List<LiRoom> queryPageList(LiRoomModel model);
/**
* 根据ID删除场景表对象
* @param ids
* @param userId
* @return void
*/
void deleteByFlagByIds(String[] ids, String userId);
}
package com.devplatform.admin.modules.liresource.service.impl;
import com.devplatform.admin.modules.liresource.bean.LiResourceIcon;
import com.devplatform.admin.modules.liresource.dao.LiResourceIconDao;
import com.devplatform.admin.modules.liresource.model.LiResourceIconModel;
import com.devplatform.admin.modules.liresource.service.LiResourceIconService;
import com.devplatform.common.service.impl.MyBaseServiceImpl;
import java.util.List;
import org.springframework.stereotype.Service;
/**
* 资源点图标表的service接口实现类 <br>
* <b>功能:</b>LiResourceIconServiceImpl<br>
*
* @author 代码生成器产生
*/
@Service("liResourceIconService")
public class LiResourceIconServiceImpl extends MyBaseServiceImpl<LiResourceIconDao, LiResourceIcon>
implements LiResourceIconService {
@Override
public List<LiResourceIcon> queryPageByList(LiResourceIconModel model) {
Integer rowCount = baseMapper.queryPageByCount(model);
model.getPager().setRowCount(rowCount);
return baseMapper.queryPageByList(model);
}
@Override
public List<LiResourceIcon> queryIconList(LiResourceIconModel model) {
return baseMapper.queryIconList(model);
}
@Override
public List<LiResourceIcon> queryIconTypeList(LiResourceIconModel model) {
return baseMapper.queryIconTypeList(model);
}
}
package com.devplatform.admin.modules.liresource.service.impl;
import org.springframework.stereotype.Service;
import com.devplatform.admin.modules.liresource.model.LiRoomModel;
import com.devplatform.admin.modules.liresource.bean.LiRoom;
import com.devplatform.admin.modules.liresource.dao.LiRoomDao;
import com.devplatform.admin.modules.liresource.service.LiRoomService;
import com.devplatform.common.service.impl.MyBaseServiceImpl;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* 场景表的service接口实现类
* <br>
* <b>功能:</b>LiRoomServiceImpl<br>
* @author 代码生成器产生
*/
@Service("liRoomService")
public class LiRoomServiceImpl extends MyBaseServiceImpl<LiRoomDao, LiRoom> implements LiRoomService {
@Override
public List<LiRoom> queryPageList(LiRoomModel model) {
Integer rowCount = baseMapper.queryPageByCount(model);
model.getPager().setRowCount(rowCount);
return baseMapper.queryPageList(model);
}
@Override
public void deleteByFlagByIds(String[] ids, String userId){
//用来暂存所有要删除的对象
List<LiRoom> beans = new ArrayList<LiRoom>();
//遍历ids数组
for(String id: ids){
LiRoom temp = new LiRoom();
temp.setId(id);
//将数据标记为删除
temp.setDeleted(1);
temp.setUpdateUserId(userId);
temp.setUpdateTime(new Date());
//将要删除的对象存放在list中
beans.add(temp);
}
//调用批量更新操作
updateBatchById(beans);
}
}
<?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.devplatform.admin.modules.liresource.dao.LiResourceIconDao">
<!-- Result Map -->
<resultMap id="BaseResultMap" type="com.devplatform.admin.modules.liresource.bean.LiResourceIcon">
<result column="id" property="id"/>
<result column="type" property="type"/>
<result column="type_name" property="typeName"/>
<result column="size" property="size"/>
<result column="path" property="path"/>
<result column="name" property="name"/>
<result column="order_num" property="orderNum"/>
<result column="deleted" property="deleted"/>
<result column="station_id" property="stationId"/>
<result column="sys_sign" property="sysSign"/>
</resultMap>
<!-- li_resource_icon table all fields -->
<sql id="Base_Column_List">
id,type,type_name,size,path,name,order_num,deleted,station_id,sys_sign
</sql>
<!-- 公共查询条件 -->
<sql id="Example_Where_Clause">
where deleted=0
<if test="id!=null and id!=''">and id = #{id}</if>
<if test="type!=null ">and type = #{type}</if>
<if test="typeName!=null and typeName!='' ">and type_name = #{typeName}</if>
<if test="size!=null ">and size = #{size}</if>
<if test="path!=null and path!=''">and path = #{path}</if>
<if test="name!=null and name!=''">and name = #{name}</if>
<if test="orderNum!=null ">and order_num = #{orderNum}</if>
<if test="deleted!=null ">and deleted = #{deleted}</if>
<if test="stationId!=null and stationId!='' ">and station_id = #{stationId}</if>
<if test="sysSign!=null and sysSign!='' ">and sys_sign = #{sysSign}</if>
</sql>
<!--查询总数-->
<select id="queryPageByCount" parameterType="Object" resultType="java.lang.Integer">
select count(1) from li_resource_icon
<include refid="Example_Where_Clause"></include>
</select>
<select id="queryPageByList" parameterType="Object" resultMap="BaseResultMap">
select * from li_resource_icon
<include refid="Example_Where_Clause"></include>
<if test="pager.orderCondition != null and pager.orderCondition != ''">
${pager.orderCondition}
</if>
<if test="pager.mysqlQueryCondition != null and pager.mysqlQueryCondition != ''">
${pager.mysqlQueryCondition}
</if>
</select>
<select id="queryIconList" parameterType="Object" resultMap="BaseResultMap">
select * from li_resource_icon
<include refid="Example_Where_Clause"></include>
order by type, order_num
</select>
<select id="queryIconTypeList" parameterType="Object" resultMap="BaseResultMap">
select type,type_name from li_resource_icon
<include refid="Example_Where_Clause"></include>
group by type
order by type
</select>
</mapper>
<?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.devplatform.admin.modules.liresource.dao.LiRoomDao">
<!-- Result Map -->
<resultMap id="BaseResultMap" type="com.devplatform.admin.modules.liresource.bean.LiRoom">
<result column="id" property="id"/>
<result column="station_id" property="stationId"/>
<result column="map_id" property="mapId"/>
<result column="name" property="name"/>
<result column="code" property="code"/>
<result column="create_user_id" property="createUserId"/>
<result column="create_time" property="createTime"/>
<result column="update_user_id" property="updateUserId"/>
<result column="update_time" property="updateTime"/>
<result column="deleted" property="deleted"/>
<result column="sys_sign" property="sysSign"/>
<result column="byx1" property="byx1"/>
<result column="byx2" property="byx2"/>
<result column="byx3" property="byx3"/>
</resultMap>
<!-- li_room table all fields -->
<sql id="Base_Column_List">
id,station_id,map_id,name,code,create_user_id,create_time,update_user_id,update_time,deleted,sys_sign,byx1,byx2,byx3
</sql>
<!-- 公共查询条件 -->
<sql id="Example_Where_Clause">
where t.deleted=0
<if test="id!=null and id!=''">and t.id = #{id}</if>
<if test="stationId!=null and stationId!=''">and t.station_id = #{stationId}</if>
<if test="mapId!=null and mapId!=''">and t.map_id = #{mapId}</if>
<if test="name!=null and name!=''">and t.name = #{name}</if>
<if test="code!=null and code!=''">and t.code = #{code}</if>
<if test="createUserId!=null and createUserId!=''">and t.create_user_id = #{createUserId}</if>
<if test="createTime!=null ">and t.create_time = #{createTime}</if>
<if test="updateUserId!=null and updateUserId!=''">and t.update_user_id = #{updateUserId}</if>
<if test="updateTime!=null ">and t.update_time = #{updateTime}</if>
<if test="deleted!=null ">and t.deleted = #{deleted}</if>
<if test="sysSign!=null and sysSign!=''">and t.sys_sign = #{sysSign}</if>
<if test="byx1!=null and byx1!=''">and t.byx1 = #{byx1}</if>
<if test="byx2!=null and byx2!=''">and t.byx2 = #{byx2}</if>
<if test="byx3!=null and byx3!=''">and t.byx3 = #{byx3}</if>
</sql>
<select id="queryPageByCount" parameterType="Object" resultType="java.lang.Integer">
select count(1) from li_room t
<include refid="Example_Where_Clause"/>
</select>
<select id="queryPageList" parameterType="Object" resultMap="BaseResultMap">
select t.* from li_room t
<include refid="Example_Where_Clause"/>
<if test="pager.orderCondition != null and pager.orderCondition != ''">
${pager.orderCondition}
</if>
<if test="pager.mysqlQueryCondition != null and pager.mysqlQueryCondition != ''">
${pager.mysqlQueryCondition}
</if>
</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