wms/nflg-wms-repository/src/main/resources/mapper/WmsTransferOrdersMapper.xml

43 lines
2.1 KiB
XML

<?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.nflg.wms.repository.mapper.WmsTransferOrdersMapper">
<select id="search" resultType="com.nflg.wms.common.pojo.vo.TransferOrderVO">
select
a.id,a.barcode_code,a.transfer_num,a.create_time,a.create_user_name,a.material_code,
a.material_description,a.unit,a.batch_no,a.serial_no,a.factory_code,
a.from_bin_location,a.to_bin_location,a.storage_location
from wms_transfer_orders a
<where>
<if test="request.barcodeCode !=null and request.barcodeCode !=''">
and a.package_code ilike concat('%', #{request.barcodeCode}, '%')
</if>
<if test="request.materialDescription !=null and request.materialDescription !=''">
and a.material_description ilike concat('%', #{request.materialDescription}, '%')
</if>
<if test="request.materialCode !=null and request.materialCode !=''">
and a.material_code ilike concat('%', #{request.materialCode}, '%')
</if>
<if test="request.factoryCode !=null and request.factoryCode !=''">
and a.factory_code = #{request.factoryCode}
</if>
<if test="request.fromBinLocation !=null and request.fromBinLocation !=''">
and a.from_bin_location = #{request.fromBinLocation}
</if>
<if test="request.toBinLocation !=null and request.toBinLocation !=''">
and a.to_bin_location = #{request.toBinLocation}
</if>
<if test="request.storageLocation !=null and request.storageLocation !=''">
and a.storage_location = #{request.storageLocation}
</if>
<if test="request.startDate !=null">
and a.create_time>= #{request.startDate}
</if>
<if test="request.endDate !=null">
and a.create_time &lt;= #{request.endDate}
</if>
</where>
order by a.id DESC
</select>
</mapper>