Browse Source

添加节点类型、标签等

master
陈裕财 4 years ago
parent
commit
fcdcfc5d16
  1. 77
      xm-core/src/main/java/com/xm/core/entity/XmRecord.java
  2. 56
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmRecordMapper.xml

77
xm-core/src/main/java/com/xm/core/entity/XmRecord.java

@ -1,16 +1,15 @@
package com.xm.core.entity;
package com.xm.core.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
/**
* 组织 com.qqkj 顶级模块 oa 大模块 xm 小模块 <br>
* 组织 com 顶级模块 xm 大模块 core 小模块 <br>
* 实体 XmRecord所有属性名: <br>
* id,projectId,operUserid,operUsername,operTime,objType,action,oldValue,newValue,remarks,taskId,reqNo,branchId,ip;<br>
* XM.xm_record xm_record的所有字段名: <br>
* id,project_id,oper_userid,oper_username,oper_time,obj_type,action,old_value,new_value,remarks,task_id,req_no,branch_id,ip;<br>
* id,projectId,operUserid,operUsername,operTime,objType,action,oldValue,newValue,remarks,reqNo,branchId,ip,bizId,pbizId,productId;<br>
* xm_record xm_record的所有字段名: <br>
* id,project_id,oper_userid,oper_username,oper_time,obj_type,action,old_value,new_value,remarks,req_no,branch_id,ip,biz_id,pbiz_id,product_id;<br>
* 当前主键(包括多主键):<br>
* id;<br>
*/
@ -35,7 +34,7 @@ public class XmRecord implements java.io.Serializable {
@ApiModelProperty(notes="操作时间",allowEmptyValue=true,example="",allowableValues="")
Date operTime;
@ApiModelProperty(notes="操作对象project/task",allowEmptyValue=true,example="",allowableValues="")
@ApiModelProperty(notes="操作对象project/task/phase/group/budget/cost",allowEmptyValue=true,example="",allowableValues="")
String objType;
@ApiModelProperty(notes="操作的id",allowEmptyValue=true,example="",allowableValues="")
@ -50,9 +49,6 @@ public class XmRecord implements java.io.Serializable {
@ApiModelProperty(notes="备注",allowEmptyValue=true,example="",allowableValues="")
String remarks;
@ApiModelProperty(notes="任务编号",allowEmptyValue=true,example="",allowableValues="")
String taskId;
@ApiModelProperty(notes="请求编号,用于跟踪日志",allowEmptyValue=true,example="",allowableValues="")
String reqNo;
@ -62,6 +58,15 @@ public class XmRecord implements java.io.Serializable {
@ApiModelProperty(notes="ip地址",allowEmptyValue=true,example="",allowableValues="")
String ip;
@ApiModelProperty(notes="业务主键编号",allowEmptyValue=true,example="",allowableValues="")
String bizId;
@ApiModelProperty(notes="上级业务主键编号",allowEmptyValue=true,example="",allowableValues="")
String pbizId;
@ApiModelProperty(notes="产品编号",allowEmptyValue=true,example="",allowableValues="")
String productId;
/**日志编号**/
public XmRecord(String id) {
this.id = id;
@ -102,7 +107,7 @@ public class XmRecord implements java.io.Serializable {
this.operTime = operTime;
}
/**
* 操作对象project/task
* 操作对象project/task/phase/group/budget/cost
**/
public void setObjType(String objType) {
this.objType = objType;
@ -131,12 +136,6 @@ public class XmRecord implements java.io.Serializable {
public void setRemarks(String remarks) {
this.remarks = remarks;
}
/**
* 任务编号
**/
public void setTaskId(String taskId) {
this.taskId = taskId;
}
/**
* 请求编号用于跟踪日志
**/
@ -155,6 +154,24 @@ public class XmRecord implements java.io.Serializable {
public void setIp(String ip) {
this.ip = ip;
}
/**
* 业务主键编号
**/
public void setBizId(String bizId) {
this.bizId = bizId;
}
/**
* 上级业务主键编号
**/
public void setPbizId(String pbizId) {
this.pbizId = pbizId;
}
/**
* 产品编号
**/
public void setProductId(String productId) {
this.productId = productId;
}
/**
* 日志编号
@ -187,7 +204,7 @@ public class XmRecord implements java.io.Serializable {
return this.operTime;
}
/**
* 操作对象project/task
* 操作对象project/task/phase/group/budget/cost
**/
public String getObjType() {
return this.objType;
@ -216,12 +233,6 @@ public class XmRecord implements java.io.Serializable {
public String getRemarks() {
return this.remarks;
}
/**
* 任务编号
**/
public String getTaskId() {
return this.taskId;
}
/**
* 请求编号用于跟踪日志
**/
@ -240,5 +251,23 @@ public class XmRecord implements java.io.Serializable {
public String getIp() {
return this.ip;
}
/**
* 业务主键编号
**/
public String getBizId() {
return this.bizId;
}
/**
* 上级业务主键编号
**/
public String getPbizId() {
return this.pbizId;
}
/**
* 产品编号
**/
public String getProductId() {
return this.productId;
}
}

56
xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmRecordMapper.xml

@ -3,9 +3,16 @@
<mapper namespace="com.xm.core.entity.XmRecord">
<!--开始 自定sql函数区域 -->
<!--请在此区域添加自定义函数-->
<!--开始 自定sql函数区域 请在此区域添加自定义函数,其它区域尽量不要动,因为代码随时重新生成 -->
<sql id="whereForMap">
<if test=" ids != null"> and (res.id) in
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" >
( #{item})
</foreach>
</if>
<if test="key != null and key !='' "> </if>
</sql>
<!--结束 自定义sql函数区域-->
@ -16,14 +23,8 @@
<select id="selectListMapByWhere" parameterType="HashMap" resultType="HashMap">
select * from xm_record res
<where>
<if test="ids != null"> and
id in
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" >
#{item}
</foreach>
</if>
<include refid="whereForMap"/>
<include refid="where"/>
<if test="key != null and key !='' "> </if>
</where>
</select>
@ -56,11 +57,11 @@
</where>
</select>
<!-- 新增一条记录 主键id,-->
<insert id="insert" parameterType="com.xm.core.entity.XmRecord" useGeneratedKeys="false" keyProperty="id">
<insert id="insert" parameterType="com.xm.core.entity.XmRecord" useGeneratedKeys="false" keyProperty="id">
insert into xm_record(
<include refid="columns"/>
) values (
#{id},#{projectId},#{operUserid},#{operUsername},#{operTime},#{objType},#{action},#{oldValue},#{newValue},#{remarks},#{taskId},#{reqNo},#{branchId},#{ip}
#{id},#{projectId},#{operUserid},#{operUsername},#{operTime},#{objType},#{action},#{oldValue},#{newValue},#{remarks},#{reqNo},#{branchId},#{ip},#{bizId},#{pbizId},#{productId}
)
</insert>
@ -113,16 +114,17 @@
<!-- 批量删除 -->
<delete id="batchDelete" parameterType="List">
delete from xm_record
where id in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" >
#{item.id }
</foreach>
where
(id) in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" >
( #{item.id} )
</foreach>
</delete>
<!--sql片段 列-->
<sql id="columns">
id,project_id,oper_userid,oper_username,oper_time,obj_type,action,old_value,new_value,remarks,task_id,req_no,branch_id,ip
id,project_id,oper_userid,oper_username,oper_time,obj_type,action,old_value,new_value,remarks,req_no,branch_id,ip,biz_id,pbiz_id,product_id
</sql>
<!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS-->
@ -131,16 +133,18 @@
<if test="projectId != null and projectId != ''"> and res.project_id = #{projectId} </if>
<if test="operUserid != null and operUserid != ''"> and res.oper_userid = #{operUserid} </if>
<if test="operUsername != null and operUsername != ''"> and res.oper_username = #{operUsername} </if>
<if test="operTime != null"> and TO_CHAR(res.oper_time,'YYYY-MM-DD') = TO_CHAR(#{operTime},'YYYY-MM-DD') </if>
<if test="operTime != null"> and date_format(res.oper_time,'%Y-%m-%d') = date_format(#{operTime},'%Y-%m-%d') </if>
<if test="objType != null and objType != ''"> and res.obj_type = #{objType} </if>
<if test="action != null and action != ''"> and res.action = #{action} </if>
<if test="oldValue != null and oldValue != ''"> and res.old_value = #{oldValue} </if>
<if test="newValue != null and newValue != ''"> and res.new_value = #{newValue} </if>
<if test="remarks != null and remarks != ''"> and res.remarks = #{remarks} </if>
<if test="taskId != null and taskId != ''"> and res.task_id = #{taskId} </if>
<if test="reqNo != null and reqNo != ''"> and res.req_no = #{reqNo} </if>
<if test="branchId != null and branchId != ''"> and res.branch_id = #{branchId} </if>
<if test="ip != null and ip != ''"> and res.ip = #{ip} </if>
<if test="bizId != null and bizId != ''"> and res.biz_id = #{bizId} </if>
<if test="pbizId != null and pbizId != ''"> and res.pbiz_id = #{pbizId} </if>
<if test="productId != null and productId != ''"> and res.product_id = #{productId} </if>
</sql>
<!--sql片段 更新字段 -->
<sql id="set">
@ -153,10 +157,12 @@
old_value = #{oldValue},
new_value = #{newValue},
remarks = #{remarks},
task_id = #{taskId},
req_no = #{reqNo},
branch_id = #{branchId},
ip = #{ip}
ip = #{ip},
biz_id = #{bizId},
pbiz_id = #{pbizId},
product_id = #{productId}
</sql>
<sql id="someFieldSet">
<if test="projectId != null and projectId != ''"> project_id = #{projectId}, </if>
@ -168,10 +174,12 @@
<if test="oldValue != null and oldValue != ''"> old_value = #{oldValue}, </if>
<if test="newValue != null and newValue != ''"> new_value = #{newValue}, </if>
<if test="remarks != null and remarks != ''"> remarks = #{remarks}, </if>
<if test="taskId != null and taskId != ''"> task_id = #{taskId}, </if>
<if test="reqNo != null and reqNo != ''"> req_no = #{reqNo}, </if>
<if test="branchId != null and branchId != ''"> branch_id = #{branchId}, </if>
<if test="ip != null and ip != ''"> ip = #{ip}, </if>
<if test="bizId != null and bizId != ''"> biz_id = #{bizId}, </if>
<if test="pbizId != null and pbizId != ''"> pbiz_id = #{pbizId}, </if>
<if test="productId != null and productId != ''"> product_id = #{productId}, </if>
</sql>
<!--sql片段 批量更新 -->
<sql id="batchSet">
@ -184,9 +192,11 @@
old_value = #{item.oldValue},
new_value = #{item.newValue},
remarks = #{item.remarks},
task_id = #{item.taskId},
req_no = #{item.reqNo},
branch_id = #{item.branchId},
ip = #{item.ip}
ip = #{item.ip},
biz_id = #{item.bizId},
pbiz_id = #{item.pbizId},
product_id = #{item.productId}
</sql>
</mapper>
Loading…
Cancel
Save