Commit b7ca6282 by 徐高华

sql

parent 48493079
......@@ -329,33 +329,26 @@
<select id="listHmIdForIndex" resultType="String" parameterType="com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeListQDTO">
select distinct(a.hm_id)
from tab_haoban_hm_qrcode a left join tab_haoban_hm_clerk_relation b on a.hm_id = b.hm_id and b.status = 1
<if test="null != clerkSelect and '' != clerkSelect">
and b.clerk_id = #{clerkSelect}
</if>
<if test="null != storeSelect and '' != storeSelect">
and b.store_id = #{storeSelect}
</if>
<if test="storeId != null and storeId.size > 0">
and b.store_id IN
<foreach collection="storeId" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
</if>
where a.enterprise_id = #{enterpriseId} and a.status_flag != 0
<if test="null != hmSelect and '' != hmSelect ">
and (a.hm_code=#{hmSelect} or a.name like '%${hmSelect}%' or a.creator_name like '%${hmSelect}%' )
</if>
<if test="null != clerkSelect and '' != clerkSelect">
and a.clerk_id = #{clerkSelect}
and ( a.clerk_id = #{clerkSelect} or b.clerk_id = #{clerkSelect} )
</if>
<if test="null != storeSelect and '' != storeSelect">
and a.store_id = #{storeSelect}
and ( a.store_id = #{storeSelect} or b.store_id = #{storeSelect} )
</if>
<if test="storeId != null and storeId.size > 0">
and a.store_id IN
<foreach collection="storeId" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
and ( a.store_id IN
<foreach collection="storeId" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
or b.store_id IN
<foreach collection="storeId" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
)
</if>
<if test="null != statusFlagInt">
and a.status_flag = #{statusFlagInt}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment