公海列表SQL优化
This commit is contained in:
@@ -680,17 +680,19 @@
|
||||
SELECT
|
||||
<include refid="Base_Column_List"></include>
|
||||
FROM hy_partner_line_info h1
|
||||
WHERE h1.create_time = (
|
||||
SELECT MAX(h2.create_time)
|
||||
FROM hy_partner_line_info h2
|
||||
WHERE h1.partner_id = h2.partner_id
|
||||
and (h2.deleted = 1 or (h2.deleted=0 and h2.line_status=0 and h2.close_time is not null))
|
||||
<if test="partnerIdList!=null and partnerIdList.size>0">
|
||||
<foreach collection="partnerIdList" item="partnerId" open="and h1.partner_id in (" close=")" separator=",">
|
||||
#{partnerId}
|
||||
</foreach>
|
||||
</if>
|
||||
)
|
||||
<where>
|
||||
<if test="partnerIdList!=null and partnerIdList.size>0">
|
||||
<foreach collection="partnerIdList" item="partnerId" open="and h1.partner_id in (" close=")" separator=",">
|
||||
#{partnerId}
|
||||
</foreach>
|
||||
</if>
|
||||
and h1.create_time = (
|
||||
SELECT MAX(h2.create_time)
|
||||
FROM hy_partner_line_info h2
|
||||
WHERE h1.partner_id = h2.partner_id
|
||||
and (h2.deleted = 1 or (h2.deleted=0 and h2.line_status=0 and h2.close_time is not null)))
|
||||
</where>
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user