提交 0e818f17 authored 作者: 李秋林's avatar 李秋林

修改bug:当上次打卡店铺与已有店铺中查询不到时,返回空值

上级 4feafa85
...@@ -86,9 +86,22 @@ ...@@ -86,9 +86,22 @@
</select> </select>
<select id="findLatestClockByTemporaryId" resultMap="BaseResultMap"> <select id="findLatestClockByTemporaryId" resultMap="BaseResultMap">
select store_id, store_name,activity_pattern_id,activity_pattern -- select store_id, store_name,activity_pattern_id,activity_pattern
from temporary_activity_clock -- from temporary_activity_clock
where id = (select max(id) from temporary_activity_clock where temporary_id = #{temporaryId} and is_delete = 1); -- where id = (select max(id) from temporary_activity_clock where temporary_id = #{temporaryId} and is_delete = 1);
select tac.store_id, tac.store_name, tac.activity_pattern_id, tac.activity_pattern
from temporary_activity_clock tac,
(select ps.id as store_id, tacl.id as clock_id
from promotion_store ps,
(select id, store_id
from temporary_activity_clock
where temporary_id = #{temporaryId}
and is_delete = 1
order by id desc limit 1) tacl
where ps.id = tacl.store_id) tacl2
where tac.id = tacl2.clock_id
and tac.store_id = tacl2.store_id
</select> </select>
</mapper> </mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论