Browse Source

添加节点类型、标签等

master
陈裕财 4 years ago
parent
commit
3f5bfce202
  1. 34
      xm-core/src/main/java/com/xm/core/entity/XmMenu.java
  2. 81
      xm-core/src/main/java/com/xm/core/entity/XmProjectPhase.java
  3. 81
      xm-core/src/main/java/com/xm/core/entity/XmTask.java
  4. 30
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmMenuMapper.xml
  5. 142
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProjectPhaseMapper.xml
  6. 225
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmTaskMapper.xml

34
xm-core/src/main/java/com/xm/core/entity/XmMenu.java

@ -7,9 +7,9 @@ import java.util.Date;
/** /**
* 组织 com 顶级模块 xm 大模块 core 小模块 <br> * 组织 com 顶级模块 xm 大模块 core 小模块 <br>
* 实体 XmMenu所有属性名: <br> * 实体 XmMenu所有属性名: <br>
* menuId,menuName,pmenuId,productId,remark,status,online,demandUrl,codeUrl,designUrl,docUrl,helpUrl,operDocUrl,seqNo,mmUserid,mmUsername,ctime,ntype,sinceVersion,childrenCnt,ltime;<br>
* menuId,menuName,pmenuId,productId,remark,status,online,demandUrl,codeUrl,designUrl,docUrl,helpUrl,operDocUrl,seqNo,mmUserid,mmUsername,ctime,ntype,sinceVersion,childrenCnt,ltime,tagIds,tagNames;<br>
* xm_menu 功能表的所有字段名: <br> * xm_menu 功能表的所有字段名: <br>
* menu_id,menu_name,pmenu_id,product_id,remark,status,online,demand_url,code_url,design_url,doc_url,help_url,oper_doc_url,seq_no,mm_userid,mm_username,ctime,ntype,since_version,children_cnt,ltime;<br>
* menu_id,menu_name,pmenu_id,product_id,remark,status,online,demand_url,code_url,design_url,doc_url,help_url,oper_doc_url,seq_no,mm_userid,mm_username,ctime,ntype,since_version,children_cnt,ltime,tag_ids,tag_names;<br>
* 当前主键(包括多主键):<br> * 当前主键(包括多主键):<br>
* menu_id;<br> * menu_id;<br>
*/ */
@ -81,6 +81,12 @@ public class XmMenu implements java.io.Serializable {
@ApiModelProperty(notes="更新时间",allowEmptyValue=true,example="",allowableValues="") @ApiModelProperty(notes="更新时间",allowEmptyValue=true,example="",allowableValues="")
Date ltime; Date ltime;
@ApiModelProperty(notes="标签编号,逗号分割",allowEmptyValue=true,example="",allowableValues="")
String tagIds;
@ApiModelProperty(notes="标签名称,逗号分割",allowEmptyValue=true,example="",allowableValues="")
String tagNames;
/**功能编号**/ /**功能编号**/
public XmMenu(String menuId) { public XmMenu(String menuId) {
@ -217,6 +223,18 @@ public class XmMenu implements java.io.Serializable {
public void setLtime(Date ltime) { public void setLtime(Date ltime) {
this.ltime = ltime; this.ltime = ltime;
} }
/**
* 标签编号,逗号分割
**/
public void setTagIds(String tagIds) {
this.tagIds = tagIds;
}
/**
* 标签名称,逗号分割
**/
public void setTagNames(String tagNames) {
this.tagNames = tagNames;
}
/** /**
* 功能编号 * 功能编号
@ -344,5 +362,17 @@ public class XmMenu implements java.io.Serializable {
public Date getLtime() { public Date getLtime() {
return this.ltime; return this.ltime;
} }
/**
* 标签编号,逗号分割
**/
public String getTagIds() {
return this.tagIds;
}
/**
* 标签名称,逗号分割
**/
public String getTagNames() {
return this.tagNames;
}
} }

81
xm-core/src/main/java/com/xm/core/entity/XmProjectPhase.java

@ -8,9 +8,9 @@ import java.math.BigDecimal;
/** /**
* 组织 com 顶级模块 xm 大模块 core 小模块 <br> * 组织 com 顶级模块 xm 大模块 core 小模块 <br>
* 实体 XmProjectPhase所有属性名: <br> * 实体 XmProjectPhase所有属性名: <br>
* id,phaseName,remark,parentPhaseId,branchId,projectId,beginDate,endDate,phaseBudgetHours,phaseBudgetStaffNu,ctime,phaseBudgetNouserAt,phaseBudgetInnerUserAt,phaseBudgetOutUserAt,projectBaselineId,bizProcInstId,bizFlowState,phaseBudgetWorkload,phaseActWorkload,phaseActInnerUserWorkload,phaseActOutUserWorkload,taskType,planType,seqNo,phaseBudgetInnerUserWorkload,phaseBudgetOutUserWorkload,actNouserAt,actInnerUserAt,phaseBudgetInnerUserPrice,phaseBudgetOutUserPrice,phaseBudgetOutUserCnt,phaseBudgetInnerUserCnt,actRate,phaseStatus,actOutUserAt,taskCnt,finishTaskCnt,iterationCnt,calcTime,taskBudgetWorkload,taskBudgetAt,mngUserid,mngUsername,milestone,pleaf;<br>
* XM.xm_project_phase 项目阶段模板的所有字段名: <br>
* id,phase_name,remark,parent_phase_id,branch_id,project_id,begin_date,end_date,phase_budget_hours,phase_budget_staff_nu,ctime,phase_budget_nouser_at,phase_budget_inner_user_at,phase_budget_out_user_at,project_baseline_id,biz_proc_inst_id,biz_flow_state,phase_budget_workload,phase_act_workload,phase_act_inner_user_workload,phase_act_out_user_workload,task_type,plan_type,seq_no,phase_budget_inner_user_workload,phase_budget_out_user_workload,act_nouser_at,act_inner_user_at,phase_budget_inner_user_price,phase_budget_out_user_price,phase_budget_out_user_cnt,phase_budget_inner_user_cnt,act_rate,phase_status,act_out_user_at,task_cnt,finish_task_cnt,iteration_cnt,calc_time,task_budget_workload,task_budget_at,mng_userid,mng_username,milestone,pleaf;<br>
* id,phaseName,remark,parentPhaseId,branchId,projectId,beginDate,endDate,phaseBudgetHours,phaseBudgetStaffNu,ctime,phaseBudgetNouserAt,phaseBudgetInnerUserAt,phaseBudgetOutUserAt,projectBaselineId,bizProcInstId,bizFlowState,phaseBudgetWorkload,phaseActWorkload,phaseActInnerUserWorkload,phaseActOutUserWorkload,taskType,planType,seqNo,phaseBudgetInnerUserWorkload,phaseBudgetOutUserWorkload,actNouserAt,actInnerUserAt,phaseBudgetInnerUserPrice,phaseBudgetOutUserPrice,phaseBudgetOutUserCnt,phaseBudgetInnerUserCnt,actRate,phaseStatus,actOutUserAt,taskCnt,finishTaskCnt,iterationCnt,calcTime,taskBudgetWorkload,taskBudgetAt,mngUserid,mngUsername,milestone,pleaf,tagIds,tagNames,ntype,childrenCnt,ltime;<br>
* xm_project_phase 项目阶段模板的所有字段名: <br>
* id,phase_name,remark,parent_phase_id,branch_id,project_id,begin_date,end_date,phase_budget_hours,phase_budget_staff_nu,ctime,phase_budget_nouser_at,phase_budget_inner_user_at,phase_budget_out_user_at,project_baseline_id,biz_proc_inst_id,biz_flow_state,phase_budget_workload,phase_act_workload,phase_act_inner_user_workload,phase_act_out_user_workload,task_type,plan_type,seq_no,phase_budget_inner_user_workload,phase_budget_out_user_workload,act_nouser_at,act_inner_user_at,phase_budget_inner_user_price,phase_budget_out_user_price,phase_budget_out_user_cnt,phase_budget_inner_user_cnt,act_rate,phase_status,act_out_user_at,task_cnt,finish_task_cnt,iteration_cnt,calc_time,task_budget_workload,task_budget_at,mng_userid,mng_username,milestone,pleaf,tag_ids,tag_names,ntype,children_cnt,ltime;<br>
* 当前主键(包括多主键):<br> * 当前主键(包括多主键):<br>
* id;<br> * id;<br>
*/ */
@ -154,6 +154,21 @@ public class XmProjectPhase implements java.io.Serializable {
@ApiModelProperty(notes="节点是否为叶子节点",allowEmptyValue=true,example="",allowableValues="") @ApiModelProperty(notes="节点是否为叶子节点",allowEmptyValue=true,example="",allowableValues="")
String pleaf; String pleaf;
@ApiModelProperty(notes="标签编号,逗号分割",allowEmptyValue=true,example="",allowableValues="")
String tagIds;
@ApiModelProperty(notes="标签名称,逗号分割",allowEmptyValue=true,example="",allowableValues="")
String tagNames;
@ApiModelProperty(notes="节点类型0-任务,1-任务集。任务集下建任务,任务下不允许建立任何子节点",allowEmptyValue=true,example="",allowableValues="")
String ntype;
@ApiModelProperty(notes="儿子节点个数",allowEmptyValue=true,example="",allowableValues="")
Integer childrenCnt;
@ApiModelProperty(notes="更新时间",allowEmptyValue=true,example="",allowableValues="")
Date ltime;
/**阶段主键**/ /**阶段主键**/
public XmProjectPhase(String id) { public XmProjectPhase(String id) {
@ -434,6 +449,36 @@ public class XmProjectPhase implements java.io.Serializable {
public void setPleaf(String pleaf) { public void setPleaf(String pleaf) {
this.pleaf = pleaf; this.pleaf = pleaf;
} }
/**
* 标签编号逗号分割
**/
public void setTagIds(String tagIds) {
this.tagIds = tagIds;
}
/**
* 标签名称逗号分割
**/
public void setTagNames(String tagNames) {
this.tagNames = tagNames;
}
/**
* 节点类型0-任务1-任务集任务集下建任务任务下不允许建立任何子节点
**/
public void setNtype(String ntype) {
this.ntype = ntype;
}
/**
* 儿子节点个数
**/
public void setChildrenCnt(Integer childrenCnt) {
this.childrenCnt = childrenCnt;
}
/**
* 更新时间
**/
public void setLtime(Date ltime) {
this.ltime = ltime;
}
/** /**
* 阶段主键 * 阶段主键
@ -705,5 +750,35 @@ public class XmProjectPhase implements java.io.Serializable {
public String getPleaf() { public String getPleaf() {
return this.pleaf; return this.pleaf;
} }
/**
* 标签编号逗号分割
**/
public String getTagIds() {
return this.tagIds;
}
/**
* 标签名称逗号分割
**/
public String getTagNames() {
return this.tagNames;
}
/**
* 节点类型0-任务1-任务集任务集下建任务任务下不允许建立任何子节点
**/
public String getNtype() {
return this.ntype;
}
/**
* 儿子节点个数
**/
public Integer getChildrenCnt() {
return this.childrenCnt;
}
/**
* 更新时间
**/
public Date getLtime() {
return this.ltime;
}
} }

81
xm-core/src/main/java/com/xm/core/entity/XmTask.java

@ -8,9 +8,9 @@ import java.math.BigDecimal;
/** /**
* 组织 com 顶级模块 xm 大模块 core 小模块 <br> * 组织 com 顶级模块 xm 大模块 core 小模块 <br>
* 实体 XmTask所有属性名: <br> * 实体 XmTask所有属性名: <br>
* id,name,parentTaskid,parentTaskname,projectId,projectName,level,sortLevel,executorUserid,executorUsername,preTaskid,preTaskname,startTime,endTime,milestone,description,remarks,createUserid,createUsername,createTime,rate,budgetCost,budgetWorkload,actCost,actWorkload,taskState,taskType,taskClass,toTaskCenter,actStartTime,actEndTime,bizProcInstId,bizFlowState,projectPhaseId,projectPhaseName,taskSkillNames,exeUsernames,taskSkillIds,exeUserids,taskOut,planType,settleSchemel,menuId,menuName,productId,productName,cbranchId,cdeptid;<br>
* XM.xm_task xm_task的所有字段名: <br>
* id,name,parent_taskid,parent_taskname,project_id,project_name,level,sort_level,executor_userid,executor_username,pre_taskid,pre_taskname,start_time,end_time,milestone,description,remarks,create_userid,create_username,create_time,rate,budget_cost,budget_workload,act_cost,act_workload,task_state,task_type,task_class,to_task_center,act_start_time,act_end_time,biz_proc_inst_id,biz_flow_state,project_phase_id,project_phase_name,task_skill_names,exe_usernames,task_skill_ids,exe_userids,task_out,plan_type,settle_schemel,menu_id,menu_name,product_id,product_name,cbranch_id,cdeptid;<br>
* id,name,parentTaskid,parentTaskname,projectId,projectName,level,sortLevel,executorUserid,executorUsername,preTaskid,preTaskname,startTime,endTime,milestone,description,remarks,createUserid,createUsername,createTime,rate,budgetCost,budgetWorkload,actCost,actWorkload,taskState,taskType,taskClass,toTaskCenter,actStartTime,actEndTime,bizProcInstId,bizFlowState,projectPhaseId,projectPhaseName,taskSkillNames,exeUsernames,taskSkillIds,exeUserids,taskOut,planType,settleSchemel,menuId,menuName,productId,productName,cbranchId,cdeptid,tagIds,tagNames,ntype,childrenCnt,ltime;<br>
* xm_task xm_task的所有字段名: <br>
* id,name,parent_taskid,parent_taskname,project_id,project_name,level,sort_level,executor_userid,executor_username,pre_taskid,pre_taskname,start_time,end_time,milestone,description,remarks,create_userid,create_username,create_time,rate,budget_cost,budget_workload,act_cost,act_workload,task_state,task_type,task_class,to_task_center,act_start_time,act_end_time,biz_proc_inst_id,biz_flow_state,project_phase_id,project_phase_name,task_skill_names,exe_usernames,task_skill_ids,exe_userids,task_out,plan_type,settle_schemel,menu_id,menu_name,product_id,product_name,cbranch_id,cdeptid,tag_ids,tag_names,ntype,children_cnt,ltime;<br>
* 当前主键(包括多主键):<br> * 当前主键(包括多主键):<br>
* id;<br> * id;<br>
*/ */
@ -163,6 +163,21 @@ public class XmTask implements java.io.Serializable {
@ApiModelProperty(notes="创建部门",allowEmptyValue=true,example="",allowableValues="") @ApiModelProperty(notes="创建部门",allowEmptyValue=true,example="",allowableValues="")
String cdeptid; String cdeptid;
@ApiModelProperty(notes="标签编号,逗号分割",allowEmptyValue=true,example="",allowableValues="")
String tagIds;
@ApiModelProperty(notes="标签名称,逗号分割",allowEmptyValue=true,example="",allowableValues="")
String tagNames;
@ApiModelProperty(notes="节点类型0-任务,1-任务集。任务集下建任务,任务下不允许建立任何子节点",allowEmptyValue=true,example="",allowableValues="")
String ntype;
@ApiModelProperty(notes="儿子节点个数",allowEmptyValue=true,example="",allowableValues="")
Integer childrenCnt;
@ApiModelProperty(notes="更新时间",allowEmptyValue=true,example="",allowableValues="")
Date ltime;
/**任务编号**/ /**任务编号**/
public XmTask(String id) { public XmTask(String id) {
@ -461,6 +476,36 @@ public class XmTask implements java.io.Serializable {
public void setCdeptid(String cdeptid) { public void setCdeptid(String cdeptid) {
this.cdeptid = cdeptid; this.cdeptid = cdeptid;
} }
/**
* 标签编号逗号分割
**/
public void setTagIds(String tagIds) {
this.tagIds = tagIds;
}
/**
* 标签名称逗号分割
**/
public void setTagNames(String tagNames) {
this.tagNames = tagNames;
}
/**
* 节点类型0-任务1-任务集任务集下建任务任务下不允许建立任何子节点
**/
public void setNtype(String ntype) {
this.ntype = ntype;
}
/**
* 儿子节点个数
**/
public void setChildrenCnt(Integer childrenCnt) {
this.childrenCnt = childrenCnt;
}
/**
* 更新时间
**/
public void setLtime(Date ltime) {
this.ltime = ltime;
}
/** /**
* 任务编号 * 任务编号
@ -750,5 +795,35 @@ public class XmTask implements java.io.Serializable {
public String getCdeptid() { public String getCdeptid() {
return this.cdeptid; return this.cdeptid;
} }
/**
* 标签编号逗号分割
**/
public String getTagIds() {
return this.tagIds;
}
/**
* 标签名称逗号分割
**/
public String getTagNames() {
return this.tagNames;
}
/**
* 节点类型0-任务1-任务集任务集下建任务任务下不允许建立任何子节点
**/
public String getNtype() {
return this.ntype;
}
/**
* 儿子节点个数
**/
public Integer getChildrenCnt() {
return this.childrenCnt;
}
/**
* 更新时间
**/
public Date getLtime() {
return this.ltime;
}
} }

30
xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmMenuMapper.xml

@ -5,12 +5,12 @@
<!--开始 自定sql函数区域 请在此区域添加自定义函数,其它区域尽量不要动,因为代码随时重新生成 --> <!--开始 自定sql函数区域 请在此区域添加自定义函数,其它区域尽量不要动,因为代码随时重新生成 -->
<sql id="whereForMap">
<if test=" menuIds != null"> and (res.menu_id) in
<foreach collection="menuIds" item="item" index="index" open="(" separator="," close=")" >
( #{item})
</foreach>
</if>
<sql id="whereForMap">
<if test=" menuIds != null"> and (res.menu_id) in
<foreach collection="menuIds" item="item" index="index" open="(" separator="," close=")" >
( #{item})
</foreach>
</if>
<if test=' iterationFilterType!=null and iterationFilterType!=""'> <if test=' iterationFilterType!=null and iterationFilterType!=""'>
and <if test='iterationFilterType=="not-join"'> not </if> and <if test='iterationFilterType=="not-join"'> not </if>
exists ( select 1 from xm_iteration_menu im where im.menu_id=res.menu_id) exists ( select 1 from xm_iteration_menu im where im.menu_id=res.menu_id)
@ -21,7 +21,7 @@
</if> </if>
<if test="key != null and key !='' "> and res.menu_name like #{key} </if> <if test="key != null and key !='' "> and res.menu_name like #{key} </if>
<if test="isTop != null and isTop !='' "> and res.pmenu_id is null</if> <if test="isTop != null and isTop !='' "> and res.pmenu_id is null</if>
</sql>
</sql>
<select id="selectExistIterationMenus" parameterType="HashMap" resultType="com.xm.core.entity.XmMenu"> <select id="selectExistIterationMenus" parameterType="HashMap" resultType="com.xm.core.entity.XmMenu">
select * from xm_menu res select * from xm_menu res
@ -100,7 +100,7 @@
insert into xm_menu( insert into xm_menu(
<include refid="columns"/> <include refid="columns"/>
) values ( ) values (
#{menuId},#{menuName},#{pmenuId},#{productId},#{remark},#{status},#{online},#{demandUrl},#{codeUrl},#{designUrl},#{docUrl},#{helpUrl},#{operDocUrl},#{seqNo},#{mmUserid},#{mmUsername},#{ctime},#{ntype},#{sinceVersion},#{childrenCnt},#{ltime}
#{menuId},#{menuName},#{pmenuId},#{productId},#{remark},#{status},#{online},#{demandUrl},#{codeUrl},#{designUrl},#{docUrl},#{helpUrl},#{operDocUrl},#{seqNo},#{mmUserid},#{mmUsername},#{ctime},#{ntype},#{sinceVersion},#{childrenCnt},#{ltime},#{tagIds},#{tagNames}
) )
</insert> </insert>
@ -163,7 +163,7 @@
<!--sql片段 列--> <!--sql片段 列-->
<sql id="columns"> <sql id="columns">
menu_id,menu_name,pmenu_id,product_id,remark,status,online,demand_url,code_url,design_url,doc_url,help_url,oper_doc_url,seq_no,mm_userid,mm_username,ctime,ntype,since_version,children_cnt,ltime
menu_id,menu_name,pmenu_id,product_id,remark,status,online,demand_url,code_url,design_url,doc_url,help_url,oper_doc_url,seq_no,mm_userid,mm_username,ctime,ntype,since_version,children_cnt,ltime,tag_ids,tag_names
</sql> </sql>
<!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS--> <!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS-->
@ -189,6 +189,8 @@
<if test="sinceVersion != null and sinceVersion != ''"> and res.since_version = #{sinceVersion} </if> <if test="sinceVersion != null and sinceVersion != ''"> and res.since_version = #{sinceVersion} </if>
<if test="childrenCnt != null and childrenCnt != ''"> and res.children_cnt = #{childrenCnt} </if> <if test="childrenCnt != null and childrenCnt != ''"> and res.children_cnt = #{childrenCnt} </if>
<if test="ltime != null"> and date_format(res.ltime,'%Y-%m-%d') = date_format(#{ltime},'%Y-%m-%d') </if> <if test="ltime != null"> and date_format(res.ltime,'%Y-%m-%d') = date_format(#{ltime},'%Y-%m-%d') </if>
<if test="tagIds != null and tagIds != ''"> and res.tag_ids = #{tagIds} </if>
<if test="tagNames != null and tagNames != ''"> and res.tag_names = #{tagNames} </if>
</sql> </sql>
<!--sql片段 更新字段 --> <!--sql片段 更新字段 -->
<sql id="set"> <sql id="set">
@ -211,7 +213,9 @@
ntype = #{ntype}, ntype = #{ntype},
since_version = #{sinceVersion}, since_version = #{sinceVersion},
children_cnt = #{childrenCnt}, children_cnt = #{childrenCnt},
ltime = #{ltime}
ltime = #{ltime},
tag_ids = #{tagIds},
tag_names = #{tagNames}
</sql> </sql>
<sql id="someFieldSet"> <sql id="someFieldSet">
<if test="menuName != null and menuName != ''"> menu_name = #{menuName}, </if> <if test="menuName != null and menuName != ''"> menu_name = #{menuName}, </if>
@ -234,6 +238,8 @@
<if test="sinceVersion != null and sinceVersion != ''"> since_version = #{sinceVersion}, </if> <if test="sinceVersion != null and sinceVersion != ''"> since_version = #{sinceVersion}, </if>
<if test="childrenCnt != null and childrenCnt != ''"> children_cnt = #{childrenCnt}, </if> <if test="childrenCnt != null and childrenCnt != ''"> children_cnt = #{childrenCnt}, </if>
<if test="ltime != null"> ltime = #{ltime}, </if> <if test="ltime != null"> ltime = #{ltime}, </if>
<if test="tagIds != null and tagIds != ''"> tag_ids = #{tagIds}, </if>
<if test="tagNames != null and tagNames != ''"> tag_names = #{tagNames}, </if>
</sql> </sql>
<!--sql片段 批量更新 --> <!--sql片段 批量更新 -->
<sql id="batchSet"> <sql id="batchSet">
@ -256,6 +262,8 @@
ntype = #{item.ntype}, ntype = #{item.ntype},
since_version = #{item.sinceVersion}, since_version = #{item.sinceVersion},
children_cnt = #{item.childrenCnt}, children_cnt = #{item.childrenCnt},
ltime = #{item.ltime}
ltime = #{item.ltime},
tag_ids = #{item.tagIds},
tag_names = #{item.tagNames}
</sql> </sql>
</mapper> </mapper>

142
xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProjectPhaseMapper.xml

@ -3,45 +3,56 @@
<mapper namespace="com.xm.core.entity.XmProjectPhase"> <mapper namespace="com.xm.core.entity.XmProjectPhase">
<!--开始 自定sql函数区域 -->
<!--请在此区域添加自定义函数-->
<!-- 查询项目总预算,计划总预算 id,code,name,xm_type,start_time,end_time,urgent,priority,description,create_userid,create_username,create_time,assess,assess_remarks,status,branch_id,total_budget_cost,biz_proc_inst_id,biz_flow_state,total_budget_nouser,total_budget_inner_user,total_budget_out_user,locked,base_time,base_remark,baseline_id,total_budget_workload,total_receivables,budget_margin_rate,contract_amt,budget_inner_user_price,budget_out_user_price,budget_out_user_cnt,budget_inner_user_cnt,plan_working_hours,tax_rate
-->
<!--开始 自定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='iterationId!=null and iterationId!="" '>
and exists( select 1 from xm_task t inner join xm_iteration_menu im on t.menu_id=im.menu_id where t.project_phase_id=res.id and im.iteration_id=#{iterationId})
</if>
<if test='productId!=null and productId!="" '>
and exists( select 1 from xm_task t where t.product_id=#{productId})
</if>
<if test="key != null and key !='' "> </if>
</sql>
<select id="selectTotalProjectAndPhaseBudgetCost" parameterType="HashMap" resultType="HashMap"> <select id="selectTotalProjectAndPhaseBudgetCost" parameterType="HashMap" resultType="HashMap">
SELECT SELECT
sum( res.phase_budget_workload ) AS phase_budget_workload,
sum( res.phase_budget_nouser_at ) AS phase_budget_nouser_at,
sum( res.phase_budget_inner_user_at ) AS phase_budget_inner_user_at,
sum( res.phase_budget_out_user_at ) AS phase_budget_out_user_at,
p.plan_nouser_at,
p.plan_inner_user_at,
p.plan_out_user_at,
p.locked,
p.plan_workload,
p.total_receivables,
p.budget_margin_rate,
p.contract_amt,
p.plan_inner_user_price,
p.plan_out_user_price,
p.plan_out_user_cnt,
p.plan_inner_user_cnt,
p.plan_working_hours,
p.plan_total_cost
sum( res.phase_budget_workload ) AS phase_budget_workload,
sum( res.phase_budget_nouser_at ) AS phase_budget_nouser_at,
sum( res.phase_budget_inner_user_at ) AS phase_budget_inner_user_at,
sum( res.phase_budget_out_user_at ) AS phase_budget_out_user_at,
p.plan_nouser_at,
p.plan_inner_user_at,
p.plan_out_user_at,
p.locked,
p.plan_workload,
p.total_receivables,
p.budget_margin_rate,
p.contract_amt,
p.plan_inner_user_price,
p.plan_out_user_price,
p.plan_out_user_cnt,
p.plan_inner_user_cnt,
p.plan_working_hours,
p.plan_total_cost
FROM FROM
XM.xm_project p
LEFT JOIN XM.xm_project_phase res
ON p.id = res.project_id
<if test=" excludePhaseIds !=null "> and res.id not in
<foreach collection="excludePhaseIds" item="item" index="index" open="(" separator="," close=")" >
#{item}
</foreach>
</if>
XM.xm_project p
LEFT JOIN XM.xm_project_phase res
ON p.id = res.project_id
<if test=" excludePhaseIds !=null "> and res.id not in
<foreach collection="excludePhaseIds" item="item" index="index" open="(" separator="," close=")" >
#{item}
</foreach>
</if>
where p.id=#{projectId} where p.id=#{projectId}
</select> </select>
<update id="loadTasksToXmProjectPhase" parameterType="String" statementType="CALLABLE"> <update id="loadTasksToXmProjectPhase" parameterType="String" statementType="CALLABLE">
{call load_tasks_to_xm_project_phase(#{projectId,mode=IN})}
{call load_tasks_to_xm_project_phase(#{projectId,mode=IN})}
</update> </update>
<select id="checkExistsTask" parameterType="String" resultType="Long"> <select id="checkExistsTask" parameterType="String" resultType="Long">
select count(1) from xm_task t where t.project_phase_id=#{phaseId} select count(1) from xm_task t where t.project_phase_id=#{phaseId}
@ -50,6 +61,8 @@
<select id="checkExistsChildren" parameterType="String" resultType="Long" > <select id="checkExistsChildren" parameterType="String" resultType="Long" >
select count(1) from xm_project_phase res where res.parent_phase_id = #{id} select count(1) from xm_project_phase res where res.parent_phase_id = #{id}
</select> </select>
<!--结束 自定义sql函数区域--> <!--结束 自定义sql函数区域-->
@ -57,23 +70,10 @@
<!-- 通过条件查询获取数据列表 返回list<map> --> <!-- 通过条件查询获取数据列表 返回list<map> -->
<select id="selectListMapByWhere" parameterType="HashMap" resultType="HashMap"> <select id="selectListMapByWhere" parameterType="HashMap" resultType="HashMap">
select * from xm_project_phase res select * from xm_project_phase 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='iterationId!=null and iterationId!="" '>
and exists( select 1 from xm_task t inner join xm_iteration_menu im on t.menu_id=im.menu_id where t.project_phase_id=res.id and im.iteration_id=#{iterationId})
</if>
<if test='productId!=null and productId!="" '>
and exists( select 1 from xm_task t where t.product_id=#{productId})
</if>
<if test="key != null and key !='' "> </if>
</where> </where>
order by res.seq_no asc order by res.seq_no asc
</select> </select>
@ -110,27 +110,27 @@
insert into xm_project_phase( insert into xm_project_phase(
<include refid="columns"/> <include refid="columns"/>
) values ( ) values (
#{id},#{phaseName},#{remark},#{parentPhaseId},#{branchId},#{projectId},#{beginDate},#{endDate},#{phaseBudgetHours},#{phaseBudgetStaffNu},#{ctime},#{phaseBudgetNouserAt},#{phaseBudgetInnerUserAt},#{phaseBudgetOutUserAt},#{projectBaselineId},#{bizProcInstId},#{bizFlowState},#{phaseBudgetWorkload},#{phaseActWorkload},#{phaseActInnerUserWorkload},#{phaseActOutUserWorkload},#{taskType},#{planType},#{seqNo},#{phaseBudgetInnerUserWorkload},#{phaseBudgetOutUserWorkload},#{actNouserAt},#{actInnerUserAt},#{phaseBudgetInnerUserPrice},#{phaseBudgetOutUserPrice},#{phaseBudgetOutUserCnt},#{phaseBudgetInnerUserCnt},#{actRate},#{phaseStatus},#{actOutUserAt},#{taskCnt},#{finishTaskCnt},#{iterationCnt},#{calcTime},#{taskBudgetWorkload},#{taskBudgetAt},#{mngUserid},#{mngUsername},#{milestone},#{pleaf}
#{id},#{phaseName},#{remark},#{parentPhaseId},#{branchId},#{projectId},#{beginDate},#{endDate},#{phaseBudgetHours},#{phaseBudgetStaffNu},#{ctime},#{phaseBudgetNouserAt},#{phaseBudgetInnerUserAt},#{phaseBudgetOutUserAt},#{projectBaselineId},#{bizProcInstId},#{bizFlowState},#{phaseBudgetWorkload},#{phaseActWorkload},#{phaseActInnerUserWorkload},#{phaseActOutUserWorkload},#{taskType},#{planType},#{seqNo},#{phaseBudgetInnerUserWorkload},#{phaseBudgetOutUserWorkload},#{actNouserAt},#{actInnerUserAt},#{phaseBudgetInnerUserPrice},#{phaseBudgetOutUserPrice},#{phaseBudgetOutUserCnt},#{phaseBudgetInnerUserCnt},#{actRate},#{phaseStatus},#{actOutUserAt},#{taskCnt},#{finishTaskCnt},#{iterationCnt},#{calcTime},#{taskBudgetWorkload},#{taskBudgetAt},#{mngUserid},#{mngUsername},#{milestone},#{pleaf},#{tagIds},#{tagNames},#{ntype},#{childrenCnt},#{ltime}
) )
</insert> </insert>
<!-- 按条件删除若干条记录--> <!-- 按条件删除若干条记录-->
<delete id="deleteByWhere" parameterType="com.xm.core.entity.XmProjectPhase"> <delete id="deleteByWhere" parameterType="com.xm.core.entity.XmProjectPhase">
delete from xm_project_phase
delete from xm_project_phase res
<where> <where>
1=2
<include refid="where"/>
</where> </where>
</delete> </delete>
<!-- 按主键删除一条记录--> <!-- 按主键删除一条记录-->
<delete id="deleteByPk" parameterType="com.xm.core.entity.XmProjectPhase"> <delete id="deleteByPk" parameterType="com.xm.core.entity.XmProjectPhase">
delete from xm_project_phase
delete from xm_project_phase
where id = #{id} where id = #{id}
</delete> </delete>
<!-- 根据条件修改若干条记录 --> <!-- 根据条件修改若干条记录 -->
<update id="updateSomeFieldByPk" parameterType="com.xm.core.entity.XmProjectPhase"> <update id="updateSomeFieldByPk" parameterType="com.xm.core.entity.XmProjectPhase">
update xm_project_phase
update xm_project_phase
<set> <set>
<include refid="someFieldSet"/> <include refid="someFieldSet"/>
</set> </set>
@ -139,7 +139,7 @@
<!-- 根据主键修改一条记录 --> <!-- 根据主键修改一条记录 -->
<update id="updateByPk" parameterType="com.xm.core.entity.XmProjectPhase"> <update id="updateByPk" parameterType="com.xm.core.entity.XmProjectPhase">
update xm_project_phase
update xm_project_phase
<set> <set>
<include refid="set"/> <include refid="set"/>
</set> </set>
@ -154,7 +154,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_project_phase
update xm_project_phase
set set
<include refid="batchSet"/> <include refid="batchSet"/>
where id = #{item.id} where id = #{item.id}
@ -162,20 +162,18 @@
</update> </update>
<!-- 批量删除 --> <!-- 批量删除 -->
<delete id="batchDelete" parameterType="List"> <delete id="batchDelete" parameterType="List">
delete from xm_project_phase
delete from xm_project_phase
where where
(id)
in
(id) in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" > <foreach collection="list" item="item" index="index" open="(" separator="," close=")" >
( #{item.id}
)
( #{item.id} )
</foreach> </foreach>
</delete> </delete>
<!--sql片段 列--> <!--sql片段 列-->
<sql id="columns"> <sql id="columns">
id,phase_name,remark,parent_phase_id,branch_id,project_id,begin_date,end_date,phase_budget_hours,phase_budget_staff_nu,ctime,phase_budget_nouser_at,phase_budget_inner_user_at,phase_budget_out_user_at,project_baseline_id,biz_proc_inst_id,biz_flow_state,phase_budget_workload,phase_act_workload,phase_act_inner_user_workload,phase_act_out_user_workload,task_type,plan_type,seq_no,phase_budget_inner_user_workload,phase_budget_out_user_workload,act_nouser_at,act_inner_user_at,phase_budget_inner_user_price,phase_budget_out_user_price,phase_budget_out_user_cnt,phase_budget_inner_user_cnt,act_rate,phase_status,act_out_user_at,task_cnt,finish_task_cnt,iteration_cnt,calc_time,task_budget_workload,task_budget_at,mng_userid,mng_username,milestone,pleaf
id,phase_name,remark,parent_phase_id,branch_id,project_id,begin_date,end_date,phase_budget_hours,phase_budget_staff_nu,ctime,phase_budget_nouser_at,phase_budget_inner_user_at,phase_budget_out_user_at,project_baseline_id,biz_proc_inst_id,biz_flow_state,phase_budget_workload,phase_act_workload,phase_act_inner_user_workload,phase_act_out_user_workload,task_type,plan_type,seq_no,phase_budget_inner_user_workload,phase_budget_out_user_workload,act_nouser_at,act_inner_user_at,phase_budget_inner_user_price,phase_budget_out_user_price,phase_budget_out_user_cnt,phase_budget_inner_user_cnt,act_rate,phase_status,act_out_user_at,task_cnt,finish_task_cnt,iteration_cnt,calc_time,task_budget_workload,task_budget_at,mng_userid,mng_username,milestone,pleaf,tag_ids,tag_names,ntype,children_cnt,ltime
</sql> </sql>
<!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS--> <!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS-->
@ -225,6 +223,11 @@
<if test="mngUsername != null and mngUsername != ''"> and res.mng_username = #{mngUsername} </if> <if test="mngUsername != null and mngUsername != ''"> and res.mng_username = #{mngUsername} </if>
<if test="milestone != null and milestone != ''"> and res.milestone = #{milestone} </if> <if test="milestone != null and milestone != ''"> and res.milestone = #{milestone} </if>
<if test="pleaf != null and pleaf != ''"> and res.pleaf = #{pleaf} </if> <if test="pleaf != null and pleaf != ''"> and res.pleaf = #{pleaf} </if>
<if test="tagIds != null and tagIds != ''"> and res.tag_ids = #{tagIds} </if>
<if test="tagNames != null and tagNames != ''"> and res.tag_names = #{tagNames} </if>
<if test="ntype != null and ntype != ''"> and res.ntype = #{ntype} </if>
<if test="childrenCnt != null and childrenCnt != ''"> and res.children_cnt = #{childrenCnt} </if>
<if test="ltime != null"> and date_format(res.ltime,'%Y-%m-%d') = date_format(#{ltime},'%Y-%m-%d') </if>
</sql> </sql>
<!--sql片段 更新字段 --> <!--sql片段 更新字段 -->
<sql id="set"> <sql id="set">
@ -271,7 +274,12 @@
mng_userid = #{mngUserid}, mng_userid = #{mngUserid},
mng_username = #{mngUsername}, mng_username = #{mngUsername},
milestone = #{milestone}, milestone = #{milestone},
pleaf = #{pleaf}
pleaf = #{pleaf},
tag_ids = #{tagIds},
tag_names = #{tagNames},
ntype = #{ntype},
children_cnt = #{childrenCnt},
ltime = #{ltime}
</sql> </sql>
<sql id="someFieldSet"> <sql id="someFieldSet">
<if test="phaseName != null and phaseName != ''"> phase_name = #{phaseName}, </if> <if test="phaseName != null and phaseName != ''"> phase_name = #{phaseName}, </if>
@ -318,6 +326,11 @@
<if test="mngUsername != null and mngUsername != ''"> mng_username = #{mngUsername}, </if> <if test="mngUsername != null and mngUsername != ''"> mng_username = #{mngUsername}, </if>
<if test="milestone != null and milestone != ''"> milestone = #{milestone}, </if> <if test="milestone != null and milestone != ''"> milestone = #{milestone}, </if>
<if test="pleaf != null and pleaf != ''"> pleaf = #{pleaf}, </if> <if test="pleaf != null and pleaf != ''"> pleaf = #{pleaf}, </if>
<if test="tagIds != null and tagIds != ''"> tag_ids = #{tagIds}, </if>
<if test="tagNames != null and tagNames != ''"> tag_names = #{tagNames}, </if>
<if test="ntype != null and ntype != ''"> ntype = #{ntype}, </if>
<if test="childrenCnt != null and childrenCnt != ''"> children_cnt = #{childrenCnt}, </if>
<if test="ltime != null"> ltime = #{ltime}, </if>
</sql> </sql>
<!--sql片段 批量更新 --> <!--sql片段 批量更新 -->
<sql id="batchSet"> <sql id="batchSet">
@ -364,6 +377,11 @@
mng_userid = #{item.mngUserid}, mng_userid = #{item.mngUserid},
mng_username = #{item.mngUsername}, mng_username = #{item.mngUsername},
milestone = #{item.milestone}, milestone = #{item.milestone},
pleaf = #{item.pleaf}
pleaf = #{item.pleaf},
tag_ids = #{item.tagIds},
tag_names = #{item.tagNames},
ntype = #{item.ntype},
children_cnt = #{item.childrenCnt},
ltime = #{item.ltime}
</sql> </sql>
</mapper> </mapper>

225
xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmTaskMapper.xml

@ -3,8 +3,49 @@
<mapper namespace="com.xm.core.entity.XmTask"> <mapper namespace="com.xm.core.entity.XmTask">
<!--开始 自定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=" createTimeStart !=null "> and res.create_time &gt; #{createTimeStart} </if>
<if test=" createTimeEnd !=null "> and res.create_time &lt; #{createTimeEnd} </if>
<include refid="where"/>
<if test="parent != null and parent != ''"> and (res.parent_taskid = '' or res.parent_taskid IS NULL)</if>
<!-- 我参与的-->
<if test=" (myExecuserStatus != null and myExecuserStatus) != '' or ( isMy !=null and isMy !='' )">
and exists ( select 1 from xm_task_execuser exe where exe.task_id=res.id and exe.userid=#{userid}
<if test=' myExecuserStatus != "all" and myExecuserStatus!=null and myExecuserStatus !="" '>
and exe.status=#{myExecuserStatus}
</if>
)
</if>
<!-- 我关注的 -->
<if test="myFocus != null and myFocus != ''">
and exists ( select 1 from xm_my_focus f where f.userid=#{userid} and f.project_id=res.project_id and f.task_id=res.id )
</if>
<if test="skillIds != null and skillIds != ''">
and exists ( select 1 from xm_task_skill f where f.task_id=res.id and f.task_skill_id in
<foreach collection="skillIds" item="item" index="index" open="(" separator="," close=")" >
#{item}
</foreach>
)
</if>
<if test="compete !=null and compete!=''">
and ( exists ( select 1 from xm_project_group_user gu where gu.userid=#{compete} and gu.project_id=res.project_id )
or exists ( select 1 from xm_task_execuser exe where exe.project_id=res.project_id and exe.userid=#{compete})
)
</if>
<if test="iterationId!=null and iterationId!=''">
and exists ( select 1 from xm_iteration_menu im where im.menu_id=res.menu_id and im.iteration_id=#{iterationId})
</if>
<if test="key != null and key !='' "> and res.name like #{key} </if>
<if test="work != null and work != ''"> and res.rate != '100' </if>
</sql>
<select id="getAvgRate" parameterType="String" resultType="long" > <select id="getAvgRate" parameterType="String" resultType="long" >
select avg(res.rate) from xm_task res where res.parent_taskid = #{parentTaskid} select avg(res.rate) from xm_task res where res.parent_taskid = #{parentTaskid}
</select> </select>
@ -27,40 +68,40 @@
update xm_task set menu_id = #{menuId}, menu_name = #{menuName},product_id=#{productId},product_name=#{productName} where id = #{id} update xm_task set menu_id = #{menuId}, menu_name = #{menuName},product_id=#{productId},product_name=#{productName} where id = #{id}
</update> </update>
<!-- 插入流程审批表数据 -->
<!-- 插入流程审批表数据 -->
<insert id="insertProcessApprova" <insert id="insertProcessApprova"
parameterType="HashMap"
useGeneratedKeys="false" keyProperty="id">
parameterType="HashMap"
useGeneratedKeys="false" keyProperty="id">
insert into xm_task_process_approva ( insert into xm_task_process_approva (
id,xm_task_id,project_id,flow_branch_id,agree,act_id,task_name,proc_inst_id,main_title,comment_msg,flow_last_time,event_name,biz_key,model_key,assignee,start_userid,proc_def_id
id,xm_task_id,project_id,flow_branch_id,agree,act_id,task_name,proc_inst_id,main_title,comment_msg,flow_last_time,event_name,biz_key,model_key,assignee,start_userid,proc_def_id
) values ( ) values (
#{id},#{xmTaskId},#{projectId},#{flowBranchId},#{agree},#{actId},#{taskName},#{procInstId},#{mainTitle},#{commentMsg},#{flowLastTime},#{eventName},#{bizKey},#{modelKey},#{assignee},#{startUserid},#{procDefId}
#{id},#{xmTaskId},#{projectId},#{flowBranchId},#{agree},#{actId},#{taskName},#{procInstId},#{mainTitle},#{commentMsg},#{flowLastTime},#{eventName},#{bizKey},#{modelKey},#{assignee},#{startUserid},#{procDefId}
) )
</insert> </insert>
<!-- 同时修改业务表及流程审批表数据状态 -->
<!-- 同时修改业务表及流程审批表数据状态 -->
<update id="updateProcessApprova" <update id="updateProcessApprova"
parameterType="HashMap">
parameterType="HashMap">
update xm_task b ,XM.xm_task_process_approva pa update xm_task b ,XM.xm_task_process_approva pa
<set>
<if test=' agree != null and agree !="" '> pa.agree = #{agree},</if>
<if test=' actId != null and actId !="" '> pa.act_id = #{actId},</if>
<if test=' assignee != null and assignee !="" '> pa.assignee = #{assignee},</if>
<if test=' assigneeName != null and assigneeName !="" '> pa.assignee_name = #{assigneeName},</if>
<if test=' taskName != null and taskName !="" '> pa.task_name = #{taskName},</if>
<if test=' commentMsg != null and commentMsg !="" '> pa.comment_msg = #{commentMsg},</if>
pa.flow_last_time = now(),
<if test=' eventName != null and eventName !="" '> pa.event_name = #{eventName},</if>
<if test=' flowState != null and flowState !="" '> pa.flow_state=#{flowState},</if>
<if test=' bizFlowState != null and bizFlowState !="" '> b.biz_flow_state=#{bizFlowState},</if>
<if test=' bizProcInstId != null and bizProcInstId !="" '> b.biz_proc_inst_id=#{bizProcInstId},</if>
</set>
<set>
<if test=' agree != null and agree !="" '> pa.agree = #{agree},</if>
<if test=' actId != null and actId !="" '> pa.act_id = #{actId},</if>
<if test=' assignee != null and assignee !="" '> pa.assignee = #{assignee},</if>
<if test=' assigneeName != null and assigneeName !="" '> pa.assignee_name = #{assigneeName},</if>
<if test=' taskName != null and taskName !="" '> pa.task_name = #{taskName},</if>
<if test=' commentMsg != null and commentMsg !="" '> pa.comment_msg = #{commentMsg},</if>
pa.flow_last_time = now(),
<if test=' eventName != null and eventName !="" '> pa.event_name = #{eventName},</if>
<if test=' flowState != null and flowState !="" '> pa.flow_state=#{flowState},</if>
<if test=' bizFlowState != null and bizFlowState !="" '> b.biz_flow_state=#{bizFlowState},</if>
<if test=' bizProcInstId != null and bizProcInstId !="" '> b.biz_proc_inst_id=#{bizProcInstId},</if>
</set>
where pa.proc_inst_id = #{procInstId} and pa.flow_branch_id=#{flowBranchId} where pa.proc_inst_id = #{procInstId} and pa.flow_branch_id=#{flowBranchId}
and b.id=pa.xm_task_id
and b.id=pa.xm_task_id
</update> </update>
<update id="updateFlowStateByProcInstForDeleteSuccess" <update id="updateFlowStateByProcInstForDeleteSuccess"
parameterType="HashMap">
parameterType="HashMap">
update xm_task_process_approva pa set pa.flow_state='2' update xm_task_process_approva pa set pa.flow_state='2'
where pa.proc_inst_id = #{procInstId} and pa.flow_branch_id=#{flowBranchId} where pa.proc_inst_id = #{procInstId} and pa.flow_branch_id=#{flowBranchId}
</update> </update>
@ -68,42 +109,43 @@
<!-- 按条件删除若干条记录--> <!-- 按条件删除若干条记录-->
<delete id="deleteByProcInstId" parameterType="HashMap"> <delete id="deleteByProcInstId" parameterType="HashMap">
delete from xm_task delete from xm_task
where biz_proc_inst_id=#{procInstId}
where biz_proc_inst_id=#{procInstId}
</delete> </delete>
<!-- 查询任务总的预算及对应的阶段的预算,任务总预算不能大于阶段总预算 --> <!-- 查询任务总的预算及对应的阶段的预算,任务总预算不能大于阶段总预算 -->
<select id="selectTotalPhaseAndTaskBudgetCost" parameterType="HashMap" resultType="HashMap"> <select id="selectTotalPhaseAndTaskBudgetCost" parameterType="HashMap" resultType="HashMap">
SELECT SELECT
sum( ifnull(res.budget_cost,0) ) AS budget_cost,
sum( case when res.task_out='1' then ifnull(res.budget_cost,0) else 0 end ) AS task_budget_out_user_at,
sum( case when res.task_out='1' then 0 else ifnull(res.budget_cost,0) end ) AS task_budget_inner_user_at,
sum(0) AS task_budget_nouser_at,
sum( res.budget_workload ) AS budget_workload,
p.phase_budget_nouser_at,
p.phase_budget_inner_user_at,
p.phase_budget_out_user_at,
p.phase_budget_workload,
p.phase_budget_hours,
p.phase_budget_staff_nu
sum( ifnull(res.budget_cost,0) ) AS budget_cost,
sum( case when res.task_out='1' then ifnull(res.budget_cost,0) else 0 end ) AS task_budget_out_user_at,
sum( case when res.task_out='1' then 0 else ifnull(res.budget_cost,0) end ) AS task_budget_inner_user_at,
sum(0) AS task_budget_nouser_at,
sum( res.budget_workload ) AS budget_workload,
p.phase_budget_nouser_at,
p.phase_budget_inner_user_at,
p.phase_budget_out_user_at,
p.phase_budget_workload,
p.phase_budget_hours,
p.phase_budget_staff_nu
FROM xm_project_phase p LEFT JOIN xm_task res FROM xm_project_phase p LEFT JOIN xm_task res
ON p.id = res.project_phase_id ON p.id = res.project_phase_id
WHERE WHERE
p.id = #{projectPhaseId}
<if test=" excludeTaskIds !=null "> and res.id not in
<foreach collection="excludeTaskIds" item="item" index="index" open="(" separator="," close=")" >
#{item}
</foreach>
</if>
p.id = #{projectPhaseId}
<if test=" excludeTaskIds !=null "> and res.id not in
<foreach collection="excludeTaskIds" item="item" index="index" open="(" separator="," close=")" >
#{item}
</foreach>
</if>
</select> </select>
<!-- 通过条件查询获取数据列表 不分页 返回 list<Object> --> <!-- 通过条件查询获取数据列表 不分页 返回 list<Object> -->
<select id="selectTaskListByIds" parameterType="HashMap" resultType="com.xm.core.entity.XmTask"> <select id="selectTaskListByIds" parameterType="HashMap" resultType="com.xm.core.entity.XmTask">
select * from xm_task res select * from xm_task res
where res.id in where res.id in
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" >
#{item}
</foreach>
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" >
#{item}
</foreach>
</select> </select>
<!--结束 自定义sql函数区域--> <!--结束 自定义sql函数区域-->
@ -113,50 +155,11 @@
select res.*,pa.proc_inst_id,pa.assignee,pa.assignee_name,pa.main_title,pa.flow_branch_id,pa.task_name,pa.agree,pa.flow_last_time,pa.comment_msg,pa.proc_def_id,pa.flow_state select res.*,pa.proc_inst_id,pa.assignee,pa.assignee_name,pa.main_title,pa.flow_branch_id,pa.task_name,pa.agree,pa.flow_last_time,pa.comment_msg,pa.proc_def_id,pa.flow_state
from xm_task res left join xm_task_process_approva pa on res.id=pa.xm_task_id and res.biz_proc_inst_id=pa.proc_inst_id from xm_task res left join xm_task_process_approva pa on res.id=pa.xm_task_id and res.biz_proc_inst_id=pa.proc_inst_id
left join xm_project p on p.id=res.project_id left join xm_project p on p.id=res.project_id
<where>
<if test="ids != null"> and
id in
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" >
#{item}
</foreach>
</if>
<if test=" createTimeStart !=null "> and res.create_time &gt; #{createTimeStart} </if>
<if test=" createTimeEnd !=null "> and res.create_time &lt; #{createTimeEnd} </if>
<where>
<include refid="whereForMap"/>
<include refid="where"/> <include refid="where"/>
<if test="parent != null and parent != ''"> and (res.parent_taskid = '' or res.parent_taskid IS NULL)</if>
<!-- 我参与的-->
<if test=" (myExecuserStatus != null and myExecuserStatus) != '' or ( isMy !=null and isMy !='' )">
and exists ( select 1 from xm_task_execuser exe where exe.task_id=res.id and exe.userid=#{userid}
<if test=' myExecuserStatus != "all" and myExecuserStatus!=null and myExecuserStatus !="" '>
and exe.status=#{myExecuserStatus}
</if>
)
</if>
<!-- 我关注的 -->
<if test="myFocus != null and myFocus != ''">
and exists ( select 1 from xm_my_focus f where f.userid=#{userid} and f.project_id=res.project_id and f.task_id=res.id )
</if>
<if test="skillIds != null and skillIds != ''">
and exists ( select 1 from xm_task_skill f where f.task_id=res.id and f.task_skill_id in
<foreach collection="skillIds" item="item" index="index" open="(" separator="," close=")" >
#{item}
</foreach>
)
</if>
<if test="compete !=null and compete!=''">
and ( exists ( select 1 from xm_project_group_user gu where gu.userid=#{compete} and gu.project_id=res.project_id )
or exists ( select 1 from xm_task_execuser exe where exe.project_id=res.project_id and exe.userid=#{compete})
)
</if>
<if test="iterationId!=null and iterationId!=''">
and exists ( select 1 from xm_iteration_menu im where im.menu_id=res.menu_id and im.iteration_id=#{iterationId})
</if>
<if test="key != null and key !='' "> and res.name like #{key} </if>
<if test="work != null and work != ''"> and res.rate != '100' </if>
</where> </where>
order by res.sort_level asc order by res.sort_level asc
</select> </select>
@ -193,27 +196,27 @@
insert into xm_task( insert into xm_task(
<include refid="columns"/> <include refid="columns"/>
) values ( ) values (
#{id},#{name},#{parentTaskid},#{parentTaskname},#{projectId},#{projectName},#{level},#{sortLevel},#{executorUserid},#{executorUsername},#{preTaskid},#{preTaskname},#{startTime},#{endTime},#{milestone},#{description},#{remarks},#{createUserid},#{createUsername},#{createTime},#{rate},#{budgetCost},#{budgetWorkload},#{actCost},#{actWorkload},#{taskState},#{taskType},#{taskClass},#{toTaskCenter},#{actStartTime},#{actEndTime},#{bizProcInstId},#{bizFlowState},#{projectPhaseId},#{projectPhaseName},#{taskSkillNames},#{exeUsernames},#{taskSkillIds},#{exeUserids},#{taskOut},#{planType},#{settleSchemel},#{menuId},#{menuName},#{productId},#{productName},#{cbranchId},#{cdeptid}
#{id},#{name},#{parentTaskid},#{parentTaskname},#{projectId},#{projectName},#{level},#{sortLevel},#{executorUserid},#{executorUsername},#{preTaskid},#{preTaskname},#{startTime},#{endTime},#{milestone},#{description},#{remarks},#{createUserid},#{createUsername},#{createTime},#{rate},#{budgetCost},#{budgetWorkload},#{actCost},#{actWorkload},#{taskState},#{taskType},#{taskClass},#{toTaskCenter},#{actStartTime},#{actEndTime},#{bizProcInstId},#{bizFlowState},#{projectPhaseId},#{projectPhaseName},#{taskSkillNames},#{exeUsernames},#{taskSkillIds},#{exeUserids},#{taskOut},#{planType},#{settleSchemel},#{menuId},#{menuName},#{productId},#{productName},#{cbranchId},#{cdeptid},#{tagIds},#{tagNames},#{ntype},#{childrenCnt},#{ltime}
) )
</insert> </insert>
<!-- 按条件删除若干条记录--> <!-- 按条件删除若干条记录-->
<delete id="deleteByWhere" parameterType="com.xm.core.entity.XmTask"> <delete id="deleteByWhere" parameterType="com.xm.core.entity.XmTask">
delete from xm_task
delete from xm_task res
<where> <where>
1=2
<include refid="where"/>
</where> </where>
</delete> </delete>
<!-- 按主键删除一条记录--> <!-- 按主键删除一条记录-->
<delete id="deleteByPk" parameterType="com.xm.core.entity.XmTask"> <delete id="deleteByPk" parameterType="com.xm.core.entity.XmTask">
delete from xm_task
delete from xm_task
where id = #{id} where id = #{id}
</delete> </delete>
<!-- 根据条件修改若干条记录 --> <!-- 根据条件修改若干条记录 -->
<update id="updateSomeFieldByPk" parameterType="com.xm.core.entity.XmTask"> <update id="updateSomeFieldByPk" parameterType="com.xm.core.entity.XmTask">
update xm_task
update xm_task
<set> <set>
<include refid="someFieldSet"/> <include refid="someFieldSet"/>
</set> </set>
@ -222,7 +225,7 @@
<!-- 根据主键修改一条记录 --> <!-- 根据主键修改一条记录 -->
<update id="updateByPk" parameterType="com.xm.core.entity.XmTask"> <update id="updateByPk" parameterType="com.xm.core.entity.XmTask">
update xm_task
update xm_task
<set> <set>
<include refid="set"/> <include refid="set"/>
</set> </set>
@ -237,7 +240,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_task
update xm_task
set set
<include refid="batchSet"/> <include refid="batchSet"/>
where id = #{item.id} where id = #{item.id}
@ -245,20 +248,18 @@
</update> </update>
<!-- 批量删除 --> <!-- 批量删除 -->
<delete id="batchDelete" parameterType="List"> <delete id="batchDelete" parameterType="List">
delete from xm_task
delete from xm_task
where where
(id)
in
(id) in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" > <foreach collection="list" item="item" index="index" open="(" separator="," close=")" >
( #{item.id}
)
( #{item.id} )
</foreach> </foreach>
</delete> </delete>
<!--sql片段 列--> <!--sql片段 列-->
<sql id="columns"> <sql id="columns">
id,name,parent_taskid,parent_taskname,project_id,project_name,level,sort_level,executor_userid,executor_username,pre_taskid,pre_taskname,start_time,end_time,milestone,description,remarks,create_userid,create_username,create_time,rate,budget_cost,budget_workload,act_cost,act_workload,task_state,task_type,task_class,to_task_center,act_start_time,act_end_time,biz_proc_inst_id,biz_flow_state,project_phase_id,project_phase_name,task_skill_names,exe_usernames,task_skill_ids,exe_userids,task_out,plan_type,settle_schemel,menu_id,menu_name,product_id,product_name,cbranch_id,cdeptid
id,name,parent_taskid,parent_taskname,project_id,project_name,level,sort_level,executor_userid,executor_username,pre_taskid,pre_taskname,start_time,end_time,milestone,description,remarks,create_userid,create_username,create_time,rate,budget_cost,budget_workload,act_cost,act_workload,task_state,task_type,task_class,to_task_center,act_start_time,act_end_time,biz_proc_inst_id,biz_flow_state,project_phase_id,project_phase_name,task_skill_names,exe_usernames,task_skill_ids,exe_userids,task_out,plan_type,settle_schemel,menu_id,menu_name,product_id,product_name,cbranch_id,cdeptid,tag_ids,tag_names,ntype,children_cnt,ltime
</sql> </sql>
<!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS--> <!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS-->
@ -311,6 +312,11 @@
<if test="productName != null and productName != ''"> and res.product_name = #{productName} </if> <if test="productName != null and productName != ''"> and res.product_name = #{productName} </if>
<if test="cbranchId != null and cbranchId != ''"> and res.cbranch_id = #{cbranchId} </if> <if test="cbranchId != null and cbranchId != ''"> and res.cbranch_id = #{cbranchId} </if>
<if test="cdeptid != null and cdeptid != ''"> and res.cdeptid = #{cdeptid} </if> <if test="cdeptid != null and cdeptid != ''"> and res.cdeptid = #{cdeptid} </if>
<if test="tagIds != null and tagIds != ''"> and res.tag_ids = #{tagIds} </if>
<if test="tagNames != null and tagNames != ''"> and res.tag_names = #{tagNames} </if>
<if test="ntype != null and ntype != ''"> and res.ntype = #{ntype} </if>
<if test="childrenCnt != null and childrenCnt != ''"> and res.children_cnt = #{childrenCnt} </if>
<if test="ltime != null"> and date_format(res.ltime,'%Y-%m-%d') = date_format(#{ltime},'%Y-%m-%d') </if>
</sql> </sql>
<!--sql片段 更新字段 --> <!--sql片段 更新字段 -->
<sql id="set"> <sql id="set">
@ -360,7 +366,12 @@
product_id = #{productId}, product_id = #{productId},
product_name = #{productName}, product_name = #{productName},
cbranch_id = #{cbranchId}, cbranch_id = #{cbranchId},
cdeptid = #{cdeptid}
cdeptid = #{cdeptid},
tag_ids = #{tagIds},
tag_names = #{tagNames},
ntype = #{ntype},
children_cnt = #{childrenCnt},
ltime = #{ltime}
</sql> </sql>
<sql id="someFieldSet"> <sql id="someFieldSet">
<if test="name != null and name != ''"> name = #{name}, </if> <if test="name != null and name != ''"> name = #{name}, </if>
@ -410,6 +421,11 @@
<if test="productName != null and productName != ''"> product_name = #{productName}, </if> <if test="productName != null and productName != ''"> product_name = #{productName}, </if>
<if test="cbranchId != null and cbranchId != ''"> cbranch_id = #{cbranchId}, </if> <if test="cbranchId != null and cbranchId != ''"> cbranch_id = #{cbranchId}, </if>
<if test="cdeptid != null and cdeptid != ''"> cdeptid = #{cdeptid}, </if> <if test="cdeptid != null and cdeptid != ''"> cdeptid = #{cdeptid}, </if>
<if test="tagIds != null and tagIds != ''"> tag_ids = #{tagIds}, </if>
<if test="tagNames != null and tagNames != ''"> tag_names = #{tagNames}, </if>
<if test="ntype != null and ntype != ''"> ntype = #{ntype}, </if>
<if test="childrenCnt != null and childrenCnt != ''"> children_cnt = #{childrenCnt}, </if>
<if test="ltime != null"> ltime = #{ltime}, </if>
</sql> </sql>
<!--sql片段 批量更新 --> <!--sql片段 批量更新 -->
<sql id="batchSet"> <sql id="batchSet">
@ -459,6 +475,11 @@
product_id = #{item.productId}, product_id = #{item.productId},
product_name = #{item.productName}, product_name = #{item.productName},
cbranch_id = #{item.cbranchId}, cbranch_id = #{item.cbranchId},
cdeptid = #{item.cdeptid}
cdeptid = #{item.cdeptid},
tag_ids = #{item.tagIds},
tag_names = #{item.tagNames},
ntype = #{item.ntype},
children_cnt = #{item.childrenCnt},
ltime = #{item.ltime}
</sql> </sql>
</mapper> </mapper>
Loading…
Cancel
Save