|
|
|
@ -3,13 +3,20 @@ |
|
|
|
<mapper namespace="com.xm.core.entity.XmProjectTaskTypeState"> |
|
|
|
|
|
|
|
|
|
|
|
<!--开始 自定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="key != null and key !='' "> </if> |
|
|
|
</sql> |
|
|
|
<update id="loadTasksToXmProjectTaskTypeState" parameterType="String" statementType="CALLABLE"> |
|
|
|
{call load_tasks_to_xm_project_task_type_state(#{projectId,mode=IN})} |
|
|
|
{call load_tasks_to_xm_project_task_type_state(#{projectId,mode=IN})} |
|
|
|
</update> |
|
|
|
|
|
|
|
|
|
|
|
<!--结束 自定义sql函数区域--> |
|
|
|
|
|
|
|
|
|
|
|
@ -17,15 +24,9 @@ |
|
|
|
<!-- 通过条件查询获取数据列表 返回list<map> --> |
|
|
|
<select id="selectListMapByWhere" parameterType="HashMap" resultType="HashMap"> |
|
|
|
select * from xm_project_task_type_state 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"/> |
|
|
|
<if test="key != null and key !='' "> </if> |
|
|
|
</where> |
|
|
|
</select> |
|
|
|
|
|
|
|
@ -43,7 +44,13 @@ |
|
|
|
where |
|
|
|
res.id = #{id} |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="selectListByIds" parameterType="List" resultType="com.xm.core.entity.XmProjectTaskTypeState"> |
|
|
|
select * from xm_project_task_type_state res |
|
|
|
where (res.id) in |
|
|
|
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" > |
|
|
|
( #{item}) |
|
|
|
</foreach> |
|
|
|
</select> |
|
|
|
<!-- 通过主键查询获取数据对象 返回map--> |
|
|
|
<select id="selectOneMap" parameterType="HashMap" resultType="HashMap"> |
|
|
|
select * from xm_project_task_type_state res |
|
|
|
@ -58,11 +65,11 @@ |
|
|
|
</where> |
|
|
|
</select> |
|
|
|
<!-- 新增一条记录 主键id,--> |
|
|
|
<insert id="insert" parameterType="com.xm.core.entity.XmProjectTaskTypeState" useGeneratedKeys="false" keyProperty="id"> |
|
|
|
<insert id="insert" parameterType="com.xm.core.entity.XmProjectTaskTypeState" useGeneratedKeys="false" keyProperty="id"> |
|
|
|
insert into xm_project_task_type_state( |
|
|
|
<include refid="columns"/> |
|
|
|
) values ( |
|
|
|
#{projectId},#{projectName},#{taskType},#{planWorkload},#{planAmount},#{actWorkload},#{actAmount},#{branchId},#{bizDate},#{calcTime},#{planOuserAt},#{planIuserAt},#{actOuserAt},#{actIuserAt},#{planOuserWorkload},#{planIuserWorkload},#{actOuserWorkload},#{actIuserWorkload},#{planNouserAt},#{actNouserAt},#{id} |
|
|
|
#{projectId},#{projectName},#{taskType},#{planWorkload},#{planAmount},#{actWorkload},#{actAmount},#{branchId},#{bizDate},#{calcTime},#{planOuserAt},#{planIuserAt},#{actOutUserAt},#{actInnerUserAt},#{planOuserWorkload},#{planIuserWorkload},#{actOuserWorkload},#{actIuserWorkload},#{planNouserAt},#{actNouserAt},#{id} |
|
|
|
) |
|
|
|
</insert> |
|
|
|
|
|
|
|
@ -76,13 +83,13 @@ |
|
|
|
|
|
|
|
<!-- 按主键删除一条记录--> |
|
|
|
<delete id="deleteByPk" parameterType="com.xm.core.entity.XmProjectTaskTypeState"> |
|
|
|
delete from xm_project_task_type_state |
|
|
|
delete from xm_project_task_type_state |
|
|
|
where id = #{id} |
|
|
|
</delete> |
|
|
|
|
|
|
|
<!-- 根据条件修改若干条记录 --> |
|
|
|
<update id="updateSomeFieldByPk" parameterType="com.xm.core.entity.XmProjectTaskTypeState"> |
|
|
|
update xm_project_task_type_state |
|
|
|
update xm_project_task_type_state |
|
|
|
<set> |
|
|
|
<include refid="someFieldSet"/> |
|
|
|
</set> |
|
|
|
@ -91,7 +98,7 @@ |
|
|
|
|
|
|
|
<!-- 根据主键修改一条记录 --> |
|
|
|
<update id="updateByPk" parameterType="com.xm.core.entity.XmProjectTaskTypeState"> |
|
|
|
update xm_project_task_type_state |
|
|
|
update xm_project_task_type_state |
|
|
|
<set> |
|
|
|
<include refid="set"/> |
|
|
|
</set> |
|
|
|
@ -106,7 +113,7 @@ |
|
|
|
<!-- 批量更新 --> |
|
|
|
<update id="batchUpdate" parameterType="List"> |
|
|
|
<foreach collection="list" item="item" index="index" separator=";" > |
|
|
|
update xm_project_task_type_state |
|
|
|
update xm_project_task_type_state |
|
|
|
set |
|
|
|
<include refid="batchSet"/> |
|
|
|
where id = #{item.id} |
|
|
|
@ -114,19 +121,20 @@ |
|
|
|
</update> |
|
|
|
<!-- 批量删除 --> |
|
|
|
<delete id="batchDelete" parameterType="List"> |
|
|
|
delete from xm_project_task_type_state |
|
|
|
where id in |
|
|
|
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" > |
|
|
|
#{item.id } |
|
|
|
</foreach> |
|
|
|
delete from xm_project_task_type_state |
|
|
|
where |
|
|
|
(id) in |
|
|
|
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" > |
|
|
|
( #{item.id} ) |
|
|
|
</foreach> |
|
|
|
</delete> |
|
|
|
|
|
|
|
|
|
|
|
<!--sql片段 列--> |
|
|
|
<sql id="columns"> |
|
|
|
project_id,project_name,task_type,plan_workload,plan_amount,act_workload,act_amount,branch_id,biz_date,calc_time,plan_out_user_at,plan_inner_user_at,act_out_user_at,act_inner_user_at,plan_out_user_workload,plan_inner_user_workload,act_out_user_workload,act_inner_user_workload,plan_nouser_at,act_nouser_at,id |
|
|
|
project_id,project_name,task_type,plan_workload,plan_amount,act_workload,act_amount,branch_id,biz_date,calc_time,plan_ouser_at,plan_iuser_at,act_out_user_at,act_inner_user_at,plan_ouser_workload,plan_iuser_workload,act_ouser_workload,act_iuser_workload,plan_nouser_at,act_nouser_at,id |
|
|
|
</sql> |
|
|
|
|
|
|
|
|
|
|
|
<!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS--> |
|
|
|
<sql id="where"> |
|
|
|
<if test="projectId != null and projectId != ''"> and res.project_id = #{projectId} </if> |
|
|
|
@ -138,15 +146,15 @@ |
|
|
|
<if test="actAmount != null and actAmount != ''"> and res.act_amount = #{actAmount} </if> |
|
|
|
<if test="branchId != null and branchId != ''"> and res.branch_id = #{branchId} </if> |
|
|
|
<if test="bizDate != null and bizDate != ''"> and res.biz_date = #{bizDate} </if> |
|
|
|
<if test="calcTime != null"> and TO_CHAR(res.calc_time,'YYYY-MM-DD') = TO_CHAR(#{calcTime},'YYYY-MM-DD') </if> |
|
|
|
<if test="planOuserAt != null and planOuserAt != ''"> and res.plan_out_user_at = #{planOuserAt} </if> |
|
|
|
<if test="planIuserAt != null and planIuserAt != ''"> and res.plan_inner_user_at = #{planIuserAt} </if> |
|
|
|
<if test="actOuserAt != null and actOuserAt != ''"> and res.act_out_user_at = #{actOuserAt} </if> |
|
|
|
<if test="actIuserAt != null and actIuserAt != ''"> and res.act_inner_user_at = #{actIuserAt} </if> |
|
|
|
<if test="planOuserWorkload != null and planOuserWorkload != ''"> and res.plan_out_user_workload = #{planOuserWorkload} </if> |
|
|
|
<if test="planIuserWorkload != null and planIuserWorkload != ''"> and res.plan_inner_user_workload = #{planIuserWorkload} </if> |
|
|
|
<if test="actOuserWorkload != null and actOuserWorkload != ''"> and res.act_out_user_workload = #{actOuserWorkload} </if> |
|
|
|
<if test="actIuserWorkload != null and actIuserWorkload != ''"> and res.act_inner_user_workload = #{actIuserWorkload} </if> |
|
|
|
<if test="calcTime != null"> and date_format(res.calc_time,'%Y-%m-%d') = date_format(#{calcTime},'%Y-%m-%d') </if> |
|
|
|
<if test="planOuserAt != null and planOuserAt != ''"> and res.plan_ouser_at = #{planOuserAt} </if> |
|
|
|
<if test="planIuserAt != null and planIuserAt != ''"> and res.plan_iuser_at = #{planIuserAt} </if> |
|
|
|
<if test="actOutUserAt != null and actOutUserAt != ''"> and res.act_out_user_at = #{actOutUserAt} </if> |
|
|
|
<if test="actInnerUserAt != null and actInnerUserAt != ''"> and res.act_inner_user_at = #{actInnerUserAt} </if> |
|
|
|
<if test="planOuserWorkload != null and planOuserWorkload != ''"> and res.plan_ouser_workload = #{planOuserWorkload} </if> |
|
|
|
<if test="planIuserWorkload != null and planIuserWorkload != ''"> and res.plan_iuser_workload = #{planIuserWorkload} </if> |
|
|
|
<if test="actOuserWorkload != null and actOuserWorkload != ''"> and res.act_ouser_workload = #{actOuserWorkload} </if> |
|
|
|
<if test="actIuserWorkload != null and actIuserWorkload != ''"> and res.act_iuser_workload = #{actIuserWorkload} </if> |
|
|
|
<if test="planNouserAt != null and planNouserAt != ''"> and res.plan_nouser_at = #{planNouserAt} </if> |
|
|
|
<if test="actNouserAt != null and actNouserAt != ''"> and res.act_nouser_at = #{actNouserAt} </if> |
|
|
|
<if test="id != null and id != ''"> and res.id = #{id} </if> |
|
|
|
@ -163,14 +171,14 @@ |
|
|
|
branch_id = #{branchId}, |
|
|
|
biz_date = #{bizDate}, |
|
|
|
calc_time = #{calcTime}, |
|
|
|
plan_out_user_at = #{planOuserAt}, |
|
|
|
plan_inner_user_at = #{planIuserAt}, |
|
|
|
act_out_user_at = #{actOuserAt}, |
|
|
|
act_inner_user_at = #{actIuserAt}, |
|
|
|
plan_out_user_workload = #{planOuserWorkload}, |
|
|
|
plan_inner_user_workload = #{planIuserWorkload}, |
|
|
|
act_out_user_workload = #{actOuserWorkload}, |
|
|
|
act_inner_user_workload = #{actIuserWorkload}, |
|
|
|
plan_ouser_at = #{planOuserAt}, |
|
|
|
plan_iuser_at = #{planIuserAt}, |
|
|
|
act_out_user_at = #{actOutUserAt}, |
|
|
|
act_inner_user_at = #{actInnerUserAt}, |
|
|
|
plan_ouser_workload = #{planOuserWorkload}, |
|
|
|
plan_iuser_workload = #{planIuserWorkload}, |
|
|
|
act_ouser_workload = #{actOuserWorkload}, |
|
|
|
act_iuser_workload = #{actIuserWorkload}, |
|
|
|
plan_nouser_at = #{planNouserAt}, |
|
|
|
act_nouser_at = #{actNouserAt} |
|
|
|
</sql> |
|
|
|
@ -185,14 +193,14 @@ |
|
|
|
<if test="branchId != null and branchId != ''"> branch_id = #{branchId}, </if> |
|
|
|
<if test="bizDate != null and bizDate != ''"> biz_date = #{bizDate}, </if> |
|
|
|
<if test="calcTime != null"> calc_time = #{calcTime}, </if> |
|
|
|
<if test="planOuserAt != null and planOuserAt != ''"> plan_out_user_at = #{planOuserAt}, </if> |
|
|
|
<if test="planIuserAt != null and planIuserAt != ''"> plan_inner_user_at = #{planIuserAt}, </if> |
|
|
|
<if test="actOuserAt != null and actOuserAt != ''"> act_out_user_at = #{actOuserAt}, </if> |
|
|
|
<if test="actIuserAt != null and actIuserAt != ''"> act_inner_user_at = #{actIuserAt}, </if> |
|
|
|
<if test="planOuserWorkload != null and planOuserWorkload != ''"> plan_out_user_workload = #{planOuserWorkload}, </if> |
|
|
|
<if test="planIuserWorkload != null and planIuserWorkload != ''"> plan_inner_user_workload = #{planIuserWorkload}, </if> |
|
|
|
<if test="actOuserWorkload != null and actOuserWorkload != ''"> act_out_user_workload = #{actOuserWorkload}, </if> |
|
|
|
<if test="actIuserWorkload != null and actIuserWorkload != ''"> act_inner_user_workload = #{actIuserWorkload}, </if> |
|
|
|
<if test="planOuserAt != null and planOuserAt != ''"> plan_ouser_at = #{planOuserAt}, </if> |
|
|
|
<if test="planIuserAt != null and planIuserAt != ''"> plan_iuser_at = #{planIuserAt}, </if> |
|
|
|
<if test="actOutUserAt != null and actOutUserAt != ''"> act_out_user_at = #{actOutUserAt}, </if> |
|
|
|
<if test="actInnerUserAt != null and actInnerUserAt != ''"> act_inner_user_at = #{actInnerUserAt}, </if> |
|
|
|
<if test="planOuserWorkload != null and planOuserWorkload != ''"> plan_ouser_workload = #{planOuserWorkload}, </if> |
|
|
|
<if test="planIuserWorkload != null and planIuserWorkload != ''"> plan_iuser_workload = #{planIuserWorkload}, </if> |
|
|
|
<if test="actOuserWorkload != null and actOuserWorkload != ''"> act_ouser_workload = #{actOuserWorkload}, </if> |
|
|
|
<if test="actIuserWorkload != null and actIuserWorkload != ''"> act_iuser_workload = #{actIuserWorkload}, </if> |
|
|
|
<if test="planNouserAt != null and planNouserAt != ''"> plan_nouser_at = #{planNouserAt}, </if> |
|
|
|
<if test="actNouserAt != null and actNouserAt != ''"> act_nouser_at = #{actNouserAt}, </if> |
|
|
|
</sql> |
|
|
|
@ -208,14 +216,14 @@ |
|
|
|
branch_id = #{item.branchId}, |
|
|
|
biz_date = #{item.bizDate}, |
|
|
|
calc_time = #{item.calcTime}, |
|
|
|
plan_out_user_at = #{item.planOuserAt}, |
|
|
|
plan_inner_user_at = #{item.planIuserAt}, |
|
|
|
act_out_user_at = #{item.actOuserAt}, |
|
|
|
act_inner_user_at = #{item.actIuserAt}, |
|
|
|
plan_out_user_workload = #{item.planOuserWorkload}, |
|
|
|
plan_inner_user_workload = #{item.planIuserWorkload}, |
|
|
|
act_out_user_workload = #{item.actOuserWorkload}, |
|
|
|
act_inner_user_workload = #{item.actIuserWorkload}, |
|
|
|
plan_ouser_at = #{item.planOuserAt}, |
|
|
|
plan_iuser_at = #{item.planIuserAt}, |
|
|
|
act_out_user_at = #{item.actOutUserAt}, |
|
|
|
act_inner_user_at = #{item.actInnerUserAt}, |
|
|
|
plan_ouser_workload = #{item.planOuserWorkload}, |
|
|
|
plan_iuser_workload = #{item.planIuserWorkload}, |
|
|
|
act_ouser_workload = #{item.actOuserWorkload}, |
|
|
|
act_iuser_workload = #{item.actIuserWorkload}, |
|
|
|
plan_nouser_at = #{item.planNouserAt}, |
|
|
|
act_nouser_at = #{item.actNouserAt} |
|
|
|
</sql> |