|
@@ -124,7 +124,14 @@
|
|
sum(num6) as sevenNum,
|
|
sum(num6) as sevenNum,
|
|
sum(num7) as deviceNum
|
|
sum(num7) as deviceNum
|
|
from (
|
|
from (
|
|
- select count(1) as num1 ,0 as num2,0 as num3,0 as num4,0 as num5,0 as num6, 0 as num7 from bt_order o where 1=1
|
|
|
|
|
|
+ select count(1) as num1 ,0 as num2,0 as num3,0 as num4,0 as num5,0 as num6, 0 as num7 from bt_order o
|
|
|
|
+ <if test="orgIds != null and orgIds != ''">
|
|
|
|
+ left join imcs_tenant_productionresource p on o.order_equ_id = p.id
|
|
|
|
+ where p.org_id in (${orgIds})
|
|
|
|
+ </if>
|
|
|
|
+ <if test="orgIds==null ">
|
|
|
|
+ where 1 = 1
|
|
|
|
+ </if>
|
|
<if test="now != null">
|
|
<if test="now != null">
|
|
and o.create_time >= #{now, jdbcType=TIMESTAMP}
|
|
and o.create_time >= #{now, jdbcType=TIMESTAMP}
|
|
</if>
|
|
</if>
|
|
@@ -136,10 +143,37 @@
|
|
</if>
|
|
</if>
|
|
union
|
|
union
|
|
select 0 as num1, count(1) as num2 ,0 as num3,0 as num4,0 as num5,0 as num6, 0 as num7 from bt_order o
|
|
select 0 as num1, count(1) as num2 ,0 as num3,0 as num4,0 as num5,0 as num6, 0 as num7 from bt_order o
|
|
|
|
+ <if test="orgIds != null and orgIds != ''">
|
|
|
|
+ left join imcs_tenant_productionresource p on o.order_equ_id = p.id
|
|
|
|
+ where p.org_id in (${orgIds})
|
|
|
|
+ </if>
|
|
|
|
+ <if test="orgIds == null ">
|
|
|
|
+ where 1 = 1
|
|
|
|
+ </if>
|
|
|
|
+ <if test="id != null">
|
|
|
|
+ and o.id = #{id}
|
|
|
|
+ </if>
|
|
union
|
|
union
|
|
select 0 as num1,0 as num2,count(1) as num3,0 as num4,0 as num5,0 as num6, 0 as num7 from bt_order o
|
|
select 0 as num1,0 as num2,count(1) as num3,0 as num4,0 as num5,0 as num6, 0 as num7 from bt_order o
|
|
|
|
+ <if test="orgIds != null and orgIds != ''">
|
|
|
|
+ left join imcs_tenant_productionresource p on o.order_equ_id = p.id
|
|
|
|
+ where p.org_id in (${orgIds})
|
|
|
|
+ </if>
|
|
|
|
+ <if test="orgIds == null ">
|
|
|
|
+ where 1 = 1
|
|
|
|
+ </if>
|
|
|
|
+ <if test="id != null">
|
|
|
|
+ and o.id = #{id}
|
|
|
|
+ </if>
|
|
union
|
|
union
|
|
- select 0 as num1,0 as num2,0 as num3,sum(o.order_amount) as num4,0 as num5,0 as num6, 0 as num7 from bt_order o where 1=1
|
|
|
|
|
|
+ select 0 as num1,0 as num2,0 as num3,sum(o.order_amount) as num4,0 as num5,0 as num6, 0 as num7 from bt_order o
|
|
|
|
+ <if test="orgIds != null and orgIds != ''">
|
|
|
|
+ left join imcs_tenant_productionresource p on o.order_equ_id = p.id
|
|
|
|
+ where p.org_id in (${orgIds})
|
|
|
|
+ </if>
|
|
|
|
+ <if test="orgIds == null ">
|
|
|
|
+ where 1 = 1
|
|
|
|
+ </if>
|
|
<if test="now != null">
|
|
<if test="now != null">
|
|
and o.create_time >= #{now, jdbcType=TIMESTAMP}
|
|
and o.create_time >= #{now, jdbcType=TIMESTAMP}
|
|
</if>
|
|
</if>
|
|
@@ -150,7 +184,14 @@
|
|
and o.id = #{id}
|
|
and o.id = #{id}
|
|
</if>
|
|
</if>
|
|
union
|
|
union
|
|
- select 0,0,0,0,count(1) as num5,0, 0 from bt_order o where 1=1
|
|
|
|
|
|
+ select 0,0,0,0,count(1) as num5,0, 0 from bt_order o
|
|
|
|
+ <if test="orgIds != null and orgIds != ''">
|
|
|
|
+ left join imcs_tenant_productionresource p on o.order_equ_id = p.id
|
|
|
|
+ where p.org_id in (${orgIds})
|
|
|
|
+ </if>
|
|
|
|
+ <if test="orgIds == null ">
|
|
|
|
+ where 1 = 1
|
|
|
|
+ </if>
|
|
<if test="sevenAgo != null">
|
|
<if test="sevenAgo != null">
|
|
and o.create_time >= #{sevenAgo, jdbcType=TIMESTAMP}
|
|
and o.create_time >= #{sevenAgo, jdbcType=TIMESTAMP}
|
|
</if>
|
|
</if>
|
|
@@ -161,7 +202,14 @@
|
|
and o.id = #{id}
|
|
and o.id = #{id}
|
|
</if>
|
|
</if>
|
|
union
|
|
union
|
|
- select 0,0,0,0,0,sum(o.order_amount) as num6, 0 from bt_order o where produce_status = '1'
|
|
|
|
|
|
+ select 0,0,0,0,0,sum(o.order_amount) as num6, 0 from bt_order o
|
|
|
|
+ <if test="orgIds != null and orgIds != ''">
|
|
|
|
+ left join imcs_tenant_productionresource p on o.order_equ_id = p.id
|
|
|
|
+ where p.org_id in (${orgIds})
|
|
|
|
+ </if>
|
|
|
|
+ <if test="orgIds == null ">
|
|
|
|
+ where o.produce_status = '1'
|
|
|
|
+ </if>
|
|
<if test="sevenAgo != null">
|
|
<if test="sevenAgo != null">
|
|
and o.create_time >= #{sevenAgo, jdbcType=TIMESTAMP}
|
|
and o.create_time >= #{sevenAgo, jdbcType=TIMESTAMP}
|
|
</if>
|
|
</if>
|
|
@@ -173,14 +221,11 @@
|
|
</if>
|
|
</if>
|
|
union
|
|
union
|
|
select 0,0,0,0,0,0, count(p.id) as num7 from imcs_tenant_productionresource p where p.status = '1'
|
|
select 0,0,0,0,0,0, count(p.id) as num7 from imcs_tenant_productionresource p where p.status = '1'
|
|
- <if test="sevenAgo != null">
|
|
|
|
- and o.create_time >= #{sevenAgo, jdbcType=TIMESTAMP}
|
|
|
|
- </if>
|
|
|
|
- <if test="now != null">
|
|
|
|
- and o.create_time <![CDATA[ <= ]]> #{now, jdbcType=TIMESTAMP}
|
|
|
|
- </if>
|
|
|
|
<if test="id != null">
|
|
<if test="id != null">
|
|
- and o.id = #{id}
|
|
|
|
|
|
+ and p.id = #{id}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="orgIds != null and orgIds != ''">
|
|
|
|
+ and p.org_id in (${orgIds})
|
|
</if>
|
|
</if>
|
|
) f
|
|
) f
|
|
</select>
|
|
</select>
|