质量系统添加操作日志
parent
70896e96f9
commit
591c420fcf
@ -0,0 +1,111 @@
|
||||
package com.foreverwin.mesnac.common.controller;
|
||||
|
||||
import com.foreverwin.mesnac.common.model.OperLog;
|
||||
import com.foreverwin.modular.core.util.R;
|
||||
import com.foreverwin.modular.core.util.FrontPage;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.foreverwin.mesnac.common.service.OperLogService;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author YinQ
|
||||
* @since 2023-02-01
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/Z-OPER-LOG")
|
||||
public class OperLogController {
|
||||
|
||||
@Autowired
|
||||
public OperLogService operLogService;
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("/{id:.+}")
|
||||
public R getOperLogById(@PathVariable String id) {
|
||||
return R.ok( operLogService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有数据
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("")
|
||||
public R getOperLogList(OperLog operLog){
|
||||
List<OperLog> result;
|
||||
QueryWrapper<OperLog> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(operLog);
|
||||
result = operLogService.list(queryWrapper);
|
||||
return R.ok(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询数据
|
||||
*
|
||||
* @param frontPage 分页信息
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("/page")
|
||||
public R page(FrontPage<OperLog> frontPage, OperLog operLog){
|
||||
IPage result;
|
||||
QueryWrapper<OperLog> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(operLog);
|
||||
result = operLogService.page(frontPage.getPagePlus(), queryWrapper);
|
||||
return R.ok(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* @param operLog 传递的实体
|
||||
* @return null 失败 实体成功
|
||||
*/
|
||||
@PostMapping
|
||||
public R save(@RequestBody OperLog operLog) {
|
||||
return R.ok(operLogService.save(operLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param operLog 传递的实体
|
||||
* @return null 失败 实体成功
|
||||
*/
|
||||
@PutMapping
|
||||
public R updateById(@RequestBody OperLog operLog) {
|
||||
return R.ok(operLogService.updateById(operLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id删除对象
|
||||
* @param id 实体ID
|
||||
* @return 0 失败 1 成功
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}")
|
||||
public R removeById(@PathVariable("id") String id){
|
||||
return R.ok(operLogService.removeById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除对象
|
||||
* @param ids 实体集合ID
|
||||
* @return 0 失败 1 成功
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(method = RequestMethod.POST, value = "/delete-batch")
|
||||
public R removeByIds(List<String> ids){
|
||||
return R.ok(operLogService.removeByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.foreverwin.mesnac.common.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.foreverwin.mesnac.common.model.OperLog;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 操作日志记录 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author YinQ
|
||||
* @since 2023-02-01
|
||||
*/
|
||||
@Repository
|
||||
public interface OperLogMapper extends BaseMapper<OperLog> {
|
||||
|
||||
}
|
@ -0,0 +1,199 @@
|
||||
package com.foreverwin.mesnac.common.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.foreverwin.mesnac.common.model.ExcelColumn;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 操作日志记录
|
||||
* </p>
|
||||
*
|
||||
* @author YinQ
|
||||
* @since 2023-02-01
|
||||
*/
|
||||
|
||||
@TableName("Z_OPER_LOG")
|
||||
public class OperLog extends Model<OperLog> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ExcelColumn(value = "主键")
|
||||
@TableId(value = "HANDLE", type = IdType.INPUT)
|
||||
private String handle;
|
||||
/**
|
||||
* 场地
|
||||
*/
|
||||
@ExcelColumn(value = "场地")
|
||||
@TableField("SITE")
|
||||
private String site;
|
||||
/**
|
||||
* 业务标题
|
||||
*/
|
||||
@ExcelColumn(value = "业务标题")
|
||||
@TableField("TITLE")
|
||||
private String title;
|
||||
/**
|
||||
* 方法名称
|
||||
*/
|
||||
@ExcelColumn(value = "方法名称")
|
||||
@TableField("METHOD")
|
||||
private String method;
|
||||
/**
|
||||
* 请求参数
|
||||
*/
|
||||
@ExcelColumn(value = "请求参数")
|
||||
@TableField("OPER_PARAM")
|
||||
private String operParam;
|
||||
/**
|
||||
* 返回参数
|
||||
*/
|
||||
@ExcelColumn(value = "返回参数")
|
||||
@TableField("RESULT")
|
||||
private String result;
|
||||
/**
|
||||
* 错误消息
|
||||
*/
|
||||
@ExcelColumn(value = "错误消息")
|
||||
@TableField("ERROR_MSG")
|
||||
private String errorMsg;
|
||||
/**
|
||||
* 操作人
|
||||
*/
|
||||
@ExcelColumn(value = "操作人")
|
||||
@TableField("OPER_USER")
|
||||
private String operUser;
|
||||
/**
|
||||
* 操作时间
|
||||
*/
|
||||
@ExcelColumn(value = "操作时间")
|
||||
@TableField("OPER_TIME")
|
||||
private LocalDateTime operTime;
|
||||
|
||||
|
||||
public String getHandle() {
|
||||
return handle;
|
||||
}
|
||||
|
||||
public void setHandle(String handle) {
|
||||
this.handle = handle;
|
||||
}
|
||||
|
||||
public String getSite() {
|
||||
return site;
|
||||
}
|
||||
|
||||
public void setSite(String site) {
|
||||
this.site = site;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getMethod() {
|
||||
return method;
|
||||
}
|
||||
|
||||
public void setMethod(String method) {
|
||||
this.method = method;
|
||||
}
|
||||
|
||||
public String getOperParam() {
|
||||
return operParam;
|
||||
}
|
||||
|
||||
public void setOperParam(String operParam) {
|
||||
this.operParam = operParam;
|
||||
}
|
||||
|
||||
public String getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(String result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public String getErrorMsg() {
|
||||
return errorMsg;
|
||||
}
|
||||
|
||||
public void setErrorMsg(String errorMsg) {
|
||||
this.errorMsg = errorMsg;
|
||||
}
|
||||
|
||||
public String getOperUser() {
|
||||
return operUser;
|
||||
}
|
||||
|
||||
public void setOperUser(String operUser) {
|
||||
this.operUser = operUser;
|
||||
}
|
||||
|
||||
public LocalDateTime getOperTime() {
|
||||
return operTime;
|
||||
}
|
||||
|
||||
public void setOperTime(LocalDateTime operTime) {
|
||||
this.operTime = operTime;
|
||||
}
|
||||
|
||||
public static final String HANDLE = "HANDLE";
|
||||
|
||||
public static final String SITE = "SITE";
|
||||
|
||||
public static final String TITLE = "TITLE";
|
||||
|
||||
public static final String METHOD = "METHOD";
|
||||
|
||||
public static final String OPER_PARAM = "OPER_PARAM";
|
||||
|
||||
public static final String RESULT = "RESULT";
|
||||
|
||||
public static final String ERROR_MSG = "ERROR_MSG";
|
||||
|
||||
public static final String OPER_USER = "OPER_USER";
|
||||
|
||||
public static final String OPER_TIME = "OPER_TIME";
|
||||
|
||||
|
||||
@Override
|
||||
protected Serializable pkVal() {
|
||||
return this.handle;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OperLog{" +
|
||||
"handle = " + handle +
|
||||
", site = " + site +
|
||||
", title = " + title +
|
||||
", method = " + method +
|
||||
", operParam = " + operParam +
|
||||
", result = " + result +
|
||||
", errorMsg = " + errorMsg +
|
||||
", operUser = " + operUser +
|
||||
", operTime = " + operTime +
|
||||
"}";
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.foreverwin.mesnac.common.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.foreverwin.mesnac.common.model.OperLog;
|
||||
import com.foreverwin.modular.core.util.FrontPage;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 操作日志记录 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author YinQ
|
||||
* @since 2023-02-01
|
||||
*/
|
||||
public interface OperLogService extends IService<OperLog> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param frontPage
|
||||
* @return
|
||||
*/
|
||||
IPage<OperLog> selectPage(FrontPage<OperLog> frontPage, OperLog operLog);
|
||||
|
||||
List<OperLog> selectList(OperLog operLog);
|
||||
|
||||
void logSave(OperLog operLog);
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package com.foreverwin.mesnac.common.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.foreverwin.mesnac.common.mapper.OperLogMapper;
|
||||
import com.foreverwin.mesnac.common.model.OperLog;
|
||||
import com.foreverwin.mesnac.common.service.OperLogService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.foreverwin.modular.core.util.FrontPage;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
/**
|
||||
* <p>
|
||||
* 操作日志记录 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author YinQ
|
||||
* @since 2023-02-01
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class OperLogServiceImpl extends ServiceImpl<OperLogMapper, OperLog> implements OperLogService {
|
||||
|
||||
|
||||
@Autowired
|
||||
private OperLogMapper operLogMapper;
|
||||
|
||||
@Override
|
||||
public IPage<OperLog> selectPage(FrontPage<OperLog> frontPage, OperLog operLog) {
|
||||
QueryWrapper<OperLog> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(operLog);
|
||||
return super.page(frontPage.getPagePlus(), queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OperLog> selectList(OperLog operLog) {
|
||||
QueryWrapper<OperLog> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(operLog);
|
||||
return super.list(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void logSave(OperLog operLog) {
|
||||
operLogMapper.insert(operLog);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,386 @@
|
||||
<?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.foreverwin.mesnac.common.mapper.OperLogMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.common.model.OperLog">
|
||||
<id column="HANDLE" property="handle" />
|
||||
<result column="SITE" property="site" />
|
||||
<result column="TITLE" property="title" />
|
||||
<result column="METHOD" property="method" />
|
||||
<result column="OPER_PARAM" property="operParam" />
|
||||
<result column="RESULT" property="result" />
|
||||
<result column="ERROR_MSG" property="errorMsg" />
|
||||
<result column="OPER_USER" property="operUser" />
|
||||
<result column="OPER_TIME" property="operTime" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
HANDLE, SITE, TITLE, METHOD, OPER_PARAM, RESULT, ERROR_MSG, OPER_USER, OPER_TIME
|
||||
</sql>
|
||||
|
||||
<!-- BaseMapper标准查询/修改/删除 -->
|
||||
<select id="selectById" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"></include> FROM Z_OPER_LOG WHERE HANDLE=#{handle}
|
||||
</select>
|
||||
|
||||
<select id="selectByMap" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"></include>
|
||||
FROM Z_OPER_LOG
|
||||
<if test="cm!=null and !cm.isEmpty">
|
||||
<where>
|
||||
<foreach collection="cm.keys" item="k" separator="AND">
|
||||
<if test="cm[k] != null">
|
||||
${k} = #{cm[${k}]}
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectBatchIds" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"></include>
|
||||
FROM Z_OPER_LOG WHERE HANDLE IN (
|
||||
<foreach item="item" index="index" collection="coll" separator=",">#{item}
|
||||
</foreach>)
|
||||
</select>
|
||||
|
||||
<select id="selectOne" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"></include> FROM Z_OPER_LOG
|
||||
<where>
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.title!=null"> AND TITLE=#{ew.entity.title}</if>
|
||||
<if test="ew.entity.method!=null"> AND METHOD=#{ew.entity.method}</if>
|
||||
<if test="ew.entity.operParam!=null"> AND OPER_PARAM=#{ew.entity.operParam}</if>
|
||||
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
|
||||
<if test="ew.entity.errorMsg!=null"> AND ERROR_MSG=#{ew.entity.errorMsg}</if>
|
||||
<if test="ew.entity.operUser!=null"> AND OPER_USER=#{ew.entity.operUser}</if>
|
||||
<if test="ew.entity.operTime!=null"> AND OPER_TIME=#{ew.entity.operTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCount" resultType="Integer">
|
||||
SELECT COUNT(1) FROM Z_OPER_LOG
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.title!=null"> AND TITLE=#{ew.entity.title}</if>
|
||||
<if test="ew.entity.method!=null"> AND METHOD=#{ew.entity.method}</if>
|
||||
<if test="ew.entity.operParam!=null"> AND OPER_PARAM=#{ew.entity.operParam}</if>
|
||||
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
|
||||
<if test="ew.entity.errorMsg!=null"> AND ERROR_MSG=#{ew.entity.errorMsg}</if>
|
||||
<if test="ew.entity.operUser!=null"> AND OPER_USER=#{ew.entity.operUser}</if>
|
||||
<if test="ew.entity.operTime!=null"> AND OPER_TIME=#{ew.entity.operTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectList" resultMap="BaseResultMap">
|
||||
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_OPER_LOG
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.title!=null"> AND TITLE=#{ew.entity.title}</if>
|
||||
<if test="ew.entity.method!=null"> AND METHOD=#{ew.entity.method}</if>
|
||||
<if test="ew.entity.operParam!=null"> AND OPER_PARAM=#{ew.entity.operParam}</if>
|
||||
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
|
||||
<if test="ew.entity.errorMsg!=null"> AND ERROR_MSG=#{ew.entity.errorMsg}</if>
|
||||
<if test="ew.entity.operUser!=null"> AND OPER_USER=#{ew.entity.operUser}</if>
|
||||
<if test="ew.entity.operTime!=null"> AND OPER_TIME=#{ew.entity.operTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectMaps" resultType="HashMap">
|
||||
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_OPER_LOG
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.title!=null"> AND TITLE=#{ew.entity.title}</if>
|
||||
<if test="ew.entity.method!=null"> AND METHOD=#{ew.entity.method}</if>
|
||||
<if test="ew.entity.operParam!=null"> AND OPER_PARAM=#{ew.entity.operParam}</if>
|
||||
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
|
||||
<if test="ew.entity.errorMsg!=null"> AND ERROR_MSG=#{ew.entity.errorMsg}</if>
|
||||
<if test="ew.entity.operUser!=null"> AND OPER_USER=#{ew.entity.operUser}</if>
|
||||
<if test="ew.entity.operTime!=null"> AND OPER_TIME=#{ew.entity.operTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectObjs" resultType="Object">
|
||||
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_OPER_LOG
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.title!=null"> AND TITLE=#{ew.entity.title}</if>
|
||||
<if test="ew.entity.method!=null"> AND METHOD=#{ew.entity.method}</if>
|
||||
<if test="ew.entity.operParam!=null"> AND OPER_PARAM=#{ew.entity.operParam}</if>
|
||||
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
|
||||
<if test="ew.entity.errorMsg!=null"> AND ERROR_MSG=#{ew.entity.errorMsg}</if>
|
||||
<if test="ew.entity.operUser!=null"> AND OPER_USER=#{ew.entity.operUser}</if>
|
||||
<if test="ew.entity.operTime!=null"> AND OPER_TIME=#{ew.entity.operTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectPage" resultMap="BaseResultMap">
|
||||
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_OPER_LOG
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.title!=null"> AND TITLE=#{ew.entity.title}</if>
|
||||
<if test="ew.entity.method!=null"> AND METHOD=#{ew.entity.method}</if>
|
||||
<if test="ew.entity.operParam!=null"> AND OPER_PARAM=#{ew.entity.operParam}</if>
|
||||
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
|
||||
<if test="ew.entity.errorMsg!=null"> AND ERROR_MSG=#{ew.entity.errorMsg}</if>
|
||||
<if test="ew.entity.operUser!=null"> AND OPER_USER=#{ew.entity.operUser}</if>
|
||||
<if test="ew.entity.operTime!=null"> AND OPER_TIME=#{ew.entity.operTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectMapsPage" resultType="HashMap">
|
||||
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_OPER_LOG
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.title!=null"> AND TITLE=#{ew.entity.title}</if>
|
||||
<if test="ew.entity.method!=null"> AND METHOD=#{ew.entity.method}</if>
|
||||
<if test="ew.entity.operParam!=null"> AND OPER_PARAM=#{ew.entity.operParam}</if>
|
||||
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
|
||||
<if test="ew.entity.errorMsg!=null"> AND ERROR_MSG=#{ew.entity.errorMsg}</if>
|
||||
<if test="ew.entity.operUser!=null"> AND OPER_USER=#{ew.entity.operUser}</if>
|
||||
<if test="ew.entity.operTime!=null"> AND OPER_TIME=#{ew.entity.operTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<insert id="insert" parameterType="com.foreverwin.mesnac.common.model.OperLog">
|
||||
INSERT INTO Z_OPER_LOG
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
HANDLE,
|
||||
<if test="site!=null">SITE,</if>
|
||||
<if test="title!=null">TITLE,</if>
|
||||
<if test="method!=null">METHOD,</if>
|
||||
<if test="operParam!=null">OPER_PARAM,</if>
|
||||
<if test="result!=null">RESULT,</if>
|
||||
<if test="errorMsg!=null">ERROR_MSG,</if>
|
||||
<if test="operUser!=null">OPER_USER,</if>
|
||||
<if test="operTime!=null">OPER_TIME,</if>
|
||||
</trim> VALUES
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
#{handle},
|
||||
<if test="site!=null">#{site},</if>
|
||||
<if test="title!=null">#{title},</if>
|
||||
<if test="method!=null">#{method},</if>
|
||||
<if test="operParam!=null">#{operParam},</if>
|
||||
<if test="result!=null">#{result},</if>
|
||||
<if test="errorMsg!=null">#{errorMsg},</if>
|
||||
<if test="operUser!=null">#{operUser},</if>
|
||||
<if test="operTime!=null">#{operTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.common.model.OperLog">
|
||||
INSERT INTO Z_OPER_LOG
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<include refid="Base_Column_List"></include>
|
||||
</trim> VALUES
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
#{handle},
|
||||
#{site},
|
||||
#{title},
|
||||
#{method},
|
||||
#{operParam},
|
||||
#{result},
|
||||
#{errorMsg},
|
||||
#{operUser},
|
||||
#{operTime},
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
<update id="updateById">
|
||||
UPDATE Z_OPER_LOG <trim prefix="SET" suffixOverrides=",">
|
||||
<if test="et.site!=null">SITE=#{et.site},</if>
|
||||
<if test="et.title!=null">TITLE=#{et.title},</if>
|
||||
<if test="et.method!=null">METHOD=#{et.method},</if>
|
||||
<if test="et.operParam!=null">OPER_PARAM=#{et.operParam},</if>
|
||||
<if test="et.result!=null">RESULT=#{et.result},</if>
|
||||
<if test="et.errorMsg!=null">ERROR_MSG=#{et.errorMsg},</if>
|
||||
<if test="et.operUser!=null">OPER_USER=#{et.operUser},</if>
|
||||
<if test="et.operTime!=null">OPER_TIME=#{et.operTime},</if>
|
||||
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
|
||||
</update>
|
||||
|
||||
|
||||
<update id="updateAllColumnById">
|
||||
UPDATE Z_OPER_LOG <trim prefix="SET" suffixOverrides=",">
|
||||
SITE=#{et.site},
|
||||
TITLE=#{et.title},
|
||||
METHOD=#{et.method},
|
||||
OPER_PARAM=#{et.operParam},
|
||||
RESULT=#{et.result},
|
||||
ERROR_MSG=#{et.errorMsg},
|
||||
OPER_USER=#{et.operUser},
|
||||
OPER_TIME=#{et.operTime},
|
||||
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
|
||||
</update>
|
||||
|
||||
|
||||
<update id="update">
|
||||
UPDATE Z_OPER_LOG <trim prefix="SET" suffixOverrides=",">
|
||||
<if test="et.site!=null">SITE=#{et.site},</if>
|
||||
<if test="et.title!=null">TITLE=#{et.title},</if>
|
||||
<if test="et.method!=null">METHOD=#{et.method},</if>
|
||||
<if test="et.operParam!=null">OPER_PARAM=#{et.operParam},</if>
|
||||
<if test="et.result!=null">RESULT=#{et.result},</if>
|
||||
<if test="et.errorMsg!=null">ERROR_MSG=#{et.errorMsg},</if>
|
||||
<if test="et.operUser!=null">OPER_USER=#{et.operUser},</if>
|
||||
<if test="et.operTime!=null">OPER_TIME=#{et.operTime},</if>
|
||||
</trim>
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.title!=null"> AND TITLE=#{ew.entity.title}</if>
|
||||
<if test="ew.entity.method!=null"> AND METHOD=#{ew.entity.method}</if>
|
||||
<if test="ew.entity.operParam!=null"> AND OPER_PARAM=#{ew.entity.operParam}</if>
|
||||
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
|
||||
<if test="ew.entity.errorMsg!=null"> AND ERROR_MSG=#{ew.entity.errorMsg}</if>
|
||||
<if test="ew.entity.operUser!=null"> AND OPER_USER=#{ew.entity.operUser}</if>
|
||||
<if test="ew.entity.operTime!=null"> AND OPER_TIME=#{ew.entity.operTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<delete id="deleteById">
|
||||
DELETE FROM Z_OPER_LOG WHERE HANDLE=#{handle}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByMap">
|
||||
DELETE FROM Z_OPER_LOG
|
||||
<if test="cm!=null and !cm.isEmpty">
|
||||
<where>
|
||||
<foreach collection="cm.keys" item="k" separator="AND">
|
||||
<if test="cm[k] != null">
|
||||
${k} = #{cm[${k}]}
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</if>
|
||||
</delete>
|
||||
|
||||
<delete id="delete">
|
||||
DELETE FROM Z_OPER_LOG
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.title!=null"> AND TITLE=#{ew.entity.title}</if>
|
||||
<if test="ew.entity.method!=null"> AND METHOD=#{ew.entity.method}</if>
|
||||
<if test="ew.entity.operParam!=null"> AND OPER_PARAM=#{ew.entity.operParam}</if>
|
||||
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
|
||||
<if test="ew.entity.errorMsg!=null"> AND ERROR_MSG=#{ew.entity.errorMsg}</if>
|
||||
<if test="ew.entity.operUser!=null"> AND OPER_USER=#{ew.entity.operUser}</if>
|
||||
<if test="ew.entity.operTime!=null"> AND OPER_TIME=#{ew.entity.operTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBatchIds">
|
||||
DELETE FROM Z_OPER_LOG WHERE HANDLE IN (
|
||||
<foreach item="item" index="index" collection="coll" separator=",">#{item}
|
||||
</foreach>)
|
||||
</delete>
|
||||
<!-- BaseMapper标准查询/修改/删除 -->
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue