Browse Source

添加节点类型、标签等

master
陈裕财 4 years ago
parent
commit
e9ed2ee83f
  1. 154
      xm-core/src/main/java/com/xm/core/entity/XmProjectGroup.java
  2. 101
      xm-core/src/main/java/com/xm/core/entity/XmProjectGroupUser.java
  3. 3
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProductMapper.xml
  4. 48
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProjectGroupMapper.xml
  5. 67
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProjectGroupUserMapper.xml

154
xm-core/src/main/java/com/xm/core/entity/XmProjectGroup.java

@ -7,9 +7,9 @@ import java.util.Date;
/** /**
* 组织 com 顶级模块 xm 大模块 core 小模块 <br> * 组织 com 顶级模块 xm 大模块 core 小模块 <br>
* 实体 XmProjectGroup所有属性名: <br> * 实体 XmProjectGroup所有属性名: <br>
* id,groupName,projectId,pgTypeId,pgTypeName,leaderUserid,leaderUsername,ctime,ltime,productId,branchId,pgClass;<br>
* id,groupName,projectId,pgTypeId,pgTypeName,leaderUserid,leaderUsername,ctime,ltime,productId,branchId,pgClass,pgroupId,lvl,pidPaths,isTpl,assUserid,assUsername,childrenCnt,userCnt,qxCode,calcWorkload;<br>
* xm_project_group xm_project_group的所有字段名: <br> * xm_project_group xm_project_group的所有字段名: <br>
* id,group_name,project_id,pg_type_id,pg_type_name,leader_userid,leader_username,ctime,ltime,product_id,branch_id,pg_class;<br>
* id,group_name,project_id,pg_type_id,pg_type_name,leader_userid,leader_username,ctime,ltime,product_id,branch_id,pg_class,pgroup_id,lvl,pid_paths,is_tpl,ass_userid,ass_username,children_cnt,user_cnt,qx_code,calc_workload;<br>
* 当前主键(包括多主键):<br> * 当前主键(包括多主键):<br>
* id;<br> * id;<br>
*/ */
@ -55,6 +55,36 @@ public class XmProjectGroup implements java.io.Serializable {
@ApiModelProperty(notes="团队类别0项目1产品",allowEmptyValue=true,example="",allowableValues="") @ApiModelProperty(notes="团队类别0项目1产品",allowEmptyValue=true,example="",allowableValues="")
String pgClass; String pgClass;
@ApiModelProperty(notes="上级团队编号",allowEmptyValue=true,example="",allowableValues="")
String pgroupId;
@ApiModelProperty(notes="级别0级1级2级3级4级",allowEmptyValue=true,example="",allowableValues="")
String lvl;
@ApiModelProperty(notes="上级编号路径逗号分割,0,开始,本组编号+逗号结束",allowEmptyValue=true,example="",allowableValues="")
String pidPaths;
@ApiModelProperty(notes="是否为模板",allowEmptyValue=true,example="",allowableValues="")
String isTpl;
@ApiModelProperty(notes="副组长编号",allowEmptyValue=true,example="",allowableValues="")
String assUserid;
@ApiModelProperty(notes="副组长姓名",allowEmptyValue=true,example="",allowableValues="")
String assUsername;
@ApiModelProperty(notes="下级团队数量",allowEmptyValue=true,example="",allowableValues="")
Integer childrenCnt;
@ApiModelProperty(notes="组员数量",allowEmptyValue=true,example="",allowableValues="")
Integer userCnt;
@ApiModelProperty(notes="权限码",allowEmptyValue=true,example="",allowableValues="")
String qxCode;
@ApiModelProperty(notes="是否计算工作量0否1是",allowEmptyValue=true,example="",allowableValues="")
String calcWorkload;
/**主键**/ /**主键**/
public XmProjectGroup(String id) { public XmProjectGroup(String id) {
this.id = id; this.id = id;
@ -136,6 +166,66 @@ public class XmProjectGroup implements java.io.Serializable {
public void setPgClass(String pgClass) { public void setPgClass(String pgClass) {
this.pgClass = pgClass; this.pgClass = pgClass;
} }
/**
* 上级团队编号
**/
public void setPgroupId(String pgroupId) {
this.pgroupId = pgroupId;
}
/**
* 级别0级1级2级3级4级
**/
public void setLvl(String lvl) {
this.lvl = lvl;
}
/**
* 上级编号路径逗号分割,0,开始本组编号+逗号结束
**/
public void setPidPaths(String pidPaths) {
this.pidPaths = pidPaths;
}
/**
* 是否为模板
**/
public void setIsTpl(String isTpl) {
this.isTpl = isTpl;
}
/**
* 副组长编号
**/
public void setAssUserid(String assUserid) {
this.assUserid = assUserid;
}
/**
* 副组长姓名
**/
public void setAssUsername(String assUsername) {
this.assUsername = assUsername;
}
/**
* 下级团队数量
**/
public void setChildrenCnt(Integer childrenCnt) {
this.childrenCnt = childrenCnt;
}
/**
* 组员数量
**/
public void setUserCnt(Integer userCnt) {
this.userCnt = userCnt;
}
/**
* 权限码
**/
public void setQxCode(String qxCode) {
this.qxCode = qxCode;
}
/**
* 是否计算工作量0否1是
**/
public void setCalcWorkload(String calcWorkload) {
this.calcWorkload = calcWorkload;
}
/** /**
* 主键 * 主键
@ -209,5 +299,65 @@ public class XmProjectGroup implements java.io.Serializable {
public String getPgClass() { public String getPgClass() {
return this.pgClass; return this.pgClass;
} }
/**
* 上级团队编号
**/
public String getPgroupId() {
return this.pgroupId;
}
/**
* 级别0级1级2级3级4级
**/
public String getLvl() {
return this.lvl;
}
/**
* 上级编号路径逗号分割,0,开始本组编号+逗号结束
**/
public String getPidPaths() {
return this.pidPaths;
}
/**
* 是否为模板
**/
public String getIsTpl() {
return this.isTpl;
}
/**
* 副组长编号
**/
public String getAssUserid() {
return this.assUserid;
}
/**
* 副组长姓名
**/
public String getAssUsername() {
return this.assUsername;
}
/**
* 下级团队数量
**/
public Integer getChildrenCnt() {
return this.childrenCnt;
}
/**
* 组员数量
**/
public Integer getUserCnt() {
return this.userCnt;
}
/**
* 权限码
**/
public String getQxCode() {
return this.qxCode;
}
/**
* 是否计算工作量0否1是
**/
public String getCalcWorkload() {
return this.calcWorkload;
}
} }

101
xm-core/src/main/java/com/xm/core/entity/XmProjectGroupUser.java

@ -7,54 +7,49 @@ import java.util.Date;
/** /**
* 组织 com 顶级模块 xm 大模块 core 小模块 <br> * 组织 com 顶级模块 xm 大模块 core 小模块 <br>
* 实体 XmProjectGroupUser所有属性名: <br> * 实体 XmProjectGroupUser所有属性名: <br>
* joinTime,id,groupId,userid,username,isHead,outTime,status,bizProcInstId,bizFlowState,projectId;<br>
* joinTime,groupId,userid,username,outTime,status,obranchId,isPri,seqNo;<br>
* xm_project_group_user xm_project_group_user的所有字段名: <br> * xm_project_group_user xm_project_group_user的所有字段名: <br>
* join_time,id,group_id,userid,username,is_head,out_time,status,biz_proc_inst_id,biz_flow_state,project_id;<br>
* join_time,group_id,userid,username,out_time,status,obranch_id,is_pri,seq_no;<br>
* 当前主键(包括多主键):<br> * 当前主键(包括多主键):<br>
* id;<br>
* group_id,userid;<br>
*/ */
@ApiModel(description="xm_project_group_user") @ApiModel(description="xm_project_group_user")
public class XmProjectGroupUser implements java.io.Serializable { public class XmProjectGroupUser implements java.io.Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(notes="主键,主键",allowEmptyValue=true,example="",allowableValues="")
String id;
@ApiModelProperty(notes="团队编号,主键",allowEmptyValue=true,example="",allowableValues="")
String groupId;
@ApiModelProperty(notes="团队成员编号,主键",allowEmptyValue=true,example="",allowableValues="")
String userid;
@ApiModelProperty(notes="加入时间",allowEmptyValue=true,example="",allowableValues="") @ApiModelProperty(notes="加入时间",allowEmptyValue=true,example="",allowableValues="")
Date joinTime; Date joinTime;
@ApiModelProperty(notes="团队编号",allowEmptyValue=true,example="",allowableValues="")
String groupId;
@ApiModelProperty(notes="团队成员编号",allowEmptyValue=true,example="",allowableValues="")
String userid;
@ApiModelProperty(notes="团队成员",allowEmptyValue=true,example="",allowableValues="") @ApiModelProperty(notes="团队成员",allowEmptyValue=true,example="",allowableValues="")
String username; String username;
@ApiModelProperty(notes="是否组长,1是,0否",allowEmptyValue=true,example="",allowableValues="")
String isHead;
@ApiModelProperty(notes="离队时间",allowEmptyValue=true,example="",allowableValues="") @ApiModelProperty(notes="离队时间",allowEmptyValue=true,example="",allowableValues="")
Date outTime; Date outTime;
@ApiModelProperty(notes="当前状态0参与中1已退出团队",allowEmptyValue=true,example="",allowableValues="") @ApiModelProperty(notes="当前状态0参与中1已退出团队",allowEmptyValue=true,example="",allowableValues="")
String status; String status;
@ApiModelProperty(notes="当前流程实例编号",allowEmptyValue=true,example="",allowableValues="")
String bizProcInstId;
@ApiModelProperty(notes="组员原归属机构编号",allowEmptyValue=true,example="",allowableValues="")
String obranchId;
@ApiModelProperty(notes="当前流程状态0初始1审批中2审批通过3审批不通过4流程取消或者删除",allowEmptyValue=true,example="",allowableValues="")
String bizFlowState;
@ApiModelProperty(notes="是否私人加入0否1是",allowEmptyValue=true,example="",allowableValues="")
String isPri;
@ApiModelProperty(notes="项目编号",allowEmptyValue=true,example="",allowableValues="")
String projectId;
@ApiModelProperty(notes="排序号--从1开始",allowEmptyValue=true,example="",allowableValues="")
Integer seqNo;
/**主键**/
public XmProjectGroupUser(String id) {
this.id = id;
/**团队编号,团队成员编号**/
public XmProjectGroupUser(String groupId,String userid) {
this.groupId = groupId;
this.userid = userid;
} }
/**xm_project_group_user**/ /**xm_project_group_user**/
@ -67,12 +62,6 @@ public class XmProjectGroupUser implements java.io.Serializable {
public void setJoinTime(Date joinTime) { public void setJoinTime(Date joinTime) {
this.joinTime = joinTime; this.joinTime = joinTime;
} }
/**
* 主键
**/
public void setId(String id) {
this.id = id;
}
/** /**
* 团队编号 * 团队编号
**/ **/
@ -91,12 +80,6 @@ public class XmProjectGroupUser implements java.io.Serializable {
public void setUsername(String username) { public void setUsername(String username) {
this.username = username; this.username = username;
} }
/**
* 是否组长1是0否
**/
public void setIsHead(String isHead) {
this.isHead = isHead;
}
/** /**
* 离队时间 * 离队时间
**/ **/
@ -110,22 +93,22 @@ public class XmProjectGroupUser implements java.io.Serializable {
this.status = status; this.status = status;
} }
/** /**
* 当前流程实例编号
* 组员原归属机构编号
**/ **/
public void setBizProcInstId(String bizProcInstId) {
this.bizProcInstId = bizProcInstId;
public void setObranchId(String obranchId) {
this.obranchId = obranchId;
} }
/** /**
* 当前流程状态0初始1审批中2审批通过3审批不通过4流程取消或者删除
* 是否私人加入0否1是
**/ **/
public void setBizFlowState(String bizFlowState) {
this.bizFlowState = bizFlowState;
public void setIsPri(String isPri) {
this.isPri = isPri;
} }
/** /**
* 项目编号
* 排序号--从1开始
**/ **/
public void setProjectId(String projectId) {
this.projectId = projectId;
public void setSeqNo(Integer seqNo) {
this.seqNo = seqNo;
} }
/** /**
@ -134,12 +117,6 @@ public class XmProjectGroupUser implements java.io.Serializable {
public Date getJoinTime() { public Date getJoinTime() {
return this.joinTime; return this.joinTime;
} }
/**
* 主键
**/
public String getId() {
return this.id;
}
/** /**
* 团队编号 * 团队编号
**/ **/
@ -158,12 +135,6 @@ public class XmProjectGroupUser implements java.io.Serializable {
public String getUsername() { public String getUsername() {
return this.username; return this.username;
} }
/**
* 是否组长1是0否
**/
public String getIsHead() {
return this.isHead;
}
/** /**
* 离队时间 * 离队时间
**/ **/
@ -177,22 +148,22 @@ public class XmProjectGroupUser implements java.io.Serializable {
return this.status; return this.status;
} }
/** /**
* 当前流程实例编号
* 组员原归属机构编号
**/ **/
public String getBizProcInstId() {
return this.bizProcInstId;
public String getObranchId() {
return this.obranchId;
} }
/** /**
* 当前流程状态0初始1审批中2审批通过3审批不通过4流程取消或者删除
* 是否私人加入0否1是
**/ **/
public String getBizFlowState() {
return this.bizFlowState;
public String getIsPri() {
return this.isPri;
} }
/** /**
* 项目编号
* 排序号--从1开始
**/ **/
public String getProjectId() {
return this.projectId;
public Integer getSeqNo() {
return this.seqNo;
} }
} }

3
xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProductMapper.xml

@ -3,8 +3,7 @@
<mapper namespace="com.xm.core.entity.XmProduct"> <mapper namespace="com.xm.core.entity.XmProduct">
<!--开始 自定sql函数区域 -->
<!--请在此区域添加自定义函数-->
<!--开始 自定sql函数区域 请在此区域添加自定义函数,其它区域尽量不要动,因为代码随时重新生成 -->
<sql id="whereForMap"> <sql id="whereForMap">
<if test=" ids != null"> and (res.id) in <if test=" ids != null"> and (res.id) in

48
xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProjectGroupMapper.xml

@ -64,7 +64,7 @@
insert into xm_project_group( insert into xm_project_group(
<include refid="columns"/> <include refid="columns"/>
) values ( ) values (
#{id},#{groupName},#{projectId},#{pgTypeId},#{pgTypeName},#{leaderUserid},#{leaderUsername},#{ctime},#{ltime},#{productId},#{branchId},#{pgClass}
#{id},#{groupName},#{projectId},#{pgTypeId},#{pgTypeName},#{leaderUserid},#{leaderUsername},#{ctime},#{ltime},#{productId},#{branchId},#{pgClass},#{pgroupId},#{lvl},#{pidPaths},#{isTpl},#{assUserid},#{assUsername},#{childrenCnt},#{userCnt},#{qxCode},#{calcWorkload}
) )
</insert> </insert>
@ -127,7 +127,7 @@
<!--sql片段 列--> <!--sql片段 列-->
<sql id="columns"> <sql id="columns">
id,group_name,project_id,pg_type_id,pg_type_name,leader_userid,leader_username,ctime,ltime,product_id,branch_id,pg_class
id,group_name,project_id,pg_type_id,pg_type_name,leader_userid,leader_username,ctime,ltime,product_id,branch_id,pg_class,pgroup_id,lvl,pid_paths,is_tpl,ass_userid,ass_username,children_cnt,user_cnt,qx_code,calc_workload
</sql> </sql>
<!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS--> <!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS-->
@ -144,6 +144,16 @@
<if test="productId != null and productId != ''"> and res.product_id = #{productId} </if> <if test="productId != null and productId != ''"> and res.product_id = #{productId} </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="pgClass != null and pgClass != ''"> and res.pg_class = #{pgClass} </if> <if test="pgClass != null and pgClass != ''"> and res.pg_class = #{pgClass} </if>
<if test="pgroupId != null and pgroupId != ''"> and res.pgroup_id = #{pgroupId} </if>
<if test="lvl != null and lvl != ''"> and res.lvl = #{lvl} </if>
<if test="pidPaths != null and pidPaths != ''"> and res.pid_paths = #{pidPaths} </if>
<if test="isTpl != null and isTpl != ''"> and res.is_tpl = #{isTpl} </if>
<if test="assUserid != null and assUserid != ''"> and res.ass_userid = #{assUserid} </if>
<if test="assUsername != null and assUsername != ''"> and res.ass_username = #{assUsername} </if>
<if test="childrenCnt != null and childrenCnt != ''"> and res.children_cnt = #{childrenCnt} </if>
<if test="userCnt != null and userCnt != ''"> and res.user_cnt = #{userCnt} </if>
<if test="qxCode != null and qxCode != ''"> and res.qx_code = #{qxCode} </if>
<if test="calcWorkload != null and calcWorkload != ''"> and res.calc_workload = #{calcWorkload} </if>
</sql> </sql>
<!--sql片段 更新字段 --> <!--sql片段 更新字段 -->
<sql id="set"> <sql id="set">
@ -157,7 +167,17 @@
ltime = #{ltime}, ltime = #{ltime},
product_id = #{productId}, product_id = #{productId},
branch_id = #{branchId}, branch_id = #{branchId},
pg_class = #{pgClass}
pg_class = #{pgClass},
pgroup_id = #{pgroupId},
lvl = #{lvl},
pid_paths = #{pidPaths},
is_tpl = #{isTpl},
ass_userid = #{assUserid},
ass_username = #{assUsername},
children_cnt = #{childrenCnt},
user_cnt = #{userCnt},
qx_code = #{qxCode},
calc_workload = #{calcWorkload}
</sql> </sql>
<sql id="someFieldSet"> <sql id="someFieldSet">
<if test="groupName != null and groupName != ''"> group_name = #{groupName}, </if> <if test="groupName != null and groupName != ''"> group_name = #{groupName}, </if>
@ -171,6 +191,16 @@
<if test="productId != null and productId != ''"> product_id = #{productId}, </if> <if test="productId != null and productId != ''"> product_id = #{productId}, </if>
<if test="branchId != null and branchId != ''"> branch_id = #{branchId}, </if> <if test="branchId != null and branchId != ''"> branch_id = #{branchId}, </if>
<if test="pgClass != null and pgClass != ''"> pg_class = #{pgClass}, </if> <if test="pgClass != null and pgClass != ''"> pg_class = #{pgClass}, </if>
<if test="pgroupId != null and pgroupId != ''"> pgroup_id = #{pgroupId}, </if>
<if test="lvl != null and lvl != ''"> lvl = #{lvl}, </if>
<if test="pidPaths != null and pidPaths != ''"> pid_paths = #{pidPaths}, </if>
<if test="isTpl != null and isTpl != ''"> is_tpl = #{isTpl}, </if>
<if test="assUserid != null and assUserid != ''"> ass_userid = #{assUserid}, </if>
<if test="assUsername != null and assUsername != ''"> ass_username = #{assUsername}, </if>
<if test="childrenCnt != null and childrenCnt != ''"> children_cnt = #{childrenCnt}, </if>
<if test="userCnt != null and userCnt != ''"> user_cnt = #{userCnt}, </if>
<if test="qxCode != null and qxCode != ''"> qx_code = #{qxCode}, </if>
<if test="calcWorkload != null and calcWorkload != ''"> calc_workload = #{calcWorkload}, </if>
</sql> </sql>
<!--sql片段 批量更新 --> <!--sql片段 批量更新 -->
<sql id="batchSet"> <sql id="batchSet">
@ -184,6 +214,16 @@
ltime = #{item.ltime}, ltime = #{item.ltime},
product_id = #{item.productId}, product_id = #{item.productId},
branch_id = #{item.branchId}, branch_id = #{item.branchId},
pg_class = #{item.pgClass}
pg_class = #{item.pgClass},
pgroup_id = #{item.pgroupId},
lvl = #{item.lvl},
pid_paths = #{item.pidPaths},
is_tpl = #{item.isTpl},
ass_userid = #{item.assUserid},
ass_username = #{item.assUsername},
children_cnt = #{item.childrenCnt},
user_cnt = #{item.userCnt},
qx_code = #{item.qxCode},
calc_workload = #{item.calcWorkload}
</sql> </sql>
</mapper> </mapper>

67
xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProjectGroupUserMapper.xml

@ -6,9 +6,9 @@
<!--开始 自定sql函数区域 请在此区域添加自定义函数,其它区域尽量不要动,因为代码随时重新生成 --> <!--开始 自定sql函数区域 请在此区域添加自定义函数,其它区域尽量不要动,因为代码随时重新生成 -->
<sql id="whereForMap"> <sql id="whereForMap">
<if test=" ids != null"> and (res.id) in
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" >
( #{item})
<if test=" pkList != null"> and (res.group_id, res.userid) in
<foreach collection="pkList" item="item" index="index" open="(" separator="," close=")" >
( #{item.groupId}, #{item.userid})
</foreach> </foreach>
</if> </if>
<if test="key != null and key !='' "> </if> <if test="key != null and key !='' "> </if>
@ -59,14 +59,16 @@
<select id="selectOneObject" parameterType="com.xm.core.entity.XmProjectGroupUser" resultType="com.xm.core.entity.XmProjectGroupUser"> <select id="selectOneObject" parameterType="com.xm.core.entity.XmProjectGroupUser" resultType="com.xm.core.entity.XmProjectGroupUser">
select * from xm_project_group_user res select * from xm_project_group_user res
where where
res.id = #{id}
res.group_id = #{groupId}
and res.userid = #{userid}
</select> </select>
<!-- 通过主键查询获取数据对象 返回map--> <!-- 通过主键查询获取数据对象 返回map-->
<select id="selectOneMap" parameterType="HashMap" resultType="HashMap"> <select id="selectOneMap" parameterType="HashMap" resultType="HashMap">
select * from xm_project_group_user res select * from xm_project_group_user res
where where
res.id = #{id}
res.group_id = #{groupId}
and res.userid = #{userid}
</select> </select>
<!-- 获取数据条目 返回long --> <!-- 获取数据条目 返回long -->
<select id="countByWhere" parameterType="com.xm.core.entity.XmProjectGroupUser" resultType="long"> <select id="countByWhere" parameterType="com.xm.core.entity.XmProjectGroupUser" resultType="long">
@ -75,12 +77,12 @@
<include refid="where"/> <include refid="where"/>
</where> </where>
</select> </select>
<!-- 新增一条记录 主键id,-->
<insert id="insert" parameterType="com.xm.core.entity.XmProjectGroupUser" useGeneratedKeys="false" keyProperty="id">
<!-- 新增一条记录 主键group_id,userid,-->
<insert id="insert" parameterType="com.xm.core.entity.XmProjectGroupUser" useGeneratedKeys="false" >
insert into xm_project_group_user( insert into xm_project_group_user(
<include refid="columns"/> <include refid="columns"/>
) values ( ) values (
#{joinTime},#{id},#{groupId},#{userid},#{username},#{isHead},#{outTime},#{status},#{bizProcInstId},#{bizFlowState},#{projectId}
#{joinTime},#{groupId},#{userid},#{username},#{outTime},#{status},#{obranchId},#{isPri},#{seqNo}
) )
</insert> </insert>
@ -95,7 +97,7 @@
<!-- 按主键删除一条记录--> <!-- 按主键删除一条记录-->
<delete id="deleteByPk" parameterType="com.xm.core.entity.XmProjectGroupUser"> <delete id="deleteByPk" parameterType="com.xm.core.entity.XmProjectGroupUser">
delete from xm_project_group_user delete from xm_project_group_user
where id = #{id}
where group_id = #{groupId} and userid = #{userid}
</delete> </delete>
<!-- 根据条件修改若干条记录 --> <!-- 根据条件修改若干条记录 -->
@ -104,7 +106,7 @@
<set> <set>
<include refid="someFieldSet"/> <include refid="someFieldSet"/>
</set> </set>
where id = #{id}
where group_id = #{groupId} and userid = #{userid}
</update> </update>
<!-- 根据主键修改一条记录 --> <!-- 根据主键修改一条记录 -->
@ -113,7 +115,7 @@
<set> <set>
<include refid="set"/> <include refid="set"/>
</set> </set>
where id = #{id}
where group_id = #{groupId} and userid = #{userid}
</update> </update>
<!-- 批量新增 批量插入 借用insert 循环插入实现 <!-- 批量新增 批量插入 借用insert 循环插入实现
@ -127,75 +129,64 @@
update xm_project_group_user update xm_project_group_user
set set
<include refid="batchSet"/> <include refid="batchSet"/>
where id = #{item.id}
where group_id = #{item.groupId} and userid = #{item.userid}
</foreach> </foreach>
</update> </update>
<!-- 批量删除 --> <!-- 批量删除 -->
<delete id="batchDelete" parameterType="List"> <delete id="batchDelete" parameterType="List">
delete from xm_project_group_user delete from xm_project_group_user
where where
(id) in
(group_id, userid) in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" > <foreach collection="list" item="item" index="index" open="(" separator="," close=")" >
( #{item.id} )
( #{item.groupId}, #{item.userid} )
</foreach> </foreach>
</delete> </delete>
<!--sql片段 列--> <!--sql片段 列-->
<sql id="columns"> <sql id="columns">
join_time,id,group_id,userid,username,is_head,out_time,status,biz_proc_inst_id,biz_flow_state,project_id
join_time,group_id,userid,username,out_time,status,obranch_id,is_pri,seq_no
</sql> </sql>
<!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS--> <!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS-->
<sql id="where"> <sql id="where">
<if test="joinTime != null"> and date_format(res.join_time,'%Y-%m-%d') = date_format(#{joinTime},'%Y-%m-%d') </if> <if test="joinTime != null"> and date_format(res.join_time,'%Y-%m-%d') = date_format(#{joinTime},'%Y-%m-%d') </if>
<if test="id != null and id != ''"> and res.id = #{id} </if>
<if test="groupId != null and groupId != ''"> and res.group_id = #{groupId} </if> <if test="groupId != null and groupId != ''"> and res.group_id = #{groupId} </if>
<if test="userid != null and userid != ''"> and res.userid = #{userid} </if> <if test="userid != null and userid != ''"> and res.userid = #{userid} </if>
<if test="username != null and username != ''"> and res.username = #{username} </if> <if test="username != null and username != ''"> and res.username = #{username} </if>
<if test="isHead != null and isHead != ''"> and res.is_head = #{isHead} </if>
<if test="outTime != null"> and date_format(res.out_time,'%Y-%m-%d') = date_format(#{outTime},'%Y-%m-%d') </if> <if test="outTime != null"> and date_format(res.out_time,'%Y-%m-%d') = date_format(#{outTime},'%Y-%m-%d') </if>
<if test="status != null and status != ''"> and res.status = #{status} </if> <if test="status != null and status != ''"> and res.status = #{status} </if>
<if test="bizProcInstId != null and bizProcInstId != ''"> and res.biz_proc_inst_id = #{bizProcInstId} </if>
<if test="bizFlowState != null and bizFlowState != ''"> and res.biz_flow_state = #{bizFlowState} </if>
<if test="projectId != null and projectId != ''"> and res.project_id = #{projectId} </if>
<if test="obranchId != null and obranchId != ''"> and res.obranch_id = #{obranchId} </if>
<if test="isPri != null and isPri != ''"> and res.is_pri = #{isPri} </if>
<if test="seqNo != null and seqNo != ''"> and res.seq_no = #{seqNo} </if>
</sql> </sql>
<!--sql片段 更新字段 --> <!--sql片段 更新字段 -->
<sql id="set"> <sql id="set">
join_time = #{joinTime}, join_time = #{joinTime},
group_id = #{groupId},
userid = #{userid},
username = #{username}, username = #{username},
is_head = #{isHead},
out_time = #{outTime}, out_time = #{outTime},
status = #{status}, status = #{status},
biz_proc_inst_id = #{bizProcInstId},
biz_flow_state = #{bizFlowState},
project_id = #{projectId}
obranch_id = #{obranchId},
is_pri = #{isPri},
seq_no = #{seqNo}
</sql> </sql>
<sql id="someFieldSet"> <sql id="someFieldSet">
<if test="joinTime != null"> join_time = #{joinTime}, </if> <if test="joinTime != null"> join_time = #{joinTime}, </if>
<if test="groupId != null and groupId != ''"> group_id = #{groupId}, </if>
<if test="userid != null and userid != ''"> userid = #{userid}, </if>
<if test="username != null and username != ''"> username = #{username}, </if> <if test="username != null and username != ''"> username = #{username}, </if>
<if test="isHead != null and isHead != ''"> is_head = #{isHead}, </if>
<if test="outTime != null"> out_time = #{outTime}, </if> <if test="outTime != null"> out_time = #{outTime}, </if>
<if test="status != null and status != ''"> status = #{status}, </if> <if test="status != null and status != ''"> status = #{status}, </if>
<if test="bizProcInstId != null and bizProcInstId != ''"> biz_proc_inst_id = #{bizProcInstId}, </if>
<if test="bizFlowState != null and bizFlowState != ''"> biz_flow_state = #{bizFlowState}, </if>
<if test="projectId != null and projectId != ''"> project_id = #{projectId}, </if>
<if test="obranchId != null and obranchId != ''"> obranch_id = #{obranchId}, </if>
<if test="isPri != null and isPri != ''"> is_pri = #{isPri}, </if>
<if test="seqNo != null and seqNo != ''"> seq_no = #{seqNo}, </if>
</sql> </sql>
<!--sql片段 批量更新 --> <!--sql片段 批量更新 -->
<sql id="batchSet"> <sql id="batchSet">
join_time = #{item.joinTime}, join_time = #{item.joinTime},
group_id = #{item.groupId},
userid = #{item.userid},
username = #{item.username}, username = #{item.username},
is_head = #{item.isHead},
out_time = #{item.outTime}, out_time = #{item.outTime},
status = #{item.status}, status = #{item.status},
biz_proc_inst_id = #{item.bizProcInstId},
biz_flow_state = #{item.bizFlowState},
project_id = #{item.projectId}
obranch_id = #{item.obranchId},
is_pri = #{item.isPri},
seq_no = #{item.seqNo}
</sql> </sql>
</mapper> </mapper>
Loading…
Cancel
Save