Commit a1fcec0b by 徐高华

sql

parent 8a36dd60
...@@ -539,7 +539,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe ...@@ -539,7 +539,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
@Override @Override
public int getCanAddHmCount(String wxEnterpriseId, String enterpriseId, String clerkId) { public int getCanAddHmCount(String wxEnterpriseId, String enterpriseId, String clerkId) {
int count = this.hmQrcodeService.getCanAddCount(wxEnterpriseId, enterpriseId, clerkId); int count = this.hmQrcodeService.getCanAddCount(wxEnterpriseId, enterpriseId, clerkId);
return 0; return count;
} }
} }
...@@ -357,28 +357,27 @@ ...@@ -357,28 +357,27 @@
</update> </update>
<select id="getCanAddCount" resultType="int"> <select id="getCanAddCount" resultType="int">
select count(*) from tab_haoban_staff_clerk_relation a LEFT JOIN tab_haoban_hm_qrcode b ON a.clerk_id = b.clerk_id and b.hm_type = 1 select count(*) from
WHERE a.enterprise_id = #{enterpriseId} AND a.status_flag = 1 AND a.open_concat_flag = 0 <include refid="canAddClerkSql" />
<if test="null != storeIdList">
and a.store_id in
<foreach collection="storeIdList" item="id" index="index" open="(" close=")" separator=",">
#{id,jdbcType=VARCHAR}
</foreach>
</if>
and b.hm_id is null
</select> </select>
<select id="listCanAddClerk" resultType="com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeClerkBO"> <select id="listCanAddClerk" resultType="com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeClerkBO">
select a.clerk_id , a.store_id , a.staff_id , a.staff_name from tab_haoban_staff_clerk_relation a LEFT JOIN tab_haoban_hm_qrcode b ON a.clerk_id = b.clerk_id and b.hm_type = 1 and b.status_flag in (1,3) select a.clerk_id , a.store_id , a.staff_id , a.staff_name from
<include refid="canAddClerkSql" />
</select>
<sql id="canAddClerkSql">
tab_haoban_staff_clerk_relation a LEFT JOIN tab_haoban_hm_qrcode b ON a.clerk_id = b.clerk_id and b.hm_type = 1 and b.status_flag in (1,3)
WHERE a.enterprise_id = #{enterpriseId} AND a.status_flag = 1 AND a.open_concat_flag = 0 WHERE a.enterprise_id = #{enterpriseId} AND a.status_flag = 1 AND a.open_concat_flag = 0
<if test="null != storeIdList"> <if test="null != storeIdList">
and a.store_id in and a.store_id in
<foreach collection="storeIdList" item="id" index="index" open="(" close=")" separator=","> <foreach collection="storeIdList" item="id" index="index" open="(" close=")" separator=",">
#{id} #{id,jdbcType=VARCHAR}
</foreach> </foreach>
</if> </if>
and a.wx_enterprise_id = #{wxEnterpriseId}
and b.hm_id is null and b.hm_id is null
</select> </sql>
</mapper> </mapper>
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