提交修改

This commit is contained in:
quyixiao 2020-08-19 22:43:26 +08:00
parent 547ad3b9f8
commit d9e362b87e
19 changed files with 182 additions and 70 deletions

View File

@ -10,9 +10,15 @@ import com.lz.modules.app.resp.ResultDetailResp;
import com.lz.modules.app.service.DepartmentsService; import com.lz.modules.app.service.DepartmentsService;
import com.lz.modules.app.service.DepartmentsStaffRelateService; import com.lz.modules.app.service.DepartmentsStaffRelateService;
import com.lz.modules.app.service.StaffService; import com.lz.modules.app.service.StaffService;
import com.lz.modules.flow.entity.Flow;
import com.lz.modules.flow.entity.FlowDepartment;
import com.lz.modules.flow.entity.FlowRelation;
import com.lz.modules.flow.entity.RecordAuth; import com.lz.modules.flow.entity.RecordAuth;
import com.lz.modules.flow.model.Auth; import com.lz.modules.flow.model.Auth;
import com.lz.modules.flow.req.ResultDetailReq; import com.lz.modules.flow.req.ResultDetailReq;
import com.lz.modules.flow.service.FlowDepartmentService;
import com.lz.modules.flow.service.FlowRelationService;
import com.lz.modules.flow.service.FlowService;
import com.lz.modules.flow.service.RecordAuthService; import com.lz.modules.flow.service.RecordAuthService;
import com.lz.modules.sys.controller.AbstractController; import com.lz.modules.sys.controller.AbstractController;
import com.lz.modules.sys.entity.SysUserEntity; import com.lz.modules.sys.entity.SysUserEntity;
@ -64,8 +70,14 @@ public class ResultRecordController extends AbstractController {
@Autowired @Autowired
private RecordAuthService recordAuthService; private RecordAuthService recordAuthService;
@Autowired
private FlowDepartmentService flowDepartmentService;
@Autowired
private FlowRelationService flowRelationService;
@Autowired
private FlowService flowService;
/** /**
* 列表 * 列表
@ -74,7 +86,7 @@ public class ResultRecordController extends AbstractController {
@RequiresPermissions("user:lzresultrecord:list") @RequiresPermissions("user:lzresultrecord:list")
public R list(ResultRecordReq req) { public R list(ResultRecordReq req) {
SysUserEntity user = getUser(); SysUserEntity user = getUser();
PageUtils page = lzResultRecordService.queryPage(req,user); PageUtils page = lzResultRecordService.queryPage(req, user);
List<DepartmentsDto> departmentList1 = departmentsService.selectByParentDepartmentId("0"); List<DepartmentsDto> departmentList1 = departmentsService.selectByParentDepartmentId("0");
return R.ok().put("page", page) return R.ok().put("page", page)
.put("departmentList1", departmentList1); .put("departmentList1", departmentList1);
@ -136,7 +148,7 @@ public class ResultRecordController extends AbstractController {
} }
//保存文件价值观 //保存文件价值观
recordType =3; recordType = 3;
insertWenHuaJiaZhiGua("做人:相信、包容、担当", resultRecordNew.getId(), getUserId()); insertWenHuaJiaZhiGua("做人:相信、包容、担当", resultRecordNew.getId(), getUserId());
insertWenHuaJiaZhiGua("做事:用户第一、求真、极致", resultRecordNew.getId(), getUserId()); insertWenHuaJiaZhiGua("做事:用户第一、求真、极致", resultRecordNew.getId(), getUserId());
recordResultId = resultRecordNew.getId(); recordResultId = resultRecordNew.getId();
@ -152,11 +164,11 @@ public class ResultRecordController extends AbstractController {
int type1 = tempType1; int type1 = tempType1;
int type2 = tempType2; int type2 = tempType2;
if (tempType1 == 0) { if (tempType1 == 0) {
type1 = 1 ; type1 = 1;
list.add(getYeJi()); list.add(getYeJi());
list.add(getYeJiKaoHe()); list.add(getYeJiKaoHe());
} }
if(tempType2 == 0 ){ if (tempType2 == 0) {
type2 = 2; type2 = 2;
} }
firstRowspan = type1; firstRowspan = type1;
@ -189,7 +201,7 @@ public class ResultRecordController extends AbstractController {
list.add(getWenHuaJiaZhiGua1(auth)); list.add(getWenHuaJiaZhiGua1(auth));
list.add(getWenHuaJiaZhiGua2(auth)); list.add(getWenHuaJiaZhiGua2(auth));
} }
}else{ } else {
int type1 = 1; int type1 = 1;
int type2 = 2; int type2 = 2;
firstRowspan = type1; firstRowspan = type1;
@ -223,6 +235,39 @@ public class ResultRecordController extends AbstractController {
.put("recordResultId", recordResultId); .put("recordResultId", recordResultId);
} }
@RequestMapping("/commitApproval")
public R commitApproval(ResultRecordReq req) {
ResultRecord resultRecord = resultRecordService.selectResultRecordById(req.getRecordResultId());
StaffEntity staffEntity = staffService.selectStaffById(resultRecord.getStaffId());
FlowDepartment flowDepartment = flowDepartmentService.selectByStaffId(staffEntity.getId());
Long flowId = flowDepartment.getSelfFlowId(); // 表示是部门主管自己
if(flowDepartment == null){
DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateService.selectLastDepartmentByStaffId(staffEntity.getId());
DepartmentsStaffRelateEntity leader = departmentsStaffRelateService.selectLeaderByDepartmentId(departmentsStaffRelateEntity.getDepartmentId());
flowDepartment = flowDepartmentService.selectByStaffId(leader.getId());
flowId = flowDepartment.getChildFlowId();//表示是部门下的普通员工
}
List<FlowDepartment> list = new ArrayList<>();
list.add(flowDepartment);
for (int i = 0; i < 10; i++) {
if (flowDepartment.getParentId() != null && flowDepartment.getParentId() > 0) {
flowDepartment = flowDepartmentService.selectFlowDepartmentById(flowDepartment.getParentId());
}
}
List<FlowRelation> flowRelations = flowRelationService.selectFlowRelationAll();
Map<String ,FlowDepartment> staffEntityMap = list.stream().collect(Collectors.toMap(FlowDepartment::getDepartmentLevel, p -> p));
// approvalList = [ONE_D,TWO_D,HR,BOSS]
List<String> approvalList = new ArrayList<>();
for(FlowRelation flowRelation : flowRelations){
if(staffEntityMap.get(flowRelation.getChild()) != null || flowRelation.getCanReplace() == 0){
approvalList.add(flowRelation.getChild());
}
}
List<Flow> flows = flowService.selectByFlowId(flowId);
return R.ok("提交审批成功");
}
public void insertWenHuaJiaZhiGua(String target, Long recordId, Long staffId) { public void insertWenHuaJiaZhiGua(String target, Long recordId, Long staffId) {
ResultDetail wenhua1 = new ResultDetail(); ResultDetail wenhua1 = new ResultDetail();
wenhua1.setTarget(target); wenhua1.setTarget(target);
@ -243,7 +288,7 @@ public class ResultRecordController extends AbstractController {
return result; return result;
} }
public ResultDetailResp getYeJiKaoHe(){ public ResultDetailResp getYeJiKaoHe() {
ResultDetailResp respHeader = new ResultDetailResp(); ResultDetailResp respHeader = new ResultDetailResp();
respHeader.setKeyResult("业务考核结果"); respHeader.setKeyResult("业务考核结果");
respHeader.setCheckWeight(new BigDecimal(0.7)); respHeader.setCheckWeight(new BigDecimal(0.7));
@ -274,7 +319,7 @@ public class ResultRecordController extends AbstractController {
return wenhua2; return wenhua2;
} }
public ResultDetailResp getWenHuaJiaZhiGuaResult1(){ public ResultDetailResp getWenHuaJiaZhiGuaResult1() {
ResultDetailResp tail1 = new ResultDetailResp(); ResultDetailResp tail1 = new ResultDetailResp();
tail1.setKeyResult("文化价值观考核结果"); tail1.setKeyResult("文化价值观考核结果");
tail1.setCheckWeight(new BigDecimal(0.3)); tail1.setCheckWeight(new BigDecimal(0.3));
@ -286,7 +331,7 @@ public class ResultRecordController extends AbstractController {
} }
public ResultDetailResp getWenHuaJiaZhiGuaResult2(){ public ResultDetailResp getWenHuaJiaZhiGuaResult2() {
ResultDetailResp tail2 = new ResultDetailResp(); ResultDetailResp tail2 = new ResultDetailResp();
tail2.setCheckRange("文化价值观考核结果"); tail2.setCheckRange("文化价值观考核结果");
tail2.setAcquireScore(new BigDecimal(0)); tail2.setAcquireScore(new BigDecimal(0));
@ -295,7 +340,7 @@ public class ResultRecordController extends AbstractController {
return tail2; return tail2;
} }
public ResultDetailResp getLastResult(){ public ResultDetailResp getLastResult() {
ResultDetailResp tail3 = new ResultDetailResp(); ResultDetailResp tail3 = new ResultDetailResp();
tail3.setCheckRange("最终绩效考核结果等级"); tail3.setCheckRange("最终绩效考核结果等级");
tail3.setAcquireScore(new BigDecimal(3.25)); tail3.setAcquireScore(new BigDecimal(3.25));
@ -427,7 +472,7 @@ public class ResultRecordController extends AbstractController {
return R.ok("保存成功").put("recordId", recordId); return R.ok("保存成功").put("recordId", recordId);
} }
public ResultRecord createResultRecord(int type ){ public ResultRecord createResultRecord(int type) {
ResultRecord resultRecord = new ResultRecord(); ResultRecord resultRecord = new ResultRecord();
resultRecord.setMonthTime(new Date()); resultRecord.setMonthTime(new Date());
resultRecord.setCurrentFlowStaffId(getUserId()); resultRecord.setCurrentFlowStaffId(getUserId());
@ -442,6 +487,7 @@ public class ResultRecordController extends AbstractController {
resultRecordService.insertResultRecord(resultRecord); resultRecordService.insertResultRecord(resultRecord);
return resultRecord; return resultRecord;
} }
/** /**
* 保存 * 保存
*/ */

View File

@ -49,4 +49,8 @@ public interface DepartmentsStaffRelateDao extends BaseMapper<DepartmentsStaffRe
List<DepartmentsStaffRelateEntity> selectByStaffIds(@Param("staffIds") List<Long> staffIds); List<DepartmentsStaffRelateEntity> selectByStaffIds(@Param("staffIds") List<Long> staffIds);
List<DepartmentsStaffRelateEntity> selectAll(); List<DepartmentsStaffRelateEntity> selectAll();
DepartmentsStaffRelateEntity selectLastDepartmentByStaffId(@Param("staffId") Long staffId);
DepartmentsStaffRelateEntity selectLeaderByDepartmentId(@Param("departmentId") String departmentId);
} }

View File

@ -31,5 +31,9 @@ public interface DepartmentsStaffRelateService extends IService<DepartmentsStaff
List<DepartmentsStaffRelateEntity> selectAll(); List<DepartmentsStaffRelateEntity> selectAll();
List<DepartmentsStaffRelateEntity> selectByStaffIds(List<Long> staffIds); List<DepartmentsStaffRelateEntity> selectByStaffIds(List<Long> staffIds);
DepartmentsStaffRelateEntity selectLastDepartmentByStaffId(Long staffId);
DepartmentsStaffRelateEntity selectLeaderByDepartmentId(String departmentId);
} }

View File

@ -70,5 +70,15 @@ public class DepartmentsStaffRelateServiceImpl extends ServiceImpl<DepartmentsSt
return departmentsStaffRelateDao.selectByStaffIds(staffIds); return departmentsStaffRelateDao.selectByStaffIds(staffIds);
} }
@Override
public DepartmentsStaffRelateEntity selectLastDepartmentByStaffId(Long staffId) {
return departmentsStaffRelateDao.selectLastDepartmentByStaffId(staffId);
}
@Override
public DepartmentsStaffRelateEntity selectLeaderByDepartmentId(String departmentId) {
return departmentsStaffRelateDao.selectLeaderByDepartmentId(departmentId);
}
} }

