Browse Source

集成swagger2

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

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

@ -1,19 +1,18 @@
package com.xm.core.entity;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
/**
* 组织 com 顶级模块 xm 大模块 core 小模块 <br>
* 实体 XmRecord所有属性名: <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>
* "id","日志编号","projectId","项目编号","operUserid","操作人id","operUsername","操作人名字","operTime","操作时间","objType","操作对象project/task/phase/group/product/menu/iteration","action","操作的id","oldValue","历史值","newValue","新值","remarks","备注-只描述新旧值之间的变化","gloNo","全局根踪号,用于跟踪日志","branchId","机构编号","ip","ip地址","bizId","业务主键编号","pbizId","上级业务主键编号","productId","产品编号","bizName","对象名称";<br>
* 当前主键(包括多主键):<br>
* id;<br>
*/
@Data
@ApiModel(description="xm_record")
public class XmRecord implements java.io.Serializable {
@ -35,7 +34,7 @@ public class XmRecord implements java.io.Serializable {
@ApiModelProperty(notes="操作时间",allowEmptyValue=true,example="",allowableValues="")
Date operTime;
@ApiModelProperty(notes="操作对象project/task/phase/group/budget/cost",allowEmptyValue=true,example="",allowableValues="")
@ApiModelProperty(notes="操作对象project/task/phase/group/product/menu/iteration",allowEmptyValue=true,example="",allowableValues="")
String objType;
@ApiModelProperty(notes="操作的id",allowEmptyValue=true,example="",allowableValues="")
@ -47,11 +46,11 @@ public class XmRecord implements java.io.Serializable {
@ApiModelProperty(notes="新值",allowEmptyValue=true,example="",allowableValues="")
String newValue;
@ApiModelProperty(notes="备注",allowEmptyValue=true,example="",allowableValues="")
@ApiModelProperty(notes="备注-只描述新旧值之间的变化",allowEmptyValue=true,example="",allowableValues="")
String remarks;
@ApiModelProperty(notes="请求编号,用于跟踪日志",allowEmptyValue=true,example="",allowableValues="")
String reqNo;
@ApiModelProperty(notes="全局根踪号,用于跟踪日志",allowEmptyValue=true,example="",allowableValues="")
String gloNo;
@ApiModelProperty(notes="机构编号",allowEmptyValue=true,example="",allowableValues="")
String branchId;
@ -67,208 +66,21 @@ public class XmRecord implements java.io.Serializable {
@ApiModelProperty(notes="产品编号",allowEmptyValue=true,example="",allowableValues="")
String productId;
@ApiModelProperty(notes="对象名称",allowEmptyValue=true,example="",allowableValues="")
String bizName;
/**日志编号**/
/**
*日志编号
**/
public XmRecord(String id) {
this.id = id;
}
/**xm_record**/
/**
* xm_record
**/
public XmRecord() {
}
/**
* 日志编号
**/
public void setId(String id) {
this.id = id;
}
/**
* 项目编号
**/
public void setProjectId(String projectId) {
this.projectId = projectId;
}
/**
* 操作人id
**/
public void setOperUserid(String operUserid) {
this.operUserid = operUserid;
}
/**
* 操作人名字
**/
public void setOperUsername(String operUsername) {
this.operUsername = operUsername;
}
/**
* 操作时间
**/
public void setOperTime(Date operTime) {
this.operTime = operTime;
}
/**
* 操作对象project/task/phase/group/budget/cost
**/
public void setObjType(String objType) {
this.objType = objType;
}
/**
* 操作的id
**/
public void setAction(String action) {
this.action = action;
}
/**
* 历史值
**/
public void setOldValue(String oldValue) {
this.oldValue = oldValue;
}
/**
* 新值
**/
public void setNewValue(String newValue) {
this.newValue = newValue;
}
/**
* 备注
**/
public void setRemarks(String remarks) {
this.remarks = remarks;
}
/**
* 请求编号用于跟踪日志
**/
public void setReqNo(String reqNo) {
this.reqNo = reqNo;
}
/**
* 机构编号
**/
public void setBranchId(String branchId) {
this.branchId = branchId;
}
/**
* ip地址
**/
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;
}
/**
* 日志编号
**/
public String getId() {
return this.id;
}
/**
* 项目编号
**/
public String getProjectId() {
return this.projectId;
}
/**
* 操作人id
**/
public String getOperUserid() {
return this.operUserid;
}
/**
* 操作人名字
**/
public String getOperUsername() {
return this.operUsername;
}
/**
* 操作时间
**/
public Date getOperTime() {
return this.operTime;
}
/**
* 操作对象project/task/phase/group/budget/cost
**/
public String getObjType() {
return this.objType;
}
/**
* 操作的id
**/
public String getAction() {
return this.action;
}
/**
* 历史值
**/
public String getOldValue() {
return this.oldValue;
}
/**
* 新值
**/
public String getNewValue() {
return this.newValue;
}
/**
* 备注
**/
public String getRemarks() {
return this.remarks;
}
/**
* 请求编号用于跟踪日志
**/
public String getReqNo() {
return this.reqNo;
}
/**
* 机构编号
**/
public String getBranchId() {
return this.branchId;
}
/**
* ip地址
**/
public String getIp() {
return this.ip;
}
/**
* 业务主键编号
**/
public String getBizId() {
return this.bizId;
}
/**
* 上级业务主键编号
**/
public String getPbizId() {
return this.pbizId;
}
/**
* 产品编号
**/
public String getProductId() {
return this.productId;
}
}

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

@ -42,7 +42,13 @@
where
res.id = #{id}
</select>
<select id="selectListByIds" parameterType="List" resultType="com.xm.core.entity.XmRecord">
select * from xm_record res
where (res.id) in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" >
( #{item})
</foreach>
</select>
<!-- 通过主键查询获取数据对象 返回map-->
<select id="selectOneMap" parameterType="HashMap" resultType="HashMap">
select * from xm_record res
@ -51,7 +57,7 @@
</select>
<!-- 获取数据条目 返回long -->
<select id="countByWhere" parameterType="com.xm.core.entity.XmRecord" resultType="long">
select count(1) from xm_record res
select count(*) from xm_record res
<where>
<include refid="where"/>
</where>
@ -61,7 +67,7 @@
insert into xm_record(
<include refid="columns"/>
) values (
#{id},#{projectId},#{operUserid},#{operUsername},#{operTime},#{objType},#{action},#{oldValue},#{newValue},#{remarks},#{reqNo},#{branchId},#{ip},#{bizId},#{pbizId},#{productId}
#{id},#{projectId},#{operUserid},#{operUsername},#{operTime},#{objType},#{action},#{oldValue},#{newValue},#{remarks},#{gloNo},#{branchId},#{ip},#{bizId},#{pbizId},#{productId},#{bizName}
)
</insert>
@ -111,6 +117,18 @@
where id = #{item.id}
</foreach>
</update>
<!-- 批量修改某几个字段 -->
<delete id="editSomeFields" parameterType="HashMap">
update xm_record
<set>
<include refid="someFieldSet"/>
</set>
where (id) in
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" >
( #{item})
</foreach>
</delete>
<!-- 批量删除 -->
<delete id="batchDelete" parameterType="List">
delete from xm_record
@ -124,7 +142,7 @@
<!--sql片段 列-->
<sql id="columns">
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
id,project_id,oper_userid,oper_username,oper_time,obj_type,action,old_value,new_value,remarks,glo_no,branch_id,ip,biz_id,pbiz_id,product_id,biz_name
</sql>
<!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS-->
@ -139,12 +157,13 @@
<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="reqNo != null and reqNo != ''"> and res.req_no = #{reqNo} </if>
<if test="gloNo != null and gloNo != ''"> and res.glo_no = #{gloNo} </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>
<if test="bizName != null and bizName != ''"> and res.biz_name = #{bizName} </if>
</sql>
<!--sql片段 更新字段 -->
<sql id="set">
@ -157,12 +176,13 @@
old_value = #{oldValue},
new_value = #{newValue},
remarks = #{remarks},
req_no = #{reqNo},
glo_no = #{gloNo},
branch_id = #{branchId},
ip = #{ip},
biz_id = #{bizId},
pbiz_id = #{pbizId},
product_id = #{productId}
product_id = #{productId},
biz_name = #{bizName}
</sql>
<sql id="someFieldSet">
<if test="projectId != null and projectId != ''"> project_id = #{projectId}, </if>
@ -174,12 +194,13 @@
<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="reqNo != null and reqNo != ''"> req_no = #{reqNo}, </if>
<if test="gloNo != null and gloNo != ''"> glo_no = #{gloNo}, </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>
<if test="bizName != null and bizName != ''"> biz_name = #{bizName}, </if>
</sql>
<!--sql片段 批量更新 -->
<sql id="batchSet">
@ -192,11 +213,12 @@
old_value = #{item.oldValue},
new_value = #{item.newValue},
remarks = #{item.remarks},
req_no = #{item.reqNo},
glo_no = #{item.gloNo},
branch_id = #{item.branchId},
ip = #{item.ip},
biz_id = #{item.bizId},
pbiz_id = #{item.pbizId},
product_id = #{item.productId}
product_id = #{item.productId},
biz_name = #{item.bizName}
</sql>
</mapper>
Loading…
Cancel
Save