Browse Source

添加节点类型、标签等

master
陈裕财 4 years ago
parent
commit
fcdcfc5d16
  1. 77
      xm-core/src/main/java/com/xm/core/entity/XmRecord.java
  2. 76
      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.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.util.Date; import java.util.Date;
/** /**
* 组织 com.qqkj 顶级模块 oa 大模块 xm 小模块 <br>
* 组织 com 顶级模块 xm 大模块 core 小模块 <br>
* 实体 XmRecord所有属性名: <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> * 当前主键(包括多主键):<br>
* id;<br> * id;<br>
*/ */
@ -35,7 +34,7 @@ public class XmRecord implements java.io.Serializable {
@ApiModelProperty(notes="操作时间",allowEmptyValue=true,example="",allowableValues="") @ApiModelProperty(notes="操作时间",allowEmptyValue=true,example="",allowableValues="")
Date operTime; Date operTime;
@ApiModelProperty(notes="操作对象project/task",allowEmptyValue=true,example="",allowableValues="")
@ApiModelProperty(notes="操作对象project/task/phase/group/budget/cost",allowEmptyValue=true,example="",allowableValues="")
String objType; String objType;
@ApiModelProperty(notes="操作的id",allowEmptyValue=true,example="",allowableValues="") @ApiModelProperty(notes="操作的id",allowEmptyValue=true,example="",allowableValues="")
@ -50,9 +49,6 @@ public class XmRecord implements java.io.Serializable {
@ApiModelProperty(notes="备注",allowEmptyValue=true,example="",allowableValues="") @ApiModelProperty(notes="备注",allowEmptyValue=true,example="",allowableValues="")
String remarks; String remarks;
@ApiModelProperty(notes="任务编号",allowEmptyValue=true,example="",allowableValues="")
String taskId;
@ApiModelProperty(notes="请求编号,用于跟踪日志",allowEmptyValue=true,example="",allowableValues="") @ApiModelProperty(notes="请求编号,用于跟踪日志",allowEmptyValue=true,example="",allowableValues="")
String reqNo; String reqNo;
@ -61,6 +57,15 @@ public class XmRecord implements java.io.Serializable {
@ApiModelProperty(notes="ip地址",allowEmptyValue=true,example="",allowableValues="") @ApiModelProperty(notes="ip地址",allowEmptyValue=true,example="",allowableValues="")
String ip; 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) { public XmRecord(String id) {
@ -102,7 +107,7 @@ public class XmRecord implements java.io.Serializable {
this.operTime = operTime; this.operTime = operTime;
} }
/** /**
* 操作对象project/task
* 操作对象project/task/phase/group/budget/cost
**/ **/
public void setObjType(String objType) { public void setObjType(String objType) {
this.objType = objType; this.objType = objType;
@ -131,12 +136,6 @@ public class XmRecord implements java.io.Serializable {
public void setRemarks(String remarks) { public void setRemarks(String remarks) {
this.remarks = 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) { public void setIp(String ip) {
this.ip = 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; return this.operTime;
} }
/** /**
* 操作对象project/task
* 操作对象project/task/phase/group/budget/cost
**/ **/
public String getObjType() { public String getObjType() {
return this.objType; return this.objType;
@ -216,12 +233,6 @@ public class XmRecord implements java.io.Serializable {
public String getRemarks() { public String getRemarks() {
return this.remarks; return this.remarks;
} }
/**
* 任务编号
**/
public String getTaskId() {
return this.taskId;
}
/** /**
* 请求编号用于跟踪日志 * 请求编号用于跟踪日志
**/ **/
@ -240,5 +251,23 @@ public class XmRecord implements java.io.Serializable {
public String getIp() { public String getIp() {
return this.ip; return this.ip;
} }
/**
* 业务主键编号
**/
public String getBizId() {
return this.bizId;
}
/**
* 上级业务主键编号
**/
public String getPbizId() {
return this.pbizId;
}
/**
* 产品编号
**/
public String getProductId() {
return this.productId;
}
} }

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

@ -3,11 +3,18 @@
<mapper namespace="com.xm.core.entity.XmRecord"> <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函数区域--> <!--结束 自定义sql函数区域-->
@ -15,15 +22,9 @@
<!-- 通过条件查询获取数据列表 返回list<map> --> <!-- 通过条件查询获取数据列表 返回list<map> -->
<select id="selectListMapByWhere" parameterType="HashMap" resultType="HashMap"> <select id="selectListMapByWhere" parameterType="HashMap" resultType="HashMap">
select * from xm_record res 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>
<where>
<include refid="whereForMap"/>
<include refid="where"/> <include refid="where"/>
<if test="key != null and key !='' "> </if>
</where> </where>
</select> </select>
@ -56,11 +57,11 @@
</where> </where>
</select> </select>
<!-- 新增一条记录 主键id,--> <!-- 新增一条记录 主键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( insert into xm_record(
<include refid="columns"/> <include refid="columns"/>
) values ( ) 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> </insert>
@ -74,13 +75,13 @@
<!-- 按主键删除一条记录--> <!-- 按主键删除一条记录-->
<delete id="deleteByPk" parameterType="com.xm.core.entity.XmRecord"> <delete id="deleteByPk" parameterType="com.xm.core.entity.XmRecord">
delete from xm_record
delete from xm_record
where id = #{id} where id = #{id}
</delete> </delete>
<!-- 根据条件修改若干条记录 --> <!-- 根据条件修改若干条记录 -->
<update id="updateSomeFieldByPk" parameterType="com.xm.core.entity.XmRecord"> <update id="updateSomeFieldByPk" parameterType="com.xm.core.entity.XmRecord">
update xm_record
update xm_record
<set> <set>
<include refid="someFieldSet"/> <include refid="someFieldSet"/>
</set> </set>
@ -89,7 +90,7 @@
<!-- 根据主键修改一条记录 --> <!-- 根据主键修改一条记录 -->
<update id="updateByPk" parameterType="com.xm.core.entity.XmRecord"> <update id="updateByPk" parameterType="com.xm.core.entity.XmRecord">
update xm_record
update xm_record
<set> <set>
<include refid="set"/> <include refid="set"/>
</set> </set>
@ -104,7 +105,7 @@
<!-- 批量更新 --> <!-- 批量更新 -->
<update id="batchUpdate" parameterType="List"> <update id="batchUpdate" parameterType="List">
<foreach collection="list" item="item" index="index" separator=";" > <foreach collection="list" item="item" index="index" separator=";" >
update xm_record
update xm_record
set set
<include refid="batchSet"/> <include refid="batchSet"/>
where id = #{item.id} where id = #{item.id}
@ -112,35 +113,38 @@
</update> </update>
<!-- 批量删除 --> <!-- 批量删除 -->
<delete id="batchDelete" parameterType="List"> <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>
delete from xm_record
where
(id) in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" >
( #{item.id} )
</foreach>
</delete> </delete>
<!--sql片段 列--> <!--sql片段 列-->
<sql id="columns"> <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>
<!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS--> <!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS-->
<sql id="where"> <sql id="where">
<if test="id != null and id != ''"> and res.id = #{id} </if> <if test="id != null and id != ''"> and res.id = #{id} </if>
<if test="projectId != null and projectId != ''"> and res.project_id = #{projectId} </if> <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="operUserid != null and operUserid != ''"> and res.oper_userid = #{operUserid} </if>
<if test="operUsername != null and operUsername != ''"> and res.oper_username = #{operUsername} </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="objType != null and objType != ''"> and res.obj_type = #{objType} </if>
<if test="action != null and action != ''"> and res.action = #{action} </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="oldValue != null and oldValue != ''"> and res.old_value = #{oldValue} </if>
<if test="newValue != null and newValue != ''"> and res.new_value = #{newValue} </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="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="reqNo != null and reqNo != ''"> and res.req_no = #{reqNo} </if>
<if test="branchId != null and branchId != ''"> and res.branch_id = #{branchId} </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="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片段 更新字段 --> <!--sql片段 更新字段 -->
<sql id="set"> <sql id="set">
@ -153,10 +157,12 @@
old_value = #{oldValue}, old_value = #{oldValue},
new_value = #{newValue}, new_value = #{newValue},
remarks = #{remarks}, remarks = #{remarks},
task_id = #{taskId},
req_no = #{reqNo}, req_no = #{reqNo},
branch_id = #{branchId}, branch_id = #{branchId},
ip = #{ip}
ip = #{ip},
biz_id = #{bizId},
pbiz_id = #{pbizId},
product_id = #{productId}
</sql> </sql>
<sql id="someFieldSet"> <sql id="someFieldSet">
<if test="projectId != null and projectId != ''"> project_id = #{projectId}, </if> <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="oldValue != null and oldValue != ''"> old_value = #{oldValue}, </if>
<if test="newValue != null and newValue != ''"> new_value = #{newValue}, </if> <if test="newValue != null and newValue != ''"> new_value = #{newValue}, </if>
<if test="remarks != null and remarks != ''"> remarks = #{remarks}, </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="reqNo != null and reqNo != ''"> req_no = #{reqNo}, </if>
<if test="branchId != null and branchId != ''"> branch_id = #{branchId}, </if> <if test="branchId != null and branchId != ''"> branch_id = #{branchId}, </if>
<if test="ip != null and ip != ''"> ip = #{ip}, </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片段 批量更新 --> <!--sql片段 批量更新 -->
<sql id="batchSet"> <sql id="batchSet">
@ -184,9 +192,11 @@
old_value = #{item.oldValue}, old_value = #{item.oldValue},
new_value = #{item.newValue}, new_value = #{item.newValue},
remarks = #{item.remarks}, remarks = #{item.remarks},
task_id = #{item.taskId},
req_no = #{item.reqNo}, req_no = #{item.reqNo},
branch_id = #{item.branchId}, branch_id = #{item.branchId},
ip = #{item.ip}
ip = #{item.ip},
biz_id = #{item.bizId},
pbiz_id = #{item.pbizId},
product_id = #{item.productId}
</sql> </sql>
</mapper> </mapper>
Loading…
Cancel
Save