提交权限修改
This commit is contained in:
@@ -161,6 +161,10 @@
|
||||
<artifactId>commons-jexl3</artifactId>
|
||||
<version>3.2.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.xinda</groupId>
|
||||
<artifactId>xinda-itsm</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.xinda.iot.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.xinda.itsm.domain.RepairOrder;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
@@ -57,6 +58,10 @@ public class AlertLog extends BaseEntity
|
||||
|
||||
private Long userId;
|
||||
|
||||
private Integer enable;
|
||||
private Long orderId;
|
||||
private RepairOrder order;
|
||||
|
||||
private String deviceName;
|
||||
|
||||
private Long deviceId;
|
||||
|
||||
@@ -148,4 +148,6 @@ public interface AlertMapper
|
||||
* @return 设备告警集合
|
||||
*/
|
||||
List<AlertSceneSendVO> listByAlertIds(Long sceneId);
|
||||
|
||||
List<Long> selectSceneByAlert(Long[] alertIds);
|
||||
}
|
||||
|
||||
@@ -37,6 +37,9 @@ public class ThingsModelDTO extends BaseEntity
|
||||
/** 标识符,产品下唯一 */
|
||||
private String identifier;
|
||||
|
||||
/** 排序 */
|
||||
private Integer order;
|
||||
|
||||
/** 模型类别(1-属性,2-功能,3-事件) */
|
||||
private Integer type;
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@ import com.xinda.iot.domain.Device;
|
||||
import com.xinda.iot.model.AlertCountVO;
|
||||
import com.xinda.iot.model.param.DataCenterParam;
|
||||
import com.xinda.iot.model.DeviceAlertCount;
|
||||
import com.xinda.itsm.domain.RepairOrder;
|
||||
import com.xinda.itsm.mapper.RepairOrderMapper;
|
||||
import com.xinda.system.mapper.SysUserMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
@@ -42,6 +44,9 @@ public class AlertLogServiceImpl implements IAlertLogService {
|
||||
|
||||
@Resource
|
||||
private SysUserMapper sysUserMapper;
|
||||
|
||||
@Resource
|
||||
private RepairOrderMapper repairOrderMapper;
|
||||
/**
|
||||
* 查询设备告警
|
||||
*
|
||||
@@ -184,6 +189,11 @@ public class AlertLogServiceImpl implements IAlertLogService {
|
||||
// 1=不需要处理,2=未处理,3=已处理
|
||||
alertLog.setStatus(3);
|
||||
}
|
||||
if (alertLog.getEnable()==1) {
|
||||
RepairOrder order = alertLog.getOrder();
|
||||
repairOrderMapper.insertRepairOrder(order);
|
||||
alertLog.setOrderId(order.getId());
|
||||
}
|
||||
return alertLogMapper.updateAlertLog(alertLog);
|
||||
}
|
||||
|
||||
|
||||
@@ -242,6 +242,9 @@ public class AlertServiceImpl implements IAlertService {
|
||||
}
|
||||
alertMapper.deleteAlertSceneByAlertIds(alertIds);
|
||||
}
|
||||
// 将 List<Long> 转换为 Long[]
|
||||
Long[] sceneIds = alertMapper.selectSceneByAlert(alertIds).toArray(new Long[0]);
|
||||
sceneService.deleteSceneBySceneIds(sceneIds);
|
||||
// 批量删除告警场景
|
||||
alertMapper.deleteAlertSceneByAlertIds(alertIds);
|
||||
// 批量删除告警通知模版配置
|
||||
@@ -259,6 +262,8 @@ public class AlertServiceImpl implements IAlertService {
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int deleteAlertByAlertId(Long alertId) {
|
||||
Long[] sceneIds = alertMapper.selectSceneByAlert(new Long[]{alertId}).toArray(new Long[0]);
|
||||
sceneService.deleteSceneBySceneIds(sceneIds);
|
||||
// 批量删除告警场景
|
||||
alertMapper.deleteAlertSceneByAlertIds(new Long[]{alertId});
|
||||
// 批量删除告警通知模版配置
|
||||
|
||||
@@ -22,6 +22,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="userId" column="user_id"/>
|
||||
<result property="sceneId" column="scene_id"/>
|
||||
<result property="sceneName" column="scene_name"/>
|
||||
<result property="enable" column="enable"/>
|
||||
<result property="orderId" column="order_id"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="com.xinda.iot.model.DeviceAlertCount" id="DeviceAlertCount">
|
||||
@@ -34,11 +36,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAlertLogVo">
|
||||
select alert_log_id, alert_name, alert_level, status, product_id, detail, serial_number, create_by, create_time, remark, device_name, user_id from iot_alert_log
|
||||
select alert_log_id, alert_name, alert_level, status, product_id, detail, serial_number, create_by, create_time, remark, device_name, user_id,enable,order_id from iot_alert_log
|
||||
</sql>
|
||||
|
||||
<select id="selectAlertLogList" parameterType="com.xinda.iot.domain.AlertLog" resultMap="AlertLogResult">
|
||||
select distinct al.alert_log_id, al.alert_name, al.alert_level, al.status, al.product_id, al.detail, al.serial_number, al.create_time, al.remark, al.device_name, al.user_id
|
||||
select distinct al.alert_log_id, al.alert_name, al.alert_level, al.status, al.product_id, al.detail, al.serial_number, al.create_time, al.remark, al.device_name, al.user_id,al.enable,al.order_id
|
||||
from iot_alert_log al
|
||||
<where>
|
||||
<if test="alertName != null and alertName != ''"> and al.alert_name like concat('%', #{alertName}, '%')</if>
|
||||
@@ -55,7 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="selectAlertLogListAndScene" parameterType="com.xinda.iot.domain.AlertLog" resultMap="AlertLogResult">
|
||||
select al.alert_log_id, al.alert_name, al.alert_level, al.status, al.product_id, al.detail,
|
||||
al.serial_number, al.create_time, al.remark, al.device_name, al.user_id,
|
||||
al.serial_number, al.create_time, al.remark, al.device_name, al.user_id,al.enable,al.order_id,
|
||||
s.scene_id,s.scene_name
|
||||
from iot_alert_log al
|
||||
left join iot_scene s on CAST(COALESCE(NULLIF(TRIM(al.create_by), ''), 0) AS signed) = s.scene_id
|
||||
@@ -204,6 +206,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="deviceName != null and deviceName != ''">#{deviceName},</if>
|
||||
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@@ -238,6 +241,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="enable != null">enable =#{enable},</if>
|
||||
<if test="orderId != null">orderId =#{orderId},</if>
|
||||
</trim>
|
||||
where alert_log_id = #{alertLogId}
|
||||
</update>
|
||||
|
||||
@@ -221,4 +221,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectSceneByAlert" resultType="Long">
|
||||
select scene_id
|
||||
from iot_alert_scene
|
||||
where alert_id in
|
||||
<foreach item="alertId" collection="array" open="(" separator="," close=")">
|
||||
#{alertId}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -750,17 +750,17 @@
|
||||
|
||||
(
|
||||
select count(product_id)
|
||||
from iot_product
|
||||
<!-- <where>-->
|
||||
<!-- <if test="deptId != null and deptId != 0">-->
|
||||
<!-- and d.user_id in (SELECT-->
|
||||
<!-- u.user_id-->
|
||||
<!-- FROM-->
|
||||
<!-- sys_user u-->
|
||||
<!-- WHERE-->
|
||||
<!-- u.dept_id IN ( SELECT dept_id FROM sys_dept WHERE find_in_set(#{deptId}, ancestors) OR dept_id = #{deptId}))-->
|
||||
<!-- </if>-->
|
||||
<!-- </where>-->
|
||||
from iot_product p
|
||||
<where>
|
||||
<if test="deptId != null and deptId != 0">
|
||||
and p.tenant_id in (SELECT
|
||||
u.user_id
|
||||
FROM
|
||||
sys_user u
|
||||
WHERE
|
||||
u.dept_id IN ( SELECT dept_id FROM sys_dept WHERE find_in_set(#{deptId}, ancestors) OR dept_id = #{deptId}))
|
||||
</if>
|
||||
</where>
|
||||
) as productCount,
|
||||
|
||||
<!-- <!–告警设备数量–>-->
|
||||
|
||||
@@ -24,6 +24,8 @@ public class SysNotice extends BaseEntity
|
||||
@ApiModelProperty("公告ID")
|
||||
private Long noticeId;
|
||||
|
||||
private Long deptId;
|
||||
|
||||
/** 公告标题 */
|
||||
@ApiModelProperty("公告标题")
|
||||
private String noticeTitle;
|
||||
@@ -93,6 +95,14 @@ public class SysNotice extends BaseEntity
|
||||
return status;
|
||||
}
|
||||
|
||||
public Long getDeptId() {
|
||||
return deptId;
|
||||
}
|
||||
|
||||
public void setDeptId(Long deptId) {
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
|
||||
@@ -57,6 +57,8 @@ public class SysOperLog extends BaseEntity
|
||||
@Excel(name = "操作人员")
|
||||
private String operName;
|
||||
|
||||
private Long DeptId;
|
||||
|
||||
/** 部门名称 */
|
||||
@ApiModelProperty("部门名称")
|
||||
@Excel(name = "部门名称")
|
||||
@@ -272,4 +274,12 @@ public class SysOperLog extends BaseEntity
|
||||
{
|
||||
this.operTime = operTime;
|
||||
}
|
||||
|
||||
public Long getDeptId() {
|
||||
return DeptId;
|
||||
}
|
||||
|
||||
public void setDeptId(Long deptId) {
|
||||
DeptId = deptId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.xinda.system.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.xinda.common.annotation.Excel;
|
||||
import com.xinda.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 系统消息对象 sys_sms
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2025-05-08
|
||||
*/
|
||||
@ApiModel(value = "SysSms",description = "系统消息 sys_sms")
|
||||
@Data
|
||||
public class SysSms extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 公告ID */
|
||||
private Long smsId;
|
||||
|
||||
/** 公告标题 */
|
||||
@Excel(name = "公告标题")
|
||||
@ApiModelProperty("公告标题")
|
||||
private String smsTitle;
|
||||
|
||||
/** 公告内容 */
|
||||
@Excel(name = "公告内容")
|
||||
@ApiModelProperty("公告内容")
|
||||
private String smsContent;
|
||||
|
||||
/** 公告状态(0正常 1关闭) */
|
||||
private String status;
|
||||
|
||||
}
|
||||
@@ -153,4 +153,6 @@ public interface SysDeptMapper
|
||||
* @return java.lang.Long
|
||||
*/
|
||||
Long selectRoleIdByDeptId(Long deptId);
|
||||
|
||||
List<SysDept> selectOrgList();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.xinda.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.xinda.system.domain.SysSms;
|
||||
|
||||
/**
|
||||
* 系统消息Mapper接口
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2025-05-08
|
||||
*/
|
||||
public interface SysSmsMapper
|
||||
{
|
||||
/**
|
||||
* 查询系统消息
|
||||
*
|
||||
* @param smsId 系统消息主键
|
||||
* @return 系统消息
|
||||
*/
|
||||
public SysSms selectSysSmsBySmsId(Long smsId);
|
||||
|
||||
/**
|
||||
* 查询系统消息列表
|
||||
*
|
||||
* @param sysSms 系统消息
|
||||
* @return 系统消息集合
|
||||
*/
|
||||
public List<SysSms> selectSysSmsList(SysSms sysSms);
|
||||
|
||||
/**
|
||||
* 新增系统消息
|
||||
*
|
||||
* @param sysSms 系统消息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysSms(SysSms sysSms);
|
||||
|
||||
/**
|
||||
* 修改系统消息
|
||||
*
|
||||
* @param sysSms 系统消息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysSms(SysSms sysSms);
|
||||
|
||||
/**
|
||||
* 删除系统消息
|
||||
*
|
||||
* @param smsId 系统消息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysSmsBySmsId(Long smsId);
|
||||
|
||||
/**
|
||||
* 批量删除系统消息
|
||||
*
|
||||
* @param smsIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysSmsBySmsIds(Long[] smsIds);
|
||||
}
|
||||
@@ -155,4 +155,6 @@ public interface ISysDeptService
|
||||
Long selectRoleIdByDeptId(Long deptId);
|
||||
|
||||
public List<TreeProSelect> selectDeptProTreeList(SysDept dept);
|
||||
|
||||
List<SysDept> selectOrgList();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.xinda.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.xinda.system.domain.SysSms;
|
||||
|
||||
/**
|
||||
* 系统消息Service接口
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2025-05-08
|
||||
*/
|
||||
public interface ISysSmsService
|
||||
{
|
||||
/**
|
||||
* 查询系统消息
|
||||
*
|
||||
* @param smsId 系统消息主键
|
||||
* @return 系统消息
|
||||
*/
|
||||
public SysSms selectSysSmsBySmsId(Long smsId);
|
||||
|
||||
/**
|
||||
* 查询系统消息列表
|
||||
*
|
||||
* @param sysSms 系统消息
|
||||
* @return 系统消息集合
|
||||
*/
|
||||
public List<SysSms> selectSysSmsList(SysSms sysSms);
|
||||
|
||||
/**
|
||||
* 新增系统消息
|
||||
*
|
||||
* @param sysSms 系统消息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysSms(SysSms sysSms);
|
||||
|
||||
/**
|
||||
* 修改系统消息
|
||||
*
|
||||
* @param sysSms 系统消息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysSms(SysSms sysSms);
|
||||
|
||||
/**
|
||||
* 批量删除系统消息
|
||||
*
|
||||
* @param smsIds 需要删除的系统消息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysSmsBySmsIds(Long[] smsIds);
|
||||
|
||||
/**
|
||||
* 删除系统消息信息
|
||||
*
|
||||
* @param smsId 系统消息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysSmsBySmsId(Long smsId);
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.xinda.system.service;
|
||||
import com.xinda.common.core.domain.entity.SysUser;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 用户 业务层
|
||||
@@ -254,4 +255,5 @@ public interface ISysUserService
|
||||
* @return
|
||||
*/
|
||||
List<SysUser> selectByDeptId();
|
||||
|
||||
}
|
||||
|
||||
@@ -50,6 +50,13 @@ public class SysDeptServiceImpl implements ISysDeptService
|
||||
@Resource
|
||||
private SysRoleDeptMapper sysRoleDeptMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public List<SysDept> selectOrgList() {
|
||||
List<SysDept> depts = deptMapper.selectOrgList();
|
||||
return depts;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询部门管理数据
|
||||
*
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
package com.xinda.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.xinda.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.xinda.system.mapper.SysSmsMapper;
|
||||
import com.xinda.system.domain.SysSms;
|
||||
import com.xinda.system.service.ISysSmsService;
|
||||
|
||||
/**
|
||||
* 系统消息Service业务层处理
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2025-05-08
|
||||
*/
|
||||
@Service
|
||||
public class SysSmsServiceImpl implements ISysSmsService
|
||||
{
|
||||
@Autowired
|
||||
private SysSmsMapper sysSmsMapper;
|
||||
|
||||
/**
|
||||
* 查询系统消息
|
||||
*
|
||||
* @param smsId 系统消息主键
|
||||
* @return 系统消息
|
||||
*/
|
||||
@Override
|
||||
public SysSms selectSysSmsBySmsId(Long smsId)
|
||||
{
|
||||
return sysSmsMapper.selectSysSmsBySmsId(smsId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询系统消息列表
|
||||
*
|
||||
* @param sysSms 系统消息
|
||||
* @return 系统消息
|
||||
*/
|
||||
@Override
|
||||
public List<SysSms> selectSysSmsList(SysSms sysSms)
|
||||
{
|
||||
return sysSmsMapper.selectSysSmsList(sysSms);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增系统消息
|
||||
*
|
||||
* @param sysSms 系统消息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSysSms(SysSms sysSms)
|
||||
{
|
||||
sysSms.setCreateTime(DateUtils.getNowDate());
|
||||
return sysSmsMapper.insertSysSms(sysSms);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改系统消息
|
||||
*
|
||||
* @param sysSms 系统消息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSysSms(SysSms sysSms)
|
||||
{
|
||||
sysSms.setUpdateTime(DateUtils.getNowDate());
|
||||
return sysSmsMapper.updateSysSms(sysSms);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除系统消息
|
||||
*
|
||||
* @param smsIds 需要删除的系统消息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysSmsBySmsIds(Long[] smsIds)
|
||||
{
|
||||
return sysSmsMapper.deleteSysSmsBySmsIds(smsIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除系统消息信息
|
||||
*
|
||||
* @param smsId 系统消息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysSmsBySmsId(Long smsId)
|
||||
{
|
||||
return sysSmsMapper.deleteSysSmsBySmsId(smsId);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.xinda.system.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.xinda.common.annotation.DataScope;
|
||||
import com.xinda.common.constant.UserConstants;
|
||||
import com.xinda.common.core.domain.entity.SysDept;
|
||||
@@ -34,8 +35,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.validation.Validator;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.xinda.common.utils.SecurityUtils.getLoginUser;
|
||||
@@ -72,6 +72,7 @@ public class SysUserServiceImpl implements ISysUserService
|
||||
@Autowired
|
||||
protected Validator validator;
|
||||
|
||||
|
||||
/**
|
||||
* 根据条件分页查询用户列表
|
||||
*
|
||||
|
||||
@@ -50,6 +50,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
order by d.parent_id, d.order_num
|
||||
</select>
|
||||
|
||||
<select id="selectOrgList" resultMap="SysDeptResult">
|
||||
<include refid="selectDeptVo"/>
|
||||
where d.del_flag = '0' AND dept_type = '1'
|
||||
order by d.parent_id, d.order_num
|
||||
</select>
|
||||
|
||||
<select id="selectDeptListByRoleId" resultType="Long">
|
||||
select d.dept_id
|
||||
from sys_dept d
|
||||
|
||||
@@ -6,6 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<resultMap type="SysNotice" id="SysNoticeResult">
|
||||
<result property="noticeId" column="notice_id" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="noticeTitle" column="notice_title" />
|
||||
<result property="noticeType" column="notice_type" />
|
||||
<result property="noticeContent" column="notice_content" />
|
||||
@@ -18,32 +19,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectNoticeVo">
|
||||
select notice_id, notice_title, notice_type, cast(notice_content as char) as notice_content, status, create_by, create_time, update_by, update_time, remark
|
||||
from sys_notice
|
||||
select n.notice_id, n.dept_id, n.notice_title, n.notice_type, cast(n.notice_content as char) as notice_content, n.status, n.create_by, n.create_time, n.update_by, n.update_time, n.remark
|
||||
from sys_notice n
|
||||
</sql>
|
||||
|
||||
<select id="selectNoticeById" parameterType="Long" resultMap="SysNoticeResult">
|
||||
<include refid="selectNoticeVo"/>
|
||||
where notice_id = #{noticeId}
|
||||
where n.notice_id = #{noticeId}
|
||||
</select>
|
||||
|
||||
<select id="selectNoticeList" parameterType="SysNotice" resultMap="SysNoticeResult">
|
||||
<include refid="selectNoticeVo"/>
|
||||
<where>
|
||||
<if test="deptId != null and deptId != 0 ">
|
||||
and
|
||||
( n.dept_id in (SELECT de.dept_id FROM sys_dept de
|
||||
WHERE FIND_IN_SET(#{deptId}, de.ancestors) OR de.dept_id = #{deptId})
|
||||
)
|
||||
</if>
|
||||
<if test="noticeTitle != null and noticeTitle != ''">
|
||||
AND notice_title like concat('%', #{noticeTitle}, '%')
|
||||
AND n.notice_title like concat('%', #{noticeTitle}, '%')
|
||||
</if>
|
||||
<if test="noticeType != null and noticeType != ''">
|
||||
AND notice_type = #{noticeType}
|
||||
AND n.notice_type = #{noticeType}
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
AND create_by like concat('%', #{createBy}, '%')
|
||||
AND n.create_by like concat('%', #{createBy}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insertNotice" parameterType="SysNotice">
|
||||
insert into sys_notice (
|
||||
<if test="deptId != null and deptId != 0">dept_id,</if>
|
||||
<if test="noticeTitle != null and noticeTitle != '' ">notice_title, </if>
|
||||
<if test="noticeType != null and noticeType != '' ">notice_type, </if>
|
||||
<if test="noticeContent != null and noticeContent != '' ">notice_content, </if>
|
||||
@@ -52,6 +60,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="deptId != null and deptId != ''">#{deptId},</if>
|
||||
<if test="noticeTitle != null and noticeTitle != ''">#{noticeTitle}, </if>
|
||||
<if test="noticeType != null and noticeType != ''">#{noticeType}, </if>
|
||||
<if test="noticeContent != null and noticeContent != ''">#{noticeContent}, </if>
|
||||
@@ -65,6 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<update id="updateNotice" parameterType="SysNotice">
|
||||
update sys_notice
|
||||
<set>
|
||||
<if test="deptId != null and deptId != 0">dept_id = #{deptId},</if>
|
||||
<if test="noticeTitle != null and noticeTitle != ''">notice_title = #{noticeTitle}, </if>
|
||||
<if test="noticeType != null and noticeType != ''">notice_type = #{noticeType}, </if>
|
||||
<if test="noticeContent != null">notice_content = #{noticeContent}, </if>
|
||||
|
||||
@@ -12,6 +12,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="requestMethod" column="request_method" />
|
||||
<result property="operatorType" column="operator_type" />
|
||||
<result property="operName" column="oper_name" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="deptName" column="dept_name" />
|
||||
<result property="operUrl" column="oper_url" />
|
||||
<result property="operIp" column="oper_ip" />
|
||||
@@ -24,13 +25,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectOperLogVo">
|
||||
select oper_id, title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time
|
||||
select oper_id, title, business_type, method, request_method, operator_type, oper_name, dept_id, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time
|
||||
from sys_oper_log
|
||||
</sql>
|
||||
|
||||
<insert id="insertOperlog" parameterType="SysOperLog">
|
||||
insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time)
|
||||
values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, sysdate())
|
||||
insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name,dept_id, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time)
|
||||
values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptId},#{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, sysdate())
|
||||
</insert>
|
||||
|
||||
<select id="selectOperLogList" parameterType="SysOperLog" resultMap="SysOperLogResult">
|
||||
@@ -54,6 +55,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="operName != null and operName != ''">
|
||||
AND oper_name like concat('%', #{operName}, '%')
|
||||
</if>
|
||||
<if test="deptId != null and deptId != 0 ">
|
||||
and
|
||||
( dept_id in (SELECT de.dept_id FROM sys_dept de
|
||||
WHERE FIND_IN_SET(#{deptId}, de.ancestors) OR de.dept_id = #{deptId})
|
||||
)
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
and date_format(oper_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
<?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.xinda.system.mapper.SysSmsMapper">
|
||||
|
||||
<resultMap type="SysSms" id="SysSmsResult">
|
||||
<result property="smsId" column="sms_id" />
|
||||
<result property="smsTitle" column="sms_title" />
|
||||
<result property="smsContent" column="sms_content" />
|
||||
<result property="status" column="status" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysSmsVo">
|
||||
select sms_id, sms_title, sms_content, status, create_by, create_time, update_by, update_time, remark from sys_sms
|
||||
</sql>
|
||||
|
||||
<select id="selectSysSmsList" parameterType="SysSms" resultMap="SysSmsResult">
|
||||
<include refid="selectSysSmsVo"/>
|
||||
<where>
|
||||
<if test="smsTitle != null and smsTitle != ''"> and sms_title = #{smsTitle}</if>
|
||||
<if test="smsContent != null and smsContent != ''"> and sms_content = #{smsContent}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysSmsBySmsId" parameterType="Long" resultMap="SysSmsResult">
|
||||
<include refid="selectSysSmsVo"/>
|
||||
where sms_id = #{smsId}
|
||||
</select>
|
||||
|
||||
<insert id="insertSysSms" parameterType="SysSms" useGeneratedKeys="true" keyProperty="smsId">
|
||||
insert into sys_sms
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="smsTitle != null and smsTitle != ''">sms_title,</if>
|
||||
<if test="smsContent != null">sms_content,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="smsTitle != null and smsTitle != ''">#{smsTitle},</if>
|
||||
<if test="smsContent != null">#{smsContent},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysSms" parameterType="SysSms">
|
||||
update sys_sms
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="smsTitle != null and smsTitle != ''">sms_title = #{smsTitle},</if>
|
||||
<if test="smsContent != null">sms_content = #{smsContent},</if>
|
||||
<if test="status != null">status = #{status},</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>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where sms_id = #{smsId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysSmsBySmsId" parameterType="Long">
|
||||
delete from sys_sms where sms_id = #{smsId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysSmsBySmsIds" parameterType="String">
|
||||
delete from sys_sms where sms_id in
|
||||
<foreach item="smsId" collection="array" open="(" separator="," close=")">
|
||||
#{smsId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user