添加装备/装备台账
This commit is contained in:
parent
da7eea810d
commit
ac05148928
|
|
@ -304,4 +304,14 @@ public class MaDevInfo {
|
||||||
|
|
||||||
private String unitName;
|
private String unitName;
|
||||||
|
|
||||||
|
private String expirationYears;
|
||||||
|
|
||||||
|
|
||||||
|
private String actualStartYear;
|
||||||
|
private String actualStopYear;
|
||||||
|
private String remainingStartYear;
|
||||||
|
private String remainingStopYear;
|
||||||
|
|
||||||
|
private String isWarn;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.bonus.material.device.mapper;
|
||||||
|
|
||||||
import com.bonus.common.biz.domain.*;
|
import com.bonus.common.biz.domain.*;
|
||||||
import com.bonus.material.book.domain.BookCarInfoDto;
|
import com.bonus.material.book.domain.BookCarInfoDto;
|
||||||
|
import com.bonus.material.devchange.domain.MapBean;
|
||||||
import com.bonus.material.device.domain.DevInfo;
|
import com.bonus.material.device.domain.DevInfo;
|
||||||
import com.bonus.material.device.domain.MaDevQc;
|
import com.bonus.material.device.domain.MaDevQc;
|
||||||
import com.bonus.material.device.domain.SafeBookInfo;
|
import com.bonus.material.device.domain.SafeBookInfo;
|
||||||
|
|
|
||||||
|
|
@ -15,10 +15,12 @@
|
||||||
<result column="remaining_days" property="remainingDays"/>
|
<result column="remaining_days" property="remainingDays"/>
|
||||||
<result column="remaining_years" property="remainingYears"/>
|
<result column="remaining_years" property="remainingYears"/>
|
||||||
<result column="years_diff" property="yearsDiff"/>
|
<result column="years_diff" property="yearsDiff"/>
|
||||||
|
<result column="expiration_years" property="expirationYears"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
<select id="list" resultMap="BaseResultMap">
|
<select id="list" resultMap="BaseResultMap">
|
||||||
|
select * from (
|
||||||
SELECT
|
SELECT
|
||||||
c.company_name,
|
c.company_name,
|
||||||
mdi.ma_id,
|
mdi.ma_id,
|
||||||
|
|
@ -28,6 +30,8 @@
|
||||||
mdi.brand,
|
mdi.brand,
|
||||||
mdi.production_date,
|
mdi.production_date,
|
||||||
mdi.expiration_time,
|
mdi.expiration_time,
|
||||||
|
IF(STR_TO_DATE(production_date, '%Y-%m-%d') IS NOT NULL AND STR_TO_DATE(expiration_time, '%Y-%m-%d') IS NOT NULL, TIMESTAMPDIFF(YEAR, STR_TO_DATE(production_date,
|
||||||
|
'%Y-%m-%d'), expiration_time), 0) AS expiration_years,
|
||||||
IF(STR_TO_DATE(production_date, '%Y-%m-%d') IS NOT NULL, DATEDIFF(CURDATE(), STR_TO_DATE(production_date,
|
IF(STR_TO_DATE(production_date, '%Y-%m-%d') IS NOT NULL, DATEDIFF(CURDATE(), STR_TO_DATE(production_date,
|
||||||
'%Y-%m-%d')), 0) AS days_diff,
|
'%Y-%m-%d')), 0) AS days_diff,
|
||||||
IF(STR_TO_DATE(production_date, '%Y-%m-%d') IS NOT NULL, TIMESTAMPDIFF(YEAR, STR_TO_DATE(production_date,
|
IF(STR_TO_DATE(production_date, '%Y-%m-%d') IS NOT NULL, TIMESTAMPDIFF(YEAR, STR_TO_DATE(production_date,
|
||||||
|
|
@ -55,13 +59,30 @@
|
||||||
ma_dev_info mdi
|
ma_dev_info mdi
|
||||||
LEFT JOIN sys_dept sd ON sd.dept_id = mdi.own_co
|
LEFT JOIN sys_dept sd ON sd.dept_id = mdi.own_co
|
||||||
LEFT JOIN bm_company_info c ON sd.dept_id = c.company_id
|
LEFT JOIN bm_company_info c ON sd.dept_id = c.company_id
|
||||||
WHERE mdi.is_active = 1
|
WHERE mdi.is_active = 1 and mdi.entry_status = '1' and mdi.change_status in (1,5)
|
||||||
<if test="deviceName != null">
|
<if test="deviceName != null and deviceName != ''">
|
||||||
AND mdi.device_name like concat('%',#{deviceName},'%')
|
AND mdi.device_name like concat('%',#{deviceName},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="brand != null">
|
<if test="brand != null and brand != ''">
|
||||||
AND mdi.brand like concat('%',#{brand},'%')
|
AND mdi.brand like concat('%',#{brand},'%')
|
||||||
</if>
|
</if>
|
||||||
|
) a
|
||||||
|
<where>
|
||||||
|
<if test="actualStartYear != null and actualStartYear != ''">
|
||||||
|
and years_diff between #{actualStartYear} and #{actualStopYear}
|
||||||
|
</if>
|
||||||
|
<if test="remainingStartYear != null and remainingStartYear != ''">
|
||||||
|
and remaining_years between #{remainingStartYear} and #{remainingStopYear}
|
||||||
|
</if>
|
||||||
|
<if test="isWarn != null and isWarn != ''">
|
||||||
|
<if test="isWarn == 1">
|
||||||
|
AND device_status != '正常使用'
|
||||||
|
</if>
|
||||||
|
<if test="isWarn == 0">
|
||||||
|
AND device_status = '正常使用'
|
||||||
|
</if>
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue