Commit a1fcec0b by 徐高华

sql

parent 8a36dd60
......@@ -539,7 +539,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
@Override
public int getCanAddHmCount(String wxEnterpriseId, String enterpriseId, String clerkId) {
int count = this.hmQrcodeService.getCanAddCount(wxEnterpriseId, enterpriseId, clerkId);
return 0;
return count;
}
}
......@@ -357,28 +357,27 @@
</update>
<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
WHERE a.enterprise_id = #{enterpriseId} AND a.status_flag = 1 AND a.open_concat_flag = 0
<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 count(*) from
<include refid="canAddClerkSql" />
</select>
<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
<if test="null != storeIdList">
and a.store_id in
<foreach collection="storeIdList" item="id" index="index" open="(" close=")" separator=",">
#{id}
#{id,jdbcType=VARCHAR}
</foreach>
</if>
and a.wx_enterprise_id = #{wxEnterpriseId}
and b.hm_id is null
</select>
</sql>
</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