备品备件领用

highway
A0010407 11 months ago
parent 23659427c6
commit c78f1542ed

@ -1,6 +1,8 @@
package com.op.device.domain;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
@ -79,6 +81,39 @@ public class EquSpareApply extends BaseEntity {
@Excel(name = "工厂号")
private String factoryCode;
// 创建日期范围list
private List<Date> applyTimeArray;
// 创建日期开始
private String applyTimeStart;
// 创建日期结束
private String applyTimeEnd;
public List<Date> getApplyTimeArray() {
return applyTimeArray;
}
public void setApplyTimeArray(List<Date> applyTimeArray) {
this.applyTimeArray = applyTimeArray;
}
public String getApplyTimeStart() {
return applyTimeStart;
}
public void setApplyTimeStart(String createTimeStart) {
this.applyTimeStart = createTimeStart;
}
public String getApplyTimeEnd() {
return applyTimeEnd;
}
public void setApplyTimeEnd(String applyTimeEnd) {
this.applyTimeEnd = applyTimeEnd;
}
public void setApplyId(String applyId) {
this.applyId = applyId;
}

@ -1,5 +1,6 @@
package com.op.device.service.impl;
import java.text.SimpleDateFormat;
import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
@ -44,6 +45,14 @@ public class EquSpareApplyServiceImpl implements IEquSpareApplyService {
@Override
@DS("#header.poolName")
public List<EquSpareApply> selectEquSpareApplyList(EquSpareApply equSpareApply) {
if (equSpareApply.getApplyTimeArray() != null) {
// 设置创建日期开始和结束值
if (equSpareApply.getApplyTimeArray().size() == 2) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
equSpareApply.setApplyTimeStart(formatter.format(equSpareApply.getApplyTimeArray().get(0)));
equSpareApply.setApplyTimeEnd(formatter.format(equSpareApply.getApplyTimeArray().get(1)));
}
}
return equSpareApplyMapper.selectEquSpareApplyList(equSpareApply);
}

@ -34,26 +34,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectEquSpareApplyList" parameterType="EquSpareApply" resultMap="EquSpareApplyResult">
<include refid="selectEquSpareApplyVo"/>
<where>
<if test="applyCode != null and applyCode != ''"> and apply_code = #{applyCode}</if>
<if test="spareCode != null and spareCode != ''"> and spare_code = #{spareCode}</if>
<if test="applyCode != null and applyCode != ''"> and apply_code like concat('%', #{applyCode}, '%')</if>
<if test="spareCode != null and spareCode != ''"> and spare_code like concat('%', #{spareCode}, '%')</if>
<if test="spareName != null and spareName != ''"> and spare_name like concat('%', #{spareName}, '%')</if>
<if test="spareModel != null and spareModel != ''"> and spare_model = #{spareModel}</if>
<if test="spareQuantity != null "> and spare_quantity = #{spareQuantity}</if>
<if test="spareGroupLine != null and spareGroupLine != ''"> and spare_group_line = #{spareGroupLine}</if>
<if test="spareUseEquipment != null and spareUseEquipment != ''"> and spare_use_equipment = #{spareUseEquipment}</if>
<if test="applyTime != null "> and apply_time = #{applyTime}</if>
<if test="applyPeople != null and applyPeople != ''"> and apply_people = #{applyPeople}</if>
<if test="applyApprovePeople != null and applyApprovePeople != ''"> and apply_approve_people = #{applyApprovePeople}</if>
<if test="spareModel != null and spareModel != ''"> and spare_model like concat('%', #{spareModel}, '%')</if>
<if test="spareQuantity != null "> and spare_quantity like concat('%', #{spareQuantity}, '%')</if>
<if test="spareGroupLine != null and spareGroupLine != ''"> and spare_group_line like concat('%', #{spareGroupLine}, '%')</if>
<if test="spareUseEquipment != null and spareUseEquipment != ''"> and spare_use_equipment like concat('%', #{spareUseEquipment}, '%')</if>
<if test="applyTimeStart != null "> and CONVERT(date,apply_time) >= #{applyTimeStart}</if>
<if test="applyTimeEnd != null "> and #{applyTimeEnd} >= CONVERT(date,apply_time)</if>
<if test="applyPeople != null and applyPeople != ''"> and apply_people like concat('%', #{applyPeople}, '%')</if>
<if test="applyApprovePeople != null and applyApprovePeople != ''"> and apply_approve_people like concat('%', #{applyApprovePeople}, '%')</if>
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
<if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
and del_flag = '0'
ORDER BY apply_time DESC
</where>
</select>
<select id="selectEquSpareApplyByApplyId" parameterType="String" resultMap="EquSpareApplyResult">
<include refid="selectEquSpareApplyVo"/>
where apply_id = #{applyId}
and del_flag = '0'
</select>
<insert id="insertEquSpareApply" parameterType="EquSpareApply">

Loading…
Cancel
Save