| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.ruoyi.invest.mapper.TerminationMapper">
- <resultMap type="TProjectTermination" id="TProjectTerminationResult">
- <result property="id" column="id" />
- <result property="procInstId" column="proc_inst_id"/>
- <result property="projectPoolId" column="project_pool_id" />
- <result property="reason" column="reason" />
- <result property="delFlag" column="del_flag" />
- <result property="createBy" column="create_by" />
- <result property="createTime" column="create_time" />
- <result property="updateBy" column="update_by" />
- <result property="updateTime" column="update_time" />
- </resultMap>
- <resultMap type="ProjectTerminationVo" id="ProjectTerminationVoResult">
- <result property="id" column="id" />
- <result property="procInstId" column="proc_inst_id"/>
- <result property="projectPoolId" column="project_pool_id" />
- <result property="reason" column="reason" />
- <result property="delFlag" column="del_flag" />
- <result property="createBy" column="create_by" />
- <result property="createTime" column="create_time" />
- <result property="updateBy" column="update_by" />
- <result property="updateTime" column="update_time" />
- <result property="projectName" column="project_name" />
- <result property="industry" column="industry" />
- <result property="investHead" column="invest_head" />
- <result property="projectStage" column="project_stage" />
- <result property="projectState" column="project_state" />
- <result property="projectStatus" column="project_status" />
- <result property="taskName" column="taskName"/>
- <result property="taskId" column="taskId"/>
- <result property="taskCreateTiem" column="taskCreateTiem"/>
- <result property="assignee" column="assignee"/>
- <result property="assigneeName" column="assigneeName"/>
- <result property="taskDefKey" column="taskDefKey"/>
- <result property="procDefId" column="procDefId"/>
- <result property="procInstId" column="procInstId"/>
- <result property="startUserId" column="startUserId"/>
- <result property="startUserName" column="startUserName"/>
- <result property="startDeptName" column="startDeptName"/>
- <result property="executionId" column="executionId"/>
- <result property="deployId" column="deployId"/>
- </resultMap>
- <sql id="selectTProjectTerminationVo">
- select id,proc_inst_id, project_pool_id, reason, del_flag, create_by, create_time, update_by, update_time from t_project_termination
- </sql>
- <sql id="where_sql">
- <if test="projectTermination.projectPoolId != null and projectTermination.projectPoolId != ''"> and a.project_pool_id = #{projectTermination.projectPoolId}</if>
- <if test="projectTermination.projectName != null and projectTermination.projectName != ''"> and tp.project_name like concat('%', #{projectTermination.projectName}, '%')</if>
- <if test="projectTermination.reason != null and projectTermination.reason != ''"> and a.reason like concat('%', #{projectTermination.reason}, '%')</if>
- <if test="projectTermination.status != null"> and a.status = #{projectTermination.status} </if>
- </sql>
- <insert id="insertTProjectTermination" parameterType="TProjectTermination">
- insert into t_project_termination
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">id,</if>
- <if test="procInstId != null">proc_inst_id,</if>
- <if test="projectPoolId != null">project_pool_id,</if>
- <if test="reason != null">reason,</if>
- <if test="delFlag != null">del_flag,</if>
- <if test="createBy != null">create_by,</if>
- <if test="createTime != null">create_time,</if>
- <if test="updateBy != null">update_by,</if>
- <if test="updateTime != null">update_time,</if>
- <if test="status != null">status,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">#{id},</if>
- <if test="procInstId != null">#{procInstId},</if>
- <if test="projectPoolId != null">#{projectPoolId},</if>
- <if test="reason != null">#{reason},</if>
- <if test="delFlag != null">#{delFlag},</if>
- <if test="createBy != null">#{createBy},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="updateBy != null">#{updateBy},</if>
- <if test="updateTime != null">#{updateTime},</if>
- <if test="status != null">#{status},</if>
- </trim>
- </insert>
- <update id="updateTProjectTermination" parameterType="TProjectTermination">
- update t_project_termination
- <trim prefix="SET" suffixOverrides=",">
- <if test="projectPoolId != null">project_pool_id = #{projectPoolId},</if>
- <if test="reason != null">reason = #{reason},</if>
- <if test="delFlag != null">del_flag = #{delFlag},</if>
- <if test="createBy != null">create_by = #{createBy},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="updateBy != null">update_by = #{updateBy},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- <if test="status != null">status = #{status},</if>
- </trim>
- where id = #{id}
- </update>
- <select id="selectAllTerminationList" resultMap="ProjectTerminationVoResult">
- select a.id,a.proc_inst_id, a.project_pool_id,tp.project_name, tp.industry,tp.project_stage,
- tp.project_state,tp.invest_head,tp.project_status,a.reason,
- a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time ,a.status,
- p.PROC_INST_ID_ as 'procInsId',
- p.PROC_DEF_ID_ as 'procDefId',
- date_format(p.START_TIME_, '%Y-%m-%d %H:%i:%s') as 'applyTime',
- date_format(p.END_TIME_, '%Y-%m-%d %H:%i:%s') as 'endTime',
- p.START_USER_ID_ AS 'startUserId',
- uu.nick_name AS 'startUserName',
- dd.dept_name AS 'startDeptName',
- t.NAME_ as 'taskName',
- t.TASK_DEF_KEY_ as 'taskDefKey',
- DATE_FORMAT(t.CREATE_TIME_ ,'%Y-%m-%d %H:%i') as 'taskCreateTiem',
- t.ASSIGNEE_ AS 'assignee',
- ui.nick_name AS 'assigneeName',
- t.ID_ as 'taskId',
- t.EXECUTION_ID_ AS 'executionId',
- rp.DEPLOYMENT_ID_ AS 'deployId'
- from t_project_termination a
- left join t_project_pool tp on tp.id=a.project_pool_id
- left join ACT_HI_PROCINST p on a.proc_inst_id = p.PROC_INST_ID_
- LEFT JOIN (SELECT * FROM sys_user LIMIT 100000) uu ON p.START_USER_ID_ = uu.user_id
- LEFT JOIN (SELECT * FROM sys_dept LIMIT 100000) dd ON uu.dept_id = dd.dept_id
- left join ACT_RU_TASK t on a.proc_inst_id = t.PROC_INST_ID_
- left join (select * from sys_user limit 100000) ui on t.ASSIGNEE_ = ui.user_id
- left join ACT_RU_IDENTITYLINK ru on ru.TASK_ID_ = t.ID_
- LEFT JOIN act_re_procdef rp ON t.PROC_DEF_ID_ = rp.ID_
- where 1=1
- <include refid="where_sql"></include>
- order by a.create_time desc
- </select>
- <select id="getMyTaskList" resultMap="ProjectTerminationVoResult">
- select a.id,a.proc_inst_id, a.project_pool_id,tp.project_name, tp.industry,tp.project_stage,
- tp.project_state,tp.invest_head,tp.project_status,a.reason,
- a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time ,a.status,
- p.PROC_INST_ID_ as 'procInsId',
- p.PROC_DEF_ID_ as 'procDefId',
- date_format(p.START_TIME_, '%Y-%m-%d %H:%i:%s') as 'applyTime',
- date_format(p.END_TIME_, '%Y-%m-%d %H:%i:%s') as 'endTime',
- p.START_USER_ID_ AS 'startUserId',
- uu.nick_name AS 'startUserName',
- dd.dept_name AS 'startDeptName',
- t.NAME_ as 'taskName',
- t.TASK_DEF_KEY_ as 'taskDefKey',
- DATE_FORMAT(t.CREATE_TIME_ ,'%Y-%m-%d %H:%i') as 'taskCreateTiem',
- t.ASSIGNEE_ AS 'assignee',
- ui.nick_name AS 'assigneeName',
- t.ID_ as 'taskId',
- t.EXECUTION_ID_ AS 'executionId',
- rp.DEPLOYMENT_ID_ AS 'deployId'
- from t_project_termination a
- left join t_project_pool tp on tp.id=a.project_pool_id
- left join ACT_HI_PROCINST p on a.proc_inst_id = p.PROC_INST_ID_
- LEFT JOIN (SELECT * FROM sys_user LIMIT 100000) uu ON p.START_USER_ID_ = uu.user_id
- LEFT JOIN (SELECT * FROM sys_dept LIMIT 100000) dd ON uu.dept_id = dd.dept_id
- left join ACT_RU_TASK t on a.proc_inst_id = t.PROC_INST_ID_
- left join (select * from sys_user limit 100000) ui on t.ASSIGNEE_ = ui.user_id
- left join ACT_RU_IDENTITYLINK ru on ru.TASK_ID_ = t.ID_
- left join ACT_ID_MEMBERSHIP m on m.GROUP_ID_ = ru.GROUP_ID_ and m.USER_ID_ = #{userId}
- LEFT JOIN act_re_procdef rp ON t.PROC_DEF_ID_ = rp.ID_
- where
- (t.ASSIGNEE_ = #{userId}
- or (t.ASSIGNEE_ is null AND ru.TYPE_ = 'candidate'
- AND (ru.USER_ID_ = #{userId}
- OR ru.GROUP_ID_ IN (
- select g.ID_ from ACT_ID_GROUP g, ACT_ID_MEMBERSHIP membership where g.ID_ = membership.GROUP_ID_ AND
- membership.USER_ID_ = #{userId} )
- )
- )
- )
- and a.del_flag="0"
- <include refid="where_sql"></include>
- GROUP BY a.id
- order by a.create_time desc
- </select>
- <select id="getMyDoneTaskList" resultMap="ProjectTerminationVoResult">
- select a.id,a.proc_inst_id, a.project_pool_id,tp.project_name, tp.industry,tp.project_stage,
- tp.project_state,tp.invest_head,tp.project_status,a.reason,
- a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time ,a.status,
- p.PROC_INST_ID_ as 'procInsId',
- p.PROC_DEF_ID_ as 'procDefId',
- date_format(p.START_TIME_, '%Y-%m-%d %H:%i:%s') as 'applyTime',
- date_format(p.END_TIME_, '%Y-%m-%d %H:%i:%s') as 'endTime',
- p.START_USER_ID_ AS 'startUserId',
- uu.nick_name AS 'startUserName',
- dd.dept_name AS 'startDeptName',
- t.ID_ AS 'taskId',
- t.NAME_ AS 'taskName',
- t.ASSIGNEE_ AS 'assignee',
- ui.nick_name AS 'assigneeName',
- t.TASK_DEF_KEY_ as 'taskDefKey',
- rp.DEPLOYMENT_ID_ AS 'deployId'
- from t_project_termination a
- left join t_project_pool tp on tp.id=a.project_pool_id
- LEFT JOIN (select * from ACT_HI_PROCINST limit 10000000) p on a.proc_inst_id = p.PROC_INST_ID_
- LEFT JOIN ACT_RU_TASK t on a.proc_inst_id = t.PROC_INST_ID_
- LEFT JOIN ACT_RU_IDENTITYLINK ru on a.proc_inst_id = ru.PROC_INST_ID_
- LEFT JOIN (SELECT * FROM sys_user LIMIT 100000) uu ON p.START_USER_ID_ = uu.user_id
- LEFT JOIN (SELECT * FROM sys_dept LIMIT 100000) dd ON uu.dept_id = dd.dept_id
- LEFT JOIN (select * from sys_user limit 100000) ui on t.ASSIGNEE_ = ui.user_id
- LEFT JOIN act_re_procdef rp ON t.PROC_DEF_ID_ = rp.ID_
- where ru.USER_ID_ = #{userId} and a.del_flag="0"
- <include refid="where_sql"></include>
- GROUP BY a.id
- order by a.create_time desc
- </select>
- <select id="getMyList" resultMap="ProjectTerminationVoResult">
- select a.id,a.proc_inst_id, a.project_pool_id,tp.project_name, tp.industry,tp.project_stage,
- tp.project_state,tp.invest_head,tp.project_status,a.reason,
- a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time ,a.status,
- u.nick_name as 'applyUserName',
- p.PROC_INST_ID_ as 'procInsId',
- p.PROC_DEF_ID_ as 'procDefId',
- date_format(p.START_TIME_, '%Y-%m-%d %H:%i:%s') as 'applyTime',
- date_format(p.END_TIME_, '%Y-%m-%d %H:%i:%s') as 'endTime',
- p.START_USER_ID_ AS 'startUserId',
- uu.nick_name AS 'startUserName',
- dd.dept_name AS 'startDeptName',
- t.NAME_ as 'taskName',
- t.TASK_DEF_KEY_ as 'taskDefKey',
- DATE_FORMAT(t.CREATE_TIME_ ,'%Y-%m-%d %H:%i') as 'taskCreateTiem',
- t.ASSIGNEE_ as 'assignee',
- GROUP_CONCAT(DISTINCT ui.nick_name SEPARATOR '\r\n') as 'assigneeName',
- t.ID_ as 'taskId',
- t.EXECUTION_ID_ AS 'executionId',
- rp.DEPLOYMENT_ID_ AS 'deployId'
- from t_project_termination a
- left join t_project_pool tp on tp.id=a.project_pool_id
- left join ACT_HI_PROCINST p on a.proc_inst_id = p.PROC_INST_ID_
- LEFT JOIN (SELECT * FROM sys_user LIMIT 100000) uu ON p.START_USER_ID_ = uu.user_id
- LEFT JOIN (SELECT * FROM sys_dept LIMIT 100000) dd ON uu.dept_id = dd.dept_id
- left join sys_user u on a.create_by = u.user_id
- left join ACT_RU_TASK t on a.proc_inst_id = t.PROC_INST_ID_
- left join (select * from sys_user limit 100000) ui on t.ASSIGNEE_ = ui.user_id
- left join ACT_RU_IDENTITYLINK ru on ru.TASK_ID_ = t.ID_
- left join ACT_ID_MEMBERSHIP m on m.GROUP_ID_ = ru.GROUP_ID_ and m.USER_ID_ = #{userId}
- left join act_re_procdef rp ON t.PROC_DEF_ID_ = rp.ID_
- where a.create_by = #{userId} and a.proc_inst_id is not null and a.proc_inst_id != ''
- and a.del_flag="0"
- <include refid="where_sql"></include>
- GROUP BY a.id
- order by a.create_time desc
- </select>
- <!--<select id="selectTProjectPoolById" parameterType="String" resultMap="TProjectPoolResult">
- <include refid="selectTProjectPoolVo"/>
- where a.id = #{id}
- </select>-->
- <select id="selectTProjectTerminationByProcInstId" parameterType="java.lang.String" resultMap="TProjectTerminationResult">
- select a.id,a.proc_inst_id, a.project_pool_id, a.reason,
- a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time ,
- t.TASK_DEF_KEY_ as 'taskDefKey'
- from t_project_termination a
- left join ACT_RU_TASK t on a.proc_inst_id = t.PROC_INST_ID_
- left join (select * from sys_user limit 100000) ui on t.ASSIGNEE_ = ui.user_id
- left join sys_user u on a.create_by = u.user_id
- where a.proc_inst_id = #{procInstId,jdbcType=VARCHAR}
- GROUP BY a.id
- </select>
- <select id="selectProjectTerminationByProcInstId" parameterType="java.lang.String" resultMap="ProjectTerminationVoResult">
- select a.id,a.proc_inst_id, a.project_pool_id, a.reason,
- a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time ,
- t.TASK_DEF_KEY_ as 'taskDefKey',tp.project_name
- from t_project_termination a
- left join t_project_pool tp on tp.id=a.project_pool_id
- left join ACT_RU_TASK t on a.proc_inst_id = t.PROC_INST_ID_
- left join (select * from sys_user limit 100000) ui on t.ASSIGNEE_ = ui.user_id
- left join sys_user u on a.create_by = u.user_id
- where a.proc_inst_id = #{procInstId,jdbcType=VARCHAR}
- GROUP BY a.id
- </select>
- <select id="listProjectPoolIdNew" parameterType="String" resultMap="TProjectTerminationResult">
- <include refid="selectTProjectTerminationVo"/>
- where project_pool_id = #{projectPoolId} and del_flag = 0
- ORDER BY create_time DESC LIMIT 1
- </select>
- </mapper>
|