View File

@ -31,4 +31,6 @@ public interface FlowDepartmentMapper extends BaseMapper<FlowDepartment> {
FlowDepartment selectByStaffId(@Param("staffId") Long staffId); FlowDepartment selectByStaffId(@Param("staffId") Long staffId);
FlowDepartment selectByParentId(@Param("parentId") Long parentId);
} }

View File

@ -11,6 +11,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lz.modules.flow.entity.Flow; import com.lz.modules.flow.entity.Flow;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper @Mapper
public interface FlowMapper extends BaseMapper<Flow> { public interface FlowMapper extends BaseMapper<Flow> {
@ -30,4 +33,5 @@ public interface FlowMapper extends BaseMapper<Flow> {
int deleteFlowById(@Param("id")Long id); int deleteFlowById(@Param("id")Long id);
List<Flow> selectByFlowId(@Param("flowId") Long flowId);
} }

View File

@ -11,6 +11,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lz.modules.flow.entity.FlowRelation; import com.lz.modules.flow.entity.FlowRelation;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper @Mapper
public interface FlowRelationMapper extends BaseMapper<FlowRelation> { public interface FlowRelationMapper extends BaseMapper<FlowRelation> {
@ -30,4 +33,5 @@ public interface FlowRelationMapper extends BaseMapper<FlowRelation> {
int deleteFlowRelationById(@Param("id")Long id); int deleteFlowRelationById(@Param("id")Long id);
List<FlowRelation> selectFlowRelationAll();
} }

View File

@ -9,7 +9,7 @@ import java.util.Date;
* 菜单权限表 * 菜单权限表
* </p>*流转关系表 * </p>*流转关系表
* @author quyixiao * @author quyixiao
* @since 2020-08-18 * @since 2020-08-19
*/ */
@Data @Data
@ -24,8 +24,6 @@ public class FlowDepartment implements java.io.Serializable {
private Date gmtCreate; private Date gmtCreate;
//最后修改时间 //最后修改时间
private Date gmtModified; private Date gmtModified;
//
private Long departmentId;
//员工 id //员工 id
private Long taffId; private Long taffId;
//自己部门小伙伴 走的 流程id //自己部门小伙伴 走的 流程id
@ -34,6 +32,8 @@ public class FlowDepartment implements java.io.Serializable {
private Long selfFlowId; private Long selfFlowId;
//部门级别 //部门级别
private String departmentLevel; private String departmentLevel;
//
private Long parentId;
/** /**
* *
* @return * @return
@ -94,21 +94,6 @@ public class FlowDepartment implements java.io.Serializable {
this.gmtModified = gmtModified; this.gmtModified = gmtModified;
} }
/**
*
* @return
*/
public Long getDepartmentId() {
return departmentId;
}
/**
*
* @param departmentId
*/
public void setDepartmentId(Long departmentId) {
this.departmentId = departmentId;
}
/** /**
* 员工 id * 员工 id
* @return * @return
@ -169,6 +154,21 @@ public class FlowDepartment implements java.io.Serializable {
this.departmentLevel = departmentLevel; this.departmentLevel = departmentLevel;
} }
/**
*
* @return
*/
public Long getParentId() {
return parentId;
}
/**
*
* @param parentId
*/
public void setParentId(Long parentId) {
this.parentId = parentId;
}
@Override @Override
public String toString() { public String toString() {
return "FlowDepartment{" + return "FlowDepartment{" +
@ -176,11 +176,11 @@ public class FlowDepartment implements java.io.Serializable {
",isDelete=" + isDelete + ",isDelete=" + isDelete +
",gmtCreate=" + gmtCreate + ",gmtCreate=" + gmtCreate +
",gmtModified=" + gmtModified + ",gmtModified=" + gmtModified +
",departmentId=" + departmentId +
",taffId=" + taffId + ",taffId=" + taffId +
",childFlowId=" + childFlowId + ",childFlowId=" + childFlowId +
",selfFlowId=" + selfFlowId + ",selfFlowId=" + selfFlowId +
",departmentLevel=" + departmentLevel + ",departmentLevel=" + departmentLevel +
",parentId=" + parentId +
"}"; "}";
} }
} }

View File

@ -31,4 +31,6 @@ public interface FlowDepartmentService extends IService<FlowDepartment> {
FlowDepartment selectByStaffId(Long staffId); FlowDepartment selectByStaffId(Long staffId);
FlowDepartment selectByParentId(Long parentId);
} }

View File

@ -3,6 +3,8 @@ package com.lz.modules.flow.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.lz.modules.flow.entity.FlowRelation; import com.lz.modules.flow.entity.FlowRelation;
import java.util.List;
/** /**
* <p> * <p>
* 流转关系表 服务类 * 流转关系表 服务类
@ -30,6 +32,5 @@ public interface FlowRelationService extends IService<FlowRelation> {
int deleteFlowRelationById(Long id); int deleteFlowRelationById(Long id);
List<FlowRelation> selectFlowRelationAll();
} }

View File

@ -3,6 +3,8 @@ package com.lz.modules.flow.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.lz.modules.flow.entity.Flow; import com.lz.modules.flow.entity.Flow;
import java.util.List;
/** /**
* <p> * <p>
* 流转表 服务类 * 流转表 服务类
@ -30,6 +32,5 @@ public interface FlowService extends IService<Flow> {
int deleteFlowById(Long id); int deleteFlowById(Long id);
List<Flow> selectByFlowId(Long flowId);
} }

View File

@ -63,5 +63,10 @@ public class FlowDepartmentServiceImpl extends ServiceImpl<FlowDepartmentMapper,
return flowDepartmentMapper.selectByStaffId(staffId); return flowDepartmentMapper.selectByStaffId(staffId);
} }
@Override
public FlowDepartment selectByParentId(Long parentId) {
return flowDepartmentMapper.selectByParentId(parentId);
}
} }

View File

@ -7,6 +7,8 @@ import com.lz.modules.flow.service.FlowRelationService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
/** /**
* <p> * <p>
* 流转关系表 服务类 * 流转关系表 服务类
@ -58,8 +60,11 @@ public class FlowRelationServiceImpl extends ServiceImpl<FlowRelationMapper, Flo
return flowRelationMapper.deleteFlowRelationById(id); return flowRelationMapper.deleteFlowRelationById(id);
} }
@Override
public List<FlowRelation> selectFlowRelationAll() {
return flowRelationMapper.selectFlowRelationAll();
}
} }

View File

@ -7,6 +7,8 @@ import com.lz.modules.flow.service.FlowService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
/** /**
* <p> * <p>
* 流转表 服务类 * 流转表 服务类
@ -58,6 +60,10 @@ public class FlowServiceImpl extends ServiceImpl<FlowMapper, Flow> implements Fl
return flowMapper.deleteFlowById(id); return flowMapper.deleteFlowById(id);
} }
@Override
public List<Flow> selectByFlowId(Long flowId) {
return flowMapper.selectByFlowId(flowId);
}
} }

View File

@ -8,62 +8,61 @@
<result column="is_delete" property="isDelete"/> <result column="is_delete" property="isDelete"/>
<result column="gmt_create" property="gmtCreate"/> <result column="gmt_create" property="gmtCreate"/>
<result column="gmt_modified" property="gmtModified"/> <result column="gmt_modified" property="gmtModified"/>
<result column="department_id" property="departmentId"/>
<result column="taff_id" property="taffId"/> <result column="taff_id" property="taffId"/>
<result column="child_flow_id" property="childFlowId"/> <result column="child_flow_id" property="childFlowId"/>
<result column="self_flow_id" property="selfFlowId"/> <result column="self_flow_id" property="selfFlowId"/>
<result column="department_level" property="departmentLevel"/> <result column="department_level" property="departmentLevel"/>
<result column="parent_id" property="parentId"/>
</resultMap> </resultMap>
<!-- 通用查询结果列 --> <!-- 通用查询结果列 -->
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, department_id AS departmentId, taff_id AS taffId, child_flow_id AS childFlowId, self_flow_id AS selfFlowId, department_level AS departmentLevel id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, taff_id AS taffId, child_flow_id AS childFlowId, self_flow_id AS selfFlowId, department_level AS departmentLevel, parent_id AS parentId
</sql> </sql>
<select id="selectFlowDepartmentById" resultType="FlowDepartment" > <select id="selectFlowDepartmentById" resultType="FlowDepartment" >
select * from lz_flow_department where id=#{id} and is_delete = 0 limit 1 select * from lz_flow_department where id=#{id} and is_delete = 0 limit 1
</select> </select>
<insert id="insertFlowDepartment" parameterType="FlowDepartment" useGeneratedKeys="true" keyProperty="id" > <insert id="insertFlowDepartment" parameterType="FlowDepartment" useGeneratedKeys="true" keyProperty="id" >
insert into lz_flow_department( insert into lz_flow_department(
<if test="departmentId != null">department_id, </if> <if test="taffId != null">taff_id, </if>
<if test="taffId != null">taff_id, </if> <if test="childFlowId != null">child_flow_id, </if>
<if test="childFlowId != null">child_flow_id, </if> <if test="selfFlowId != null">self_flow_id, </if>
<if test="selfFlowId != null">self_flow_id, </if> <if test="departmentLevel != null">department_level, </if>
<if test="departmentLevel != null">department_level, </if> <if test="parentId != null">parent_id, </if>
is_delete, is_delete,
gmt_create, gmt_create,
gmt_modified gmt_modified
)values( )values(
<if test="departmentId != null">#{ departmentId}, </if> <if test="taffId != null">#{ taffId}, </if>
<if test="taffId != null">#{ taffId}, </if> <if test="childFlowId != null">#{ childFlowId}, </if>
<if test="childFlowId != null">#{ childFlowId}, </if> <if test="selfFlowId != null">#{ selfFlowId}, </if>
<if test="selfFlowId != null">#{ selfFlowId}, </if> <if test="departmentLevel != null">#{ departmentLevel}, </if>
<if test="departmentLevel != null">#{ departmentLevel}, </if> <if test="parentId != null">#{ parentId}, </if>
0, 0,
now(), now(),
now() now()
) )
</insert> </insert>
<update id="updateFlowDepartmentById" parameterType="FlowDepartment" > <update id="updateFlowDepartmentById" parameterType="FlowDepartment" >
update update
lz_flow_department lz_flow_department
<trim prefix="set" suffixOverrides=","> <trim prefix="set" suffixOverrides=",">
<if test="isDelete != null">is_delete = #{isDelete},</if> <if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="gmtCreate != null">gmt_create = #{gmtCreate},</if> <if test="gmtCreate != null">gmt_create = #{gmtCreate},</if>
<if test="departmentId != null">department_id = #{departmentId},</if>
<if test="taffId != null">taff_id = #{taffId},</if> <if test="taffId != null">taff_id = #{taffId},</if>
<if test="childFlowId != null">child_flow_id = #{childFlowId},</if> <if test="childFlowId != null">child_flow_id = #{childFlowId},</if>
<if test="selfFlowId != null">self_flow_id = #{selfFlowId},</if> <if test="selfFlowId != null">self_flow_id = #{selfFlowId},</if>
<if test="departmentLevel != null">department_level = #{departmentLevel}</if> <if test="departmentLevel != null">department_level = #{departmentLevel},</if>
<if test="parentId != null">parent_id = #{parentId}</if>
</trim> </trim>
,gmt_modified = now() ,gmt_modified = now()
where id = #{id} where id = #{id}
@ -72,29 +71,33 @@
<update id="updateCoverFlowDepartmentById" parameterType="FlowDepartment" > <update id="updateCoverFlowDepartmentById" parameterType="FlowDepartment" >
update update
lz_flow_department lz_flow_department
set set
is_delete = #{isDelete}, is_delete = #{isDelete},
gmt_create = #{gmtCreate}, gmt_create = #{gmtCreate},
department_id = #{departmentId},
taff_id = #{taffId}, taff_id = #{taffId},
child_flow_id = #{childFlowId}, child_flow_id = #{childFlowId},
self_flow_id = #{selfFlowId}, self_flow_id = #{selfFlowId},
department_level = #{departmentLevel} department_level = #{departmentLevel},
parent_id = #{parentId}
,gmt_modified = now() ,gmt_modified = now()
where id = #{id} where id = #{id}
</update> </update>
<update id="deleteFlowDepartmentById" parameterType="java.lang.Long"> <update id="deleteFlowDepartmentById" parameterType="java.lang.Long">
update lz_flow_department set is_delete = 1 where id=#{id} limit 1 update lz_flow_department set is_delete = 1 where id=#{id} limit 1
</update> </update>
<select id="selectByStaffId" resultType="com.lz.modules.flow.entity.FlowDepartment"> <select id="selectByStaffId" resultType="com.lz.modules.flow.entity.FlowDepartment">
select * from lz_flow_department where is_delete = 0 and taff_id = #{staffId} limit 1 select * from lz_flow_department where is_delete = 0 and taff_id = #{staffId} limit 1
</select> </select>
<select id="selectByParentId" resultType="com.lz.modules.flow.entity.FlowDepartment">
select * from lz_flow_department where is_delete = 0 and parent_id = #{parentId} limit 1
</select>
</mapper> </mapper>

View File

@ -14,20 +14,15 @@
<result column="role_id" property="roleId"/> <result column="role_id" property="roleId"/>
</resultMap> </resultMap>
<!-- 通用查询结果列 --> <!-- 通用查询结果列 -->
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, flow_id AS flowId, opt AS opt, opt_desc AS optDesc, role_id AS roleId id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, flow_id AS flowId, opt AS opt, opt_desc AS optDesc, role_id AS roleId
</sql> </sql>
<select id="selectFlowById" resultType="Flow" > <select id="selectFlowById" resultType="Flow" >
select * from lz_flow where id=#{id} and is_delete = 0 limit 1 select * from lz_flow where id=#{id} and is_delete = 0 limit 1
</select> </select>
<insert id="insertFlow" parameterType="Flow" useGeneratedKeys="true" keyProperty="id" > <insert id="insertFlow" parameterType="Flow" useGeneratedKeys="true" keyProperty="id" >
insert into lz_flow( insert into lz_flow(
<if test="flowId != null">flow_id, </if> <if test="flowId != null">flow_id, </if>
@ -79,10 +74,13 @@
where id = #{id} where id = #{id}
</update> </update>
<update id="deleteFlowById" parameterType="java.lang.Long"> <update id="deleteFlowById" parameterType="java.lang.Long">
update lz_flow set is_delete = 1 where id=#{id} limit 1 update lz_flow set is_delete = 1 where id=#{id} limit 1
</update> </update>
<select id="selectByFlowId" resultType="com.lz.modules.flow.entity.Flow">
select * from lz_flow where flow_id = #{flowId} and is_delete = 0
</select>
</mapper> </mapper>

View File

@ -27,6 +27,7 @@
</select> </select>
<insert id="insertFlowRelation" parameterType="FlowRelation" useGeneratedKeys="true" keyProperty="id" > <insert id="insertFlowRelation" parameterType="FlowRelation" useGeneratedKeys="true" keyProperty="id" >
insert into lz_flow_relation( insert into lz_flow_relation(
<if test="child != null">child, </if> <if test="child != null">child, </if>
@ -79,5 +80,11 @@
update lz_flow_relation set is_delete = 1 where id=#{id} limit 1 update lz_flow_relation set is_delete = 1 where id=#{id} limit 1
</update> </update>
<select id="selectFlowRelationAll" resultType="com.lz.modules.flow.entity.FlowRelation">
select * from lz_flow_relation where is_delete = 0
</select>
</mapper> </mapper>

View File

@ -61,5 +61,15 @@
select * from lz_departments_staff_relate select * from lz_departments_staff_relate
</select> </select>
<select id="selectLastDepartmentByStaffId"
resultType="com.lz.modules.app.entity.DepartmentsStaffRelateEntity">
select * from ( select * from lz_departments_staff_relate where is_delete=0 and staff_id = #{staffId} order by level desc) t group by staff_id
</select>
<select id="selectLeaderByDepartmentId"
resultType="com.lz.modules.app.entity.DepartmentsStaffRelateEntity">
select * from lz_departments_staff_relate where is_delete=0 and department_id = #{departmentId} and is_leader = 1 limit 1
</select>
</mapper> </mapper>

View File

@ -61,7 +61,7 @@ public class MysqlMain {
} }
List<TablesBean> list = new ArrayList<TablesBean>(); List<TablesBean> list = new ArrayList<TablesBean>();
list.add(new TablesBean("sys_user_token")); list.add(new TablesBean("lz_flow_department"));
List<TablesBean> list2 = new ArrayList<TablesBean>(); List<TablesBean> list2 = new ArrayList<TablesBean>();
Map<String, String> map = MysqlUtil2ShowCreateTable.getComments(); Map<String, String> map = MysqlUtil2ShowCreateTable.getComments();