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

30 lines
1.5 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.UserSupplierMapper">
<select id="search" resultType="com.nflg.wms.common.pojo.vo.UserSupplierVO">
select a.id,user_id,supplier_code,supplier_name,abbreviation,abbreviation1,type_id,abbreviation2,
is_open_account,"state",pci_name,pci_phone,default_language,avatar,remark,
di.name AS type_name,a.create_by,a.create_time,a.update_by,a.update_time
from user_supplier a
LEFT JOIN dictionary_item di ON a.type_id = di.id
<where>
<if test="request.name!=null and request.name!=''">
and (supplier_name ilike concat('%', #{request.name}, '%')
or abbreviation ilike concat('%', #{request.name}, '%')
or abbreviation1 ilike concat('%', #{request.name}, '%')
or abbreviation2 ilike concat('%', #{request.name}, '%'))
</if>
<if test="request.code!=null and request.code!=''">
and supplier_code ilike concat('%', #{request.code}, '%')
</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>