wms/nflg-wms-repository/src/main/resources/mapper/WmsOutAssistanceTicketMappe...

39 lines
1.7 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.WmsOutAssistanceTicketMapper">
<select id="search" resultType="com.nflg.wms.common.pojo.vo.OutAssistanceInfoVO">
SELECT oat."id",oat."no" AS "ticket_no",oat.create_by,oat.create_time,oa.*
FROM wms_out_assistance_ticket oat
INNER JOIN wms_out_assistance oa ON oat.order_id=oa."id"
<where>
<if test="request.no != null and request.no!=''">
AND oa."no" ilike CONCAT('%', #{request.no}, '%')
</if>
<if test="request.ebeln!=null and request.ebeln!=''">
and ebeln ilike concat('%', #{request.ebeln}, '%')
</if>
<if test="request.werks!=null and request.werks!=''">
and werks like concat('%', #{request.werks}, '%')
</if>
<if test="request.lifnr!=null and request.lifnr!=''">
and lifnr like concat('%', #{request.lifnr}, '%')
</if>
<if test="request.startDate!=null">
and oat.create_time >= #{request.startDate}
</if>
<if test="request.endDate!=null">
and oat.create_time &lt;= #{request.endDate}
</if>
</where>
order by oat.id desc
</select>
<select id="getInfo" resultType="com.nflg.wms.common.pojo.vo.OutAssistanceInfoVO">
SELECT oat."id",oat."no" AS "ticket_no",oat.create_by,oat.create_time,oa.*
FROM wms_out_assistance_ticket oat
INNER JOIN wms_out_assistance oa ON oat.order_id=oa."id"
where oat.id=#{id}
</select>
</mapper>