|
|
@ -377,11 +377,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
<select id="countNewCustomers" resultType="java.lang.Integer">
|
|
|
|
<select id="countNewCustomers" resultType="java.lang.Integer">
|
|
|
|
<![CDATA[
|
|
|
|
<![CDATA[
|
|
|
|
SELECT COUNT(DISTINCT customer_id) FROM (SELECT o.customer_id FROM pmt_transactions t
|
|
|
|
SELECT COUNT(DISTINCT customer_id) FROM pmt_orders o
|
|
|
|
INNER JOIN pmt_orders o ON o.order_id = t.order_id
|
|
|
|
|
|
|
|
]]>
|
|
|
|
]]>
|
|
|
|
<![CDATA[
|
|
|
|
<![CDATA[
|
|
|
|
WHERE o.create_time >= #{begin} AND o.create_time < #{end}
|
|
|
|
WHERE o.create_time >= #{begin} AND o.create_time < #{end} AND o.status>4
|
|
|
|
]]>
|
|
|
|
]]>
|
|
|
|
<if test="client_ids!=null">
|
|
|
|
<if test="client_ids!=null">
|
|
|
|
AND o.client_id IN
|
|
|
|
AND o.client_id IN
|
|
|
@ -392,30 +391,31 @@
|
|
|
|
<if test="client_ids==null and client_id != null">
|
|
|
|
<if test="client_ids==null and client_id != null">
|
|
|
|
and o.client_id=#{client_id}
|
|
|
|
and o.client_id=#{client_id}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
<if test="org_id!=null and org_ids==null">and t.org_id=#{org_id}</if>
|
|
|
|
<if test="org_id!=null and org_ids==null">and o.org_id=#{org_id}</if>
|
|
|
|
<if test="org_ids!=null">and t.org_id in
|
|
|
|
<if test="org_ids!=null">and o.org_id in
|
|
|
|
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach>
|
|
|
|
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach>
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
<if test="channel !=null">and o.channel = #{channel}</if>
|
|
|
|
<if test="channel !=null">and o.channel = #{channel}</if>
|
|
|
|
<![CDATA[
|
|
|
|
AND EXISTS (
|
|
|
|
GROUP BY o.customer_id) p
|
|
|
|
<![CDATA[
|
|
|
|
where p.customer_id NOT IN (SELECT o.customer_id FROM pmt_transactions t INNER JOIN pmt_orders o ON o.order_id = t.order_id
|
|
|
|
select customer_id from pmt_orders oo where oo.customer_id=o.customer_id
|
|
|
|
]]>
|
|
|
|
and oo.create_time < #{begin} AND oo.status>4
|
|
|
|
<![CDATA[
|
|
|
|
]]>
|
|
|
|
WHERE o.create_time < #{begin}
|
|
|
|
<if test="client_ids!=null">
|
|
|
|
]]>
|
|
|
|
AND oo.client_id IN
|
|
|
|
<if test="client_ids!=null">
|
|
|
|
<foreach collection="client_ids" open="(" close=")" separator="," item="client_id">
|
|
|
|
AND o.client_id IN
|
|
|
|
#{client_id}
|
|
|
|
<foreach collection="client_ids" open="(" close=")" separator="," item="client_id">
|
|
|
|
</foreach>
|
|
|
|
#{client_id}
|
|
|
|
</if>
|
|
|
|
</foreach>
|
|
|
|
<if test="client_ids==null and client_id != null">
|
|
|
|
</if>
|
|
|
|
and oo.client_id=#{client_id}
|
|
|
|
<if test="client_ids==null and client_id != null">
|
|
|
|
</if>
|
|
|
|
and o.client_id=#{client_id}
|
|
|
|
<if test="org_id!=null and org_ids==null">and oo.org_id=#{org_id}</if>
|
|
|
|
</if>
|
|
|
|
<if test="org_ids!=null">and oo.org_id in
|
|
|
|
<![CDATA[
|
|
|
|
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach>
|
|
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="channel !=null">and oo.channel = #{channel}</if>
|
|
|
|
)
|
|
|
|
)
|
|
|
|
]]>
|
|
|
|
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
<select id="countOldCustomers" resultType="java.lang.Integer">
|
|
|
|
<select id="countOldCustomers" resultType="java.lang.Integer">
|
|
|
|
<![CDATA[
|
|
|
|
<![CDATA[
|
|
|
|