2022-10-09 17:33:16 +08:00
|
|
|
<?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.rzyc.mapper.EntPostTaskMapper">
|
|
|
|
|
|
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
|
|
|
<resultMap id="BaseResultMap" type="com.rzyc.model.EntPostTask">
|
|
|
|
|
<id column="task_id" property="taskId" />
|
|
|
|
|
<result column="post_id" property="postId" />
|
|
|
|
|
<result column="ent_user_id" property="entUserId" />
|
|
|
|
|
<result column="enterprise_id" property="enterpriseId" />
|
|
|
|
|
<result column="ent_list_id" property="entListId" />
|
|
|
|
|
<result column="list_id" property="listId" />
|
|
|
|
|
<result column="post_list_id" property="postListId" />
|
|
|
|
|
<result column="item_title" property="itemTitle" />
|
|
|
|
|
<result column="item_content" property="itemContent" />
|
|
|
|
|
<result column="start_time" property="startTime" />
|
|
|
|
|
<result column="ent_time" property="entTime" />
|
|
|
|
|
<result column="task_state" property="taskState" />
|
|
|
|
|
<result column="frequency" property="frequency" />
|
|
|
|
|
<result column="del_state" property="delState" />
|
|
|
|
|
<result column="create_time" property="createTime" />
|
|
|
|
|
<result column="create_by" property="createBy" />
|
|
|
|
|
<result column="modify_time" property="modifyTime" />
|
|
|
|
|
<result column="modify_by" property="modifyBy" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<!-- 通用查询结果列 -->
|
|
|
|
|
<sql id="Base_Column_List">
|
|
|
|
|
task_id, post_id, ent_user_id, enterprise_id, ent_list_id, list_id, post_list_id, item_title, item_content, start_time, ent_time, task_state, frequency, del_state, create_time, create_by, modify_time, modify_by
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectEntUserPostTask" resultMap="BaseResultMap">
|
2022-11-07 17:47:41 +08:00
|
|
|
select * from ent_post_task where ent_user_id = #{entUserId} and enterprise_id = #{enterpriseId}
|
|
|
|
|
<if test="listId != null and '' != listId">
|
|
|
|
|
and list_id = #{listId}
|
|
|
|
|
</if>
|
2022-10-09 17:33:16 +08:00
|
|
|
<if test="null != postId and '' != postId">
|
|
|
|
|
and post_id = #{postId}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="null != content and '' != content">
|
|
|
|
|
and item_content like concat('%',#{content},'%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="null != taskState and '' != taskState">
|
|
|
|
|
and task_state = #{taskState}
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
|
2022-10-31 17:33:15 +08:00
|
|
|
<select id="selectEntUserPostTaskByListId" resultMap="BaseResultMap">
|
|
|
|
|
select * from ent_post_task where enterprise_id = #{enterpriseId}
|
|
|
|
|
<if test="null != listId and '' != listId">
|
|
|
|
|
and list_id = #{listId}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="null != content and '' != content">
|
|
|
|
|
and item_content like concat('%',#{content},'%')
|
|
|
|
|
</if>
|
|
|
|
|
limit #{page},#{pageSize}
|
|
|
|
|
</select>
|
|
|
|
|
|
2022-11-08 18:09:46 +08:00
|
|
|
|
2022-11-07 17:47:41 +08:00
|
|
|
|
|
|
|
|
<select id="selectEntPostTaskTotal" resultType="java.lang.Long">
|
|
|
|
|
select count(ept.task_id) from ent_post_task ept
|
|
|
|
|
left join ent_post_list epl on ept.ent_list_id = epl.post_list_id
|
|
|
|
|
where epl.enterprise_id = #{enterpriseId}
|
|
|
|
|
<if test="null != year">
|
|
|
|
|
and epl.year_num = #{year}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="null != listId and '' != listId">
|
|
|
|
|
and epl.post_list_id = #{listId}
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<resultMap id="entPostTaskByStateMap" type="com.rzyc.model.EntPostTaskStatistic">
|
|
|
|
|
<result column="haveInHand" property="haveInHand" />
|
|
|
|
|
<result column="finished" property="finished" />
|
|
|
|
|
<result column="overtime" property="overtime" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<select id="selectEntPostTaskByState" resultMap="entPostTaskByStateMap">
|
|
|
|
|
select sum(case when task_state = 1 then 1 else 0 end)as haveInHand,
|
|
|
|
|
sum(case when task_state = 2 then 1 else 0 end)as finished,
|
|
|
|
|
sum(case when task_state = 3 then 1 else 0 end)as overtime
|
|
|
|
|
from ent_post_task ept
|
|
|
|
|
left join ent_post_list epl on ept.ent_list_id = epl.post_list_id
|
|
|
|
|
where epl.enterprise_id = #{enterpriseId}
|
|
|
|
|
<if test="null != year">
|
|
|
|
|
and epl.year_num = #{year}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="null != listId and '' != listId">
|
|
|
|
|
and epl.post_list_id = #{listId}
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
|
2022-11-11 19:57:18 +08:00
|
|
|
<insert id="insertList">
|
|
|
|
|
insert into ent_post_task (task_id, post_id,ent_user_id,enterprise_id,
|
|
|
|
|
ent_list_id,
|
|
|
|
|
list_id, post_list_id, item_title,
|
|
|
|
|
item_content, start_time,ent_time,task_state,
|
|
|
|
|
frequency,
|
|
|
|
|
del_state, create_time, create_by,
|
|
|
|
|
modify_time, modify_by
|
|
|
|
|
)
|
|
|
|
|
values
|
|
|
|
|
<foreach collection="entTasks" item="record" separator=",">
|
|
|
|
|
(#{record.taskId,jdbcType=VARCHAR},
|
|
|
|
|
#{record.postId,jdbcType=VARCHAR},
|
|
|
|
|
#{record.entUserId,jdbcType=VARCHAR},
|
|
|
|
|
#{record.enterpriseId,jdbcType=VARCHAR},
|
|
|
|
|
#{record.entListId,jdbcType=VARCHAR},
|
|
|
|
|
#{record.listId,jdbcType=VARCHAR},
|
|
|
|
|
#{record.postListId,jdbcType=VARCHAR},
|
|
|
|
|
#{record.itemTitle,jdbcType=VARCHAR},
|
|
|
|
|
#{record.itemContent,jdbcType=VARCHAR},
|
|
|
|
|
#{record.startTime},
|
|
|
|
|
#{record.entTime},
|
|
|
|
|
#{record.taskState,jdbcType=INTEGER},
|
|
|
|
|
#{record.frequency,jdbcType=INTEGER},
|
|
|
|
|
#{record.delState,jdbcType=INTEGER},
|
|
|
|
|
#{record.createTime},
|
|
|
|
|
#{record.createBy,jdbcType=VARCHAR},
|
|
|
|
|
#{record.modifyTime},
|
|
|
|
|
#{record.modifyBy,jdbcType=VARCHAR}
|
|
|
|
|
)
|
|
|
|
|
</foreach>
|
|
|
|
|
|
|
|
|
|
</insert>
|
|
|
|
|
|
2022-10-31 17:33:15 +08:00
|
|
|
|
|
|
|
|
|
2022-10-09 17:33:16 +08:00
|
|
|
</mapper>
|