需求计划管理归还日期全部改为预计使用时间
This commit is contained in:
parent
382450d9ac
commit
8c755f9644
|
|
@ -51,14 +51,15 @@ public class PlanDataDetailBean {
|
|||
@Excel(name = "需用量", width = 10.0,height = 20.0, orderNum = "6")
|
||||
private int needNum;
|
||||
/**
|
||||
* 需用天数
|
||||
* 预计使用时间
|
||||
*/
|
||||
@Excel(name = "需用天数", width = 10.0,height = 20.0, orderNum = "7")
|
||||
|
||||
private String times;
|
||||
|
||||
/**
|
||||
* 退还日期
|
||||
*/
|
||||
@Excel(name = "预计使用时间", width = 15.0,height = 20.0, orderNum = "7")
|
||||
private String backDate;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,34 +1,34 @@
|
|||
<?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.app.mapper.PartApplyAppMapper" >
|
||||
<mapper namespace="com.bonus.gzgqj.business.app.mapper.PartApplyAppMapper">
|
||||
|
||||
<insert id="addPartApply" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO t_part_apply(
|
||||
code, creator, user_name, create_time, type, remark, status, updater,
|
||||
update_time,
|
||||
<if test="deviceId!=null and deviceId!=''">
|
||||
dev_id,
|
||||
</if>
|
||||
dev_code, dev_type,
|
||||
<if test="proId!=null and proId!=''">
|
||||
pro_id,
|
||||
</if>
|
||||
pro_name,
|
||||
apply_num,status_type)values(
|
||||
#{code},#{creator},#{userName},now(), #{type},#{remark},#{status},#{updater}, now(),
|
||||
<if test="deviceId!=null and deviceId!=''">
|
||||
#{deviceId},
|
||||
</if>
|
||||
#{devCode}, #{devType},
|
||||
<if test="proId!=null and proId!=''">
|
||||
#{proId},
|
||||
</if>
|
||||
#{proName},#{applyNum},#{statusType})
|
||||
code, creator, user_name, create_time, type, remark, status, updater,
|
||||
update_time,
|
||||
<if test="deviceId!=null and deviceId!=''">
|
||||
dev_id,
|
||||
</if>
|
||||
dev_code, dev_type,
|
||||
<if test="proId!=null and proId!=''">
|
||||
pro_id,
|
||||
</if>
|
||||
pro_name,
|
||||
apply_num,status_type)values(
|
||||
#{code},#{creator},#{userName},now(), #{type},#{remark},#{status},#{updater}, now(),
|
||||
<if test="deviceId!=null and deviceId!=''">
|
||||
#{deviceId},
|
||||
</if>
|
||||
#{devCode}, #{devType},
|
||||
<if test="proId!=null and proId!=''">
|
||||
#{proId},
|
||||
</if>
|
||||
#{proName},#{applyNum},#{statusType})
|
||||
</insert>
|
||||
<!--差人申请详情-->
|
||||
<insert id="insertDetails">
|
||||
insert into t_part_apply_details(
|
||||
apply_id, part_id, apply_num,remark,
|
||||
apply_id, part_id, apply_num,remark,
|
||||
part_type, part_name, part_model,part_unit ) values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{param.id},#{item.partId},#{item.applyNum},#{item.remark},
|
||||
|
|
@ -105,45 +105,49 @@
|
|||
|
||||
<if test="keyWord!=null and keyWord!=''">
|
||||
and (
|
||||
mt2.NAME like concat('%',#{keyWord},'%') or
|
||||
mt3.NAME like concat('%',#{keyWord},'%') or
|
||||
mt2.NAME like concat('%',#{keyWord},'%') or
|
||||
mt3.NAME like concat('%',#{keyWord},'%') or
|
||||
mm.DEVICE_CODE like concat('%',#{keyWord},'%') or
|
||||
mt.NAME like concat('%',#{keyWord},'%')
|
||||
mt.NAME like concat('%',#{keyWord},'%')
|
||||
)
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getDevInfoById" resultType="com.bonus.gzgqj.business.app.entity.MachinesVo">
|
||||
select mm.id ,mt2.NAME name ,mt3.`NAME` type ,mt.name module ,mm.DEVICE_CODE deviceCode
|
||||
from mm_machines mm
|
||||
left join mm_type mt on mt.id=mm.TYPE and mt.`LEVEL`=4 and mt.IS_ACTIVE=1
|
||||
left join mm_type mt2 on mt.PARENT_ID=mt2.id
|
||||
left join mm_type mt3 on mt2.PARENT_ID=mt3.id
|
||||
where mm.BATCH_STATUS=7 and mm.id=#{devId}
|
||||
select mm.id, mt2.NAME name, mt3.`NAME` type, mt.name module ,mm.DEVICE_CODE deviceCode
|
||||
from mm_machines mm
|
||||
left join mm_type mt
|
||||
on mt.id=mm.TYPE and mt.`LEVEL`=4 and mt.IS_ACTIVE=1
|
||||
left join mm_type mt2 on mt.PARENT_ID=mt2.id
|
||||
left join mm_type mt3 on mt2.PARENT_ID=mt3.id
|
||||
where mm.BATCH_STATUS=7 and mm.id=#{devId}
|
||||
</select>
|
||||
<select id="getWfRecordList" resultType="com.bonus.gzgqj.business.app.entity.MachinesVo">
|
||||
select wir.sup_id ,wat.AGREEMENT_ID,
|
||||
wir.id ,pro.`NAME` proName ,pro.Id proId
|
||||
<select id="getWfRecordList" resultType="com.bonus.gzgqj.business.app.entity.MachinesVo">
|
||||
select wir.sup_id,
|
||||
wat.AGREEMENT_ID,
|
||||
wir.id,
|
||||
pro.`NAME` proName,
|
||||
pro.Id proId
|
||||
from wf_info_record wir
|
||||
LEFT JOIN wf_return_material_details rmd on wir.SUP_ID=rmd.id
|
||||
LEFT JOIN wf_agreement_task wat on rmd.TASK_ID=wat.TASK_ID
|
||||
LEFT JOIN wf_lease_agreement wla on wat.AGREEMENT_ID=wla.id
|
||||
left join bm_project pro on pro.id=wla.PROJECT
|
||||
where TYPE=4 AND wir.MA_ID=#{id}
|
||||
ORDER BY wir.TIME DESC
|
||||
limit 1
|
||||
LEFT JOIN wf_return_material_details rmd on wir.SUP_ID = rmd.id
|
||||
LEFT JOIN wf_agreement_task wat on rmd.TASK_ID = wat.TASK_ID
|
||||
LEFT JOIN wf_lease_agreement wla on wat.AGREEMENT_ID = wla.id
|
||||
left join bm_project pro on pro.id = wla.PROJECT
|
||||
where TYPE = 4
|
||||
AND wir.MA_ID = #{id}
|
||||
ORDER BY wir.TIME DESC limit 1
|
||||
|
||||
</select>
|
||||
<!--配件下拉选集合-->
|
||||
<select id="getPaTypeList" resultType="com.bonus.gzgqj.business.bases.entity.PaTypeVo">
|
||||
select pt.id, pt.parent_id parentId,pt.name model ,pt.num,
|
||||
pt.price,pt.unit ,pt.weight,pt.is_consumables ,
|
||||
pt.remarks,pt.is_active ,pt.level,pt.warn_num,pt1.`name` name ,pt2.name type
|
||||
select pt.id, pt.parent_id parentId,pt.name model ,pt.num,
|
||||
pt.price,pt.unit ,pt.weight,pt.is_consumables ,
|
||||
pt.remarks,pt.is_active ,pt.level,pt.warn_num,pt1.`name` name ,pt2.name type
|
||||
FROM pa_type pt
|
||||
left join pa_type pt1 on pt.parent_id=pt1.id and pt1.`level`=2 and pt1.is_active=1
|
||||
left join pa_type pt2 on pt1.parent_id=pt2.id and pt2.`level`=1 and pt2.is_active=1
|
||||
WHERE pt.is_active=1 and pt.`level`=3
|
||||
left join pa_type pt1 on pt.parent_id=pt1.id and pt1.`level`=2 and pt1.is_active=1
|
||||
left join pa_type pt2 on pt1.parent_id=pt2.id and pt2.`level`=1 and pt2.is_active=1
|
||||
WHERE pt.is_active=1 and pt.`level`=3
|
||||
<if test="keyWord!=null and keyWord!=''">
|
||||
and (
|
||||
pt2.name like concat('%',#{keyWord},'%') or
|
||||
|
|
@ -153,16 +157,20 @@
|
|||
</if>
|
||||
<if test="name!=null and name!=''">
|
||||
and (
|
||||
pt2.name like concat('%',#{name},'%') or
|
||||
pt1.name like concat('%',#{name},'%') or
|
||||
pt.name like concat('%',#{name},'%')
|
||||
pt1.name like concat('%',#{name},'%')
|
||||
)
|
||||
</if>
|
||||
|
||||
<if test="model!=null and model!=''">
|
||||
and (
|
||||
pt.name like concat('%',#{model},'%')
|
||||
)
|
||||
</if>
|
||||
</select>
|
||||
<select id="getSqList" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
from t_part_apply
|
||||
where DATE_FORMAT(create_time,'%Y-%m-%d')=CURRENT_DATE
|
||||
select count(1)
|
||||
from t_part_apply
|
||||
where DATE_FORMAT(create_time, '%Y-%m-%d') = CURRENT_DATE
|
||||
|
||||
</select>
|
||||
<!--配件申请查询记录-->
|
||||
|
|
@ -180,51 +188,83 @@
|
|||
when 3 THEN '已驳回'
|
||||
when 4 THEN '已出库'
|
||||
else '待审核'
|
||||
END as statusName,
|
||||
END as statusName,
|
||||
CASE tpa.type
|
||||
when 0 then '设备'
|
||||
when 0 then '设备'
|
||||
when 1 then '工器具'
|
||||
else '工器具'
|
||||
END as typeName
|
||||
END as typeName
|
||||
FROM t_part_apply tpa
|
||||
<where>
|
||||
<if test="keyWord!=null and keyWord!=''">
|
||||
and (
|
||||
tpa.code like concat('%',#{keyWord},'%') or
|
||||
tpa.user_name like concat('%',#{keyWord},'%')
|
||||
tpa.code like concat('%',#{keyWord},'%') or
|
||||
tpa.user_name like concat('%',#{keyWord},'%')
|
||||
)
|
||||
</if>
|
||||
<if test="startDay!=null and startDay!='' and endDay!=null and endDay!='' ">
|
||||
and STR_TO_DATE(tpa.create_time, '%Y-%m-%d') between STR_TO_DATE(#{startDay} ,'%Y-%m-%d') AND STR_TO_DATE(#{endDay},'%Y-%m-%d')
|
||||
and STR_TO_DATE(tpa.create_time, '%Y-%m-%d') between STR_TO_DATE(#{startDay} ,'%Y-%m-%d') AND
|
||||
STR_TO_DATE(#{endDay},'%Y-%m-%d')
|
||||
</if>
|
||||
</where>
|
||||
order by tpa.create_time desc
|
||||
order by tpa.create_time desc
|
||||
</select>
|
||||
<select id="getPartApplyDetails" resultType="com.bonus.gzgqj.business.app.entity.PartApplyAppVo">
|
||||
select tpa.id,tpa.code,tpa.creator,tpa.user_name userName,
|
||||
tpa.create_time createTime,tpa.type ,
|
||||
tpa.remark,tpa.status ,tpa.updater,
|
||||
tpa.update_time updateTime,tpa.dev_id deviceId,tpa.dev_code devCode,
|
||||
tpa.dev_type devType,tpa.pro_id proId,tpa.pro_name proName,
|
||||
tpa.status_type statusType,tpa.apply_num applyNum,
|
||||
tpa.zd_user ,fz_user ,ck_user ,zd_time zdTime,fz_time fzTime,ck_time ckTime,
|
||||
CASE tpa.status when 1 THEN '待审核' when 2 THEN '待出库'
|
||||
when 3 THEN '已驳回' when 4 THEN '已出库' else '待审核' END as statusName,
|
||||
CASE tpa.type when 0 then '设备' when 1 then '工器具' else '工器具' END as typeName,
|
||||
pu2.LOGIN_NAME zdUser,pu3.LOGIN_NAME ckUser,pu4.LOGIN_NAME fzUser
|
||||
select tpa.id,
|
||||
tpa.code,
|
||||
tpa.creator,
|
||||
tpa.user_name userName,
|
||||
tpa.create_time createTime,
|
||||
tpa.type,
|
||||
tpa.remark,
|
||||
tpa.status,
|
||||
tpa.updater,
|
||||
tpa.update_time updateTime,
|
||||
tpa.dev_id deviceId,
|
||||
tpa.dev_code devCode,
|
||||
tpa.dev_type devType,
|
||||
tpa.pro_id proId,
|
||||
tpa.pro_name proName,
|
||||
tpa.status_type statusType,
|
||||
tpa.apply_num applyNum,
|
||||
tpa.zd_user,
|
||||
fz_user,
|
||||
ck_user,
|
||||
zd_time zdTime,
|
||||
fz_time fzTime,
|
||||
ck_time ckTime,
|
||||
CASE tpa.status
|
||||
when 1 THEN '待审核'
|
||||
when 2 THEN '待出库'
|
||||
when 3 THEN '已驳回'
|
||||
when 4 THEN '已出库'
|
||||
else '待审核' END as statusName,
|
||||
CASE tpa.type when 0 then '设备' when 1 then '工器具' else '工器具' END as typeName,
|
||||
pu2.LOGIN_NAME zdUser,
|
||||
pu3.LOGIN_NAME ckUser,
|
||||
pu4.LOGIN_NAME fzUser
|
||||
FROM t_part_apply tpa
|
||||
left join pm_user pu on tpa.creator=pu.id -- 领用人
|
||||
left join pm_user pu2 on tpa.zd_user=pu2.id -- 制单人
|
||||
left join pm_user pu3 on tpa.ck_user=pu3.id -- 出库人
|
||||
left join pm_user pu4 on tpa.fz_user=pu4.id -- 审核人
|
||||
where tpa.id=#{id}
|
||||
left join pm_user pu on tpa.creator = pu.id -- 领用人
|
||||
left join pm_user pu2 on tpa.zd_user = pu2.id -- 制单人
|
||||
left join pm_user pu3 on tpa.ck_user = pu3.id -- 出库人
|
||||
left join pm_user pu4 on tpa.fz_user = pu4.id -- 审核人
|
||||
where tpa.id = #{id}
|
||||
</select>
|
||||
<select id="getDetailsList" resultType="com.bonus.gzgqj.business.app.entity.PartApplyDetailAppVo">
|
||||
select ppd.id,ppd.apply_id applyId, ppd.part_id partId, ppd.apply_num applyNum,
|
||||
ppd.part_type partType, ppd.part_name partName, ppd.part_model partModel,ppd.part_unit partUnit,
|
||||
pt.price ,(ppd.apply_num*pt.price ) money,pt.num
|
||||
from t_part_apply_details ppd
|
||||
LEFT JOIN pa_type pt on pt.id=ppd.part_id
|
||||
where ppd.apply_id=#{id}
|
||||
select ppd.id,
|
||||
ppd.apply_id applyId,
|
||||
ppd.part_id partId,
|
||||
ppd.apply_num applyNum,
|
||||
ppd.part_type partType,
|
||||
ppd.part_name partName,
|
||||
ppd.part_model partModel,
|
||||
ppd.part_unit partUnit,
|
||||
pt.price,
|
||||
(ppd.apply_num * pt.price) money,
|
||||
pt.num,
|
||||
ppd.remark
|
||||
from t_part_apply_details ppd
|
||||
LEFT JOIN pa_type pt on pt.id = ppd.part_id
|
||||
where ppd.apply_id = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue