2024-11-07 20:50:14 +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.bonus.gzgqj.business.plan.mapper.PlanOutMapper">
|
|
|
|
|
<insert id="insertProOutInfo" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
|
insert into t_plan_out( pro_id, consignor, shipment_date, remarks, create_time, create_day, creater
|
|
|
|
|
)VALUES (#{proId},#{userName},#{createDay},#{remarks},now(),CURRENT_DATE,#{creater})
|
|
|
|
|
</insert>
|
|
|
|
|
<insert id="insertProNeedDetails">
|
|
|
|
|
insert into t_plan_out_detail(
|
|
|
|
|
out_id, type, name, module, unit, module_id, fh_num, tz_num, remarks, data_type )values (
|
|
|
|
|
#{outId},#{type},#{name},#{module},#{unit},#{moduleId},#{fhNum},#{tzNum},#{remarks},#{dataType} )
|
|
|
|
|
</insert>
|
|
|
|
|
<insert id="addNeedInfo">
|
|
|
|
|
insert into t_pro_need_info (
|
|
|
|
|
pro_id, type, name, module, module_id, need_type, unit, need_num, fh_num, tz_num, remarks
|
|
|
|
|
) values (#{proId},#{type},#{name},#{module},#{moduleId},#{needType},#{unit},#{needNum},#{fhNum},#{tzNum},#{remarks})
|
|
|
|
|
</insert>
|
|
|
|
|
<update id="updateNeedInfo">
|
|
|
|
|
update t_pro_need_info set fh_num=#{fhNum} ,tz_num=#{tzNum},remarks=#{remarks}
|
|
|
|
|
where id=#{id}
|
|
|
|
|
</update>
|
|
|
|
|
<!--更新 统计数量-->
|
|
|
|
|
<update id="updatePriPlanInfo">
|
|
|
|
|
update t_pro_plan_info set record_num=#{recordNum},out_num=#{outNum},tz_num=#{tzNum},last_day=#{lastDay},
|
|
|
|
|
status=#{status}
|
|
|
|
|
where pro_id=#{proId}
|
|
|
|
|
</update>
|
|
|
|
|
<delete id="deleteProOut">
|
|
|
|
|
delete from t_plan_out where id=#{id}
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<select id="getProPlanPage" resultType="com.bonus.gzgqj.business.plan.entity.ProPlanInfoVo">
|
|
|
|
|
select
|
|
|
|
|
ppi.pro_id proId, ppi.need_num needNum,pro.`NAME` proName,tz_num,
|
|
|
|
|
ppi.plan_num planNum,ppi.record_num recordNum,
|
|
|
|
|
ppi.out_num outNum, ppi.status,IFNULL((out_num+tz_num)*100/need_num ,0) progress,
|
|
|
|
|
ppi.last_day lastDay
|
|
|
|
|
from t_pro_plan_info ppi
|
|
|
|
|
LEFT JOIN bm_project pro on ppi.pro_id=pro.id
|
|
|
|
|
<where>
|
|
|
|
|
<if test="status!=null and status!=''">
|
|
|
|
|
and ppi.status=#{status}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="proName!=null and proName!=''">
|
|
|
|
|
and pro.`NAME` like concat('%',#{proName},'%')
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getPorInfoDetail" resultType="com.bonus.gzgqj.business.plan.entity.ProNeedInfo">
|
|
|
|
|
select pni.id,pni.pro_id proId,pni.type,pni.name,pni.module,pni.module_id,pni.need_type needType,
|
2024-11-08 13:23:53 +08:00
|
|
|
IFNULL(pni.unit,'-') unit ,pni.need_num needNum ,pni.fh_num fhNum ,pro.`NAME` proName ,IF(pni.need_num-pni.fh_num <0,0,pni.need_num-pni.fh_num) diff
|
2024-11-07 20:50:14 +08:00
|
|
|
from t_pro_need_info pni
|
|
|
|
|
LEFT JOIN bm_project pro on pni.pro_id=pro.id
|
|
|
|
|
<where>
|
|
|
|
|
<if test="module!=null and module!=''">
|
|
|
|
|
and pni.`module` like concat('%',#{module},'%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="name!=null and name!=''">
|
|
|
|
|
and pni.`name` like concat('%',#{name},'%')
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getProDevSelected" resultType="com.bonus.gzgqj.business.plan.entity.ProDevSelect">
|
|
|
|
|
select distinct mt.id ,mt.`NAME`,mt.parent_id
|
|
|
|
|
from mm_type mt
|
|
|
|
|
where mt.`LEVEL`=3 and mt.IS_ACTIVE=1
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getDevChilderList" resultType="com.bonus.gzgqj.business.plan.entity.ProDevSelect">
|
|
|
|
|
select distinct mt.id ,mt.`NAME`,mt.parent_id pId,mt.UNIT,mt.NUM,mt1.`NAME` pName,mt2.`NAME` ppName
|
|
|
|
|
from mm_type mt
|
|
|
|
|
LEFT JOIN mm_type mt1 on mt.PARENT_ID=mt1.id and mt.`LEVEL`=4 and mt1.`LEVEL`=3 and mt1.IS_ACTIVE=1
|
|
|
|
|
LEFT JOIN mm_type mt2 on mt1.PARENT_ID=mt2.id and mt1.`LEVEL`=3 and mt2.IS_ACTIVE=1
|
|
|
|
|
LEFT JOIN t_pro_need_info pni on pni.module_id=mt.id
|
|
|
|
|
where mt.`LEVEL`=4 and mt.IS_ACTIVE=1 and pni.id is null
|
|
|
|
|
and pni.pro_id=#{proId} and mt.parent_id=#{pId}
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getProNeedInfo" resultType="com.bonus.gzgqj.business.plan.entity.ProNeedInfo">
|
|
|
|
|
select id, pro_id proId,type, name,
|
|
|
|
|
module,module_id moduleId,need_type needType,unit,need_num needNum,fh_num fhNum
|
|
|
|
|
,tz_num tzNum,remarks
|
|
|
|
|
from t_pro_need_info
|
|
|
|
|
WHERE id=#{id}
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getProPlanInfo" resultType="com.bonus.gzgqj.business.plan.entity.ProPlanInfoVo">
|
|
|
|
|
select
|
|
|
|
|
ppi.pro_id proId, ppi.need_num needNum,
|
|
|
|
|
ppi.plan_num planNum,ppi.record_num recordNum,
|
|
|
|
|
ppi.out_num outNum, ppi.status,
|
|
|
|
|
ppi.last_day lastDay
|
|
|
|
|
from t_pro_plan_info ppi
|
|
|
|
|
where ppi.pro_id=#{proId}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</mapper>
|