Browse Source

inner join导致查询条件失效

master
xyiege 3 years ago
parent
commit
5f14e1f42e
  1. 14
      src/main/resources/mapper/szwh/TiketMapper.xml

14
src/main/resources/mapper/szwh/TiketMapper.xml

@ -22,22 +22,14 @@
SELECT o.`status`,u.`name`,ticket.id,ticket.pdfUrl,u.uscc,ticket.tickettime,ticket.ticketid,ticket.batchcode,
ticket.ticket_status,ticket.ticketimage,ticket.ticketurl,ticket.ticketmoney,ticket.islicode,ticket.ticketApiMessage
FROM ticket
INNER JOIN order_user u ON u.batchcode = ticket.batchcode AND u.islicode = ticket.islicode
LEFT JOIN order_user u ON u.batchcode = ticket.batchcode AND u.islicode = ticket.islicode
LEFT JOIN `order` as o ON o.batchcode = ticket.batchcode
<where>
<if test="map!=null">
<foreach collection="map" item="v" index="k" separator="and">
<if test="v != null and v != '' and k!='ticketid' and k!='u.name' and k!='o.status'">
<if test="v != null and v != '' and k!='ticketid' and k!='u.name'">
${k} = #{v}
</if>
<!-- 订单状态 -->
<if test="k=='o.status'">
t.batchcode IN (
SELECT batchcode FROM `order`
<if test="v!='' ">
WHERE `status`=#{v} LIMIT #{start},#{limit}
</if>
)
</if>
<if test="k=='ticketid'">
ticket.ticketid like concat ('%',#{v},'%')
</if>

Loading…
Cancel
Save