|
@@ -357,10 +357,10 @@
|
|
|
any(#{goodsBrandList,typeHandler=UuidListTypeHandler})
|
|
any(#{goodsBrandList,typeHandler=UuidListTypeHandler})
|
|
|
</if>
|
|
</if>
|
|
|
<if test="skuName != null and skuName != ''">
|
|
<if test="skuName != null and skuName != ''">
|
|
|
- AND tmgs.sku_name like concat('%', my_ex.likequery(#{skuName}) , '%')
|
|
|
|
|
|
|
+ AND tpoi.sku_name like concat('%', my_ex.likequery(#{skuName}) , '%')
|
|
|
</if>
|
|
</if>
|
|
|
<if test="skuModel != null and skuModel != ''">
|
|
<if test="skuModel != null and skuModel != ''">
|
|
|
- AND tmgs.sku_model like concat('%', my_ex.likequery(#{skuModel}) , '%')
|
|
|
|
|
|
|
+ AND tpoi.sku_model like concat('%', my_ex.likequery(#{skuModel}) , '%')
|
|
|
</if>
|
|
</if>
|
|
|
<if test="brandName != null and brandName != ''">
|
|
<if test="brandName != null and brandName != ''">
|
|
|
AND tmgb.brand_name like concat('%', my_ex.likequery(#{brandName}) , '%')
|
|
AND tmgb.brand_name like concat('%', my_ex.likequery(#{brandName}) , '%')
|
|
@@ -444,10 +444,10 @@
|
|
|
any(#{goodsBrandList,typeHandler=UuidListTypeHandler})
|
|
any(#{goodsBrandList,typeHandler=UuidListTypeHandler})
|
|
|
</if>
|
|
</if>
|
|
|
<if test="skuName != null and skuName != ''">
|
|
<if test="skuName != null and skuName != ''">
|
|
|
- AND tmgs.sku_name like concat('%', my_ex.likequery(#{skuName}) , '%')
|
|
|
|
|
|
|
+ AND tpii.sku_name like concat('%', my_ex.likequery(#{skuName}) , '%')
|
|
|
</if>
|
|
</if>
|
|
|
<if test="skuModel != null and skuModel != ''">
|
|
<if test="skuModel != null and skuModel != ''">
|
|
|
- AND tmgs.sku_model like concat('%', my_ex.likequery(#{skuModel}) , '%')
|
|
|
|
|
|
|
+ AND tpii.sku_model like concat('%', my_ex.likequery(#{skuModel}) , '%')
|
|
|
</if>
|
|
</if>
|
|
|
<if test="brandName != null and brandName != ''">
|
|
<if test="brandName != null and brandName != ''">
|
|
|
AND tmgb.brand_name like concat('%', my_ex.likequery(#{brandName}) , '%')
|
|
AND tmgb.brand_name like concat('%', my_ex.likequery(#{brandName}) , '%')
|
|
@@ -1073,6 +1073,9 @@
|
|
|
,concat(sys.f_remove_zero(tpoi.out_qty),tmgu.unit_name) as "outQtyPiece"
|
|
,concat(sys.f_remove_zero(tpoi.out_qty),tmgu.unit_name) as "outQtyPiece"
|
|
|
,sys.f_remove_zero(tpoi.out_qty) as "outQty"
|
|
,sys.f_remove_zero(tpoi.out_qty) as "outQty"
|
|
|
,tpoi.out_amt as "outAmt"
|
|
,tpoi.out_amt as "outAmt"
|
|
|
|
|
+ ,tpoi.fact_amt as "factAmt"
|
|
|
|
|
+ ,tpoi.disc_amt as "discAmt"
|
|
|
|
|
+ ,tpoi.discount as "discount"
|
|
|
,sys.f_remove_zero(tpoi.return_qty) as "returnQty"
|
|
,sys.f_remove_zero(tpoi.return_qty) as "returnQty"
|
|
|
,tpoi.return_amt as "returnAmt"
|
|
,tpoi.return_amt as "returnAmt"
|
|
|
,dkic_b.f_box_piece(tmgus.unit_name,tmgu.unit_name,tpoi.outing_box,tpoi.outing_piece) as "outingBoxPiece"
|
|
,dkic_b.f_box_piece(tmgus.unit_name,tmgu.unit_name,tpoi.outing_box,tpoi.outing_piece) as "outingBoxPiece"
|
|
@@ -1124,8 +1127,8 @@
|
|
|
,tpi.into_date as "outDate"
|
|
,tpi.into_date as "outDate"
|
|
|
,tpi.remarks
|
|
,tpi.remarks
|
|
|
,makestaff.staff_name as "makeStaffName"
|
|
,makestaff.staff_name as "makeStaffName"
|
|
|
- ,tmgs.sku_name as "skuName"
|
|
|
|
|
- ,tmgs.sku_model as "skuModel"
|
|
|
|
|
|
|
+ ,tpii.sku_name as "skuName"
|
|
|
|
|
+ ,tpii.sku_model as "skuModel"
|
|
|
,tmgs.sku_spec as "skuSpec"
|
|
,tmgs.sku_spec as "skuSpec"
|
|
|
,tpii.non_std_code as "nonStdCode"
|
|
,tpii.non_std_code as "nonStdCode"
|
|
|
,tmgb.short_name as "shortName"
|
|
,tmgb.short_name as "shortName"
|
|
@@ -1139,6 +1142,9 @@
|
|
|
,concat(sys.f_remove_zero(abs(tpii.into_qty)),tmgu.unit_name) as "outQtyPiece"
|
|
,concat(sys.f_remove_zero(abs(tpii.into_qty)),tmgu.unit_name) as "outQtyPiece"
|
|
|
,sys.f_remove_zero(tpii.into_qty) as "outQty"
|
|
,sys.f_remove_zero(tpii.into_qty) as "outQty"
|
|
|
,tpii.into_amt as "outAmt"
|
|
,tpii.into_amt as "outAmt"
|
|
|
|
|
+ ,tpii.into_amt+tpii.intoing_amt as "factAmt"
|
|
|
|
|
+ ,0.00 as "discAmt"
|
|
|
|
|
+ ,0.00 as "discount"
|
|
|
,sys.f_remove_zero(tpii.return_qty) as "returnQty"
|
|
,sys.f_remove_zero(tpii.return_qty) as "returnQty"
|
|
|
,tpii.return_amt as "returnAmt"
|
|
,tpii.return_amt as "returnAmt"
|
|
|
,dkic_b.f_box_piece(tmgus.unit_name,tmgu.unit_name,abs(tpii.intoing_box),abs(tpii.intoing_piece)) as "outingBoxPiece"
|
|
,dkic_b.f_box_piece(tmgus.unit_name,tmgu.unit_name,abs(tpii.intoing_box),abs(tpii.intoing_piece)) as "outingBoxPiece"
|
|
@@ -1514,8 +1520,8 @@
|
|
|
t.item_index AS "itemIndex",
|
|
t.item_index AS "itemIndex",
|
|
|
t.sku_id AS "skuId",
|
|
t.sku_id AS "skuId",
|
|
|
tmgs.sku_code as "skuCode",
|
|
tmgs.sku_code as "skuCode",
|
|
|
- tmgs.sku_model as "skuModel",
|
|
|
|
|
- tmgs.sku_name as "skuName",
|
|
|
|
|
|
|
+ t.sku_model as "skuModel",
|
|
|
|
|
+ t.sku_name as "skuName",
|
|
|
tmgb.brand_name AS "brandName",
|
|
tmgb.brand_name AS "brandName",
|
|
|
t.item_qty AS "itemQty",
|
|
t.item_qty AS "itemQty",
|
|
|
sys.f_get_name_i18n(tdk3.kind_name_i18n, #{i18n}) as "outStatusName",
|
|
sys.f_get_name_i18n(tdk3.kind_name_i18n, #{i18n}) as "outStatusName",
|
|
@@ -1546,11 +1552,11 @@
|
|
|
dkic_b.f_box_piece ( tmgus.unit_name, tmgu.unit_name, T.BOX, T.piece ) AS "boxPiece"
|
|
dkic_b.f_box_piece ( tmgus.unit_name, tmgu.unit_name, T.BOX, T.piece ) AS "boxPiece"
|
|
|
FROM dkic_b.t_psi_order_item as t
|
|
FROM dkic_b.t_psi_order_item as t
|
|
|
inner join dkic_b.t_psi_order tpo on tpo.order_id = t.order_id
|
|
inner join dkic_b.t_psi_order tpo on tpo.order_id = t.order_id
|
|
|
- inner join dkic_b.t_mst_goods_sku tmgs on t.sku_id = tmgs.sku_id
|
|
|
|
|
|
|
+ left join dkic_b.t_mst_goods_sku tmgs on t.sku_id = tmgs.sku_id
|
|
|
left join dkic_b.t_mst_warehouse tmw on tmw.wh_id = t.wh_id
|
|
left join dkic_b.t_mst_warehouse tmw on tmw.wh_id = t.wh_id
|
|
|
left join dkic_b.t_mst_customer tmc on tmc.cus_id = tpo.cus_id
|
|
left join dkic_b.t_mst_customer tmc on tmc.cus_id = tpo.cus_id
|
|
|
LEFT JOIN dkic_b.t_mst_goods_brand tmgb ON tmgb.brand_id = tmgs.brand_id
|
|
LEFT JOIN dkic_b.t_mst_goods_brand tmgb ON tmgb.brand_id = tmgs.brand_id
|
|
|
- left join sys.t_data_kind as tdk3 on tpo.out_status = tdk3.kind_code
|
|
|
|
|
|
|
+ left join sys.t_data_kind as tdk3 on t.out_status = tdk3.kind_code
|
|
|
LEFT JOIN dkic_b.t_mst_unit AS tmgu ON tmgs.unit_id = tmgu.unit_id
|
|
LEFT JOIN dkic_b.t_mst_unit AS tmgu ON tmgs.unit_id = tmgu.unit_id
|
|
|
LEFT JOIN dkic_b.t_mst_unit AS tmgus ON tmgs.sub_unit_id = tmgus.unit_id
|
|
LEFT JOIN dkic_b.t_mst_unit AS tmgus ON tmgs.sub_unit_id = tmgus.unit_id
|
|
|
<include refid="ConditionSaleItem"/>
|
|
<include refid="ConditionSaleItem"/>
|
|
@@ -1627,10 +1633,10 @@
|
|
|
AND tpo.make_time < #{makeTimeEnd}::timestamp with time zone + interval '1 day'
|
|
AND tpo.make_time < #{makeTimeEnd}::timestamp with time zone + interval '1 day'
|
|
|
</if>
|
|
</if>
|
|
|
<if test="skuName != null and skuName != ''">
|
|
<if test="skuName != null and skuName != ''">
|
|
|
- AND tmgs.sku_name like concat('%', my_ex.likequery(#{skuName}) , '%')
|
|
|
|
|
|
|
+ AND t.sku_name like concat('%', my_ex.likequery(#{skuName}) , '%')
|
|
|
</if>
|
|
</if>
|
|
|
<if test="skuModel != null and skuModel != ''">
|
|
<if test="skuModel != null and skuModel != ''">
|
|
|
- AND tmgs.sku_model like concat('%', my_ex.likequery(#{skuModel}) , '%')
|
|
|
|
|
|
|
+ AND t.sku_model like concat('%', my_ex.likequery(#{skuModel}) , '%')
|
|
|
</if>
|
|
</if>
|
|
|
<if test="brandName != null and brandName != ''">
|
|
<if test="brandName != null and brandName != ''">
|
|
|
AND tmgb.brand_name like concat('%', my_ex.likequery(#{brandName}) , '%')
|
|
AND tmgb.brand_name like concat('%', my_ex.likequery(#{brandName}) , '%')
|
|
@@ -3066,6 +3072,9 @@
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<!--region 销售利润-->
|
|
<!--region 销售利润-->
|
|
|
|
|
+ <!--
|
|
|
|
|
+ 2024-06-24 11:25 成本和销售额都从出库明细中取
|
|
|
|
|
+ -->
|
|
|
|
|
|
|
|
<select id="getSaleProfit" resultType="java.util.Map">
|
|
<select id="getSaleProfit" resultType="java.util.Map">
|
|
|
select
|
|
select
|
|
@@ -3075,16 +3084,15 @@
|
|
|
from (
|
|
from (
|
|
|
select
|
|
select
|
|
|
<include refid="getSaleProfitInOutBound"/>
|
|
<include refid="getSaleProfitInOutBound"/>
|
|
|
- from dkic_b.t_psi_in_out_record tpr
|
|
|
|
|
|
|
+ from dkic_b.t_psi_outbound_item tpoi
|
|
|
<if test="orgIds!=null and orgIds.size()>0">
|
|
<if test="orgIds!=null and orgIds.size()>0">
|
|
|
- left join dkic_b.t_psi_inbound tpi on tpi.into_id = biznis_id
|
|
|
|
|
- left join dkic_b.t_psi_outbound tpo on tpo.out_id = biznis_id
|
|
|
|
|
|
|
+ left join dkic_b.t_psi_outbound tpo on tpo.out_id = tpoi.out_id
|
|
|
</if>
|
|
</if>
|
|
|
<include refid="getSaleProfitCond"/>
|
|
<include refid="getSaleProfitCond"/>
|
|
|
|
|
+ <include refid="getSaleProfitDateCond"/>
|
|
|
<if test="orgIds!=null and orgIds.size()>0">
|
|
<if test="orgIds!=null and orgIds.size()>0">
|
|
|
and (
|
|
and (
|
|
|
- (tpo.org_id = any(#{orgIds, typeHandler=UuidListTypeHanlder}) and tpi.org_id is null)
|
|
|
|
|
- or (tpi.org_id = any(#{orgIds, typeHandler=UuidListTypeHanlder}) and tpo.org_id is null)
|
|
|
|
|
|
|
+ tpo.org_id = any(#{orgIds, typeHandler=com.dk.common.infrastructure.handler.UuidListTypeHandler})
|
|
|
)
|
|
)
|
|
|
</if>
|
|
</if>
|
|
|
) t
|
|
) t
|
|
@@ -3096,28 +3104,28 @@
|
|
|
<include refid="getSaleProfitRate"/>
|
|
<include refid="getSaleProfitRate"/>
|
|
|
from (select
|
|
from (select
|
|
|
<if test="byDate==null or (byDate!=null and byDate=='false')">
|
|
<if test="byDate==null or (byDate!=null and byDate=='false')">
|
|
|
- to_char(acc_date, 'yyyy-mm') acc_date,
|
|
|
|
|
|
|
+ to_char(tpoi.op_create_time, 'yyyy-mm') acc_date,
|
|
|
</if>
|
|
</if>
|
|
|
<if test="byDate!=null and byDate=='true'">
|
|
<if test="byDate!=null and byDate=='true'">
|
|
|
- to_char(acc_date, 'mm-dd') acc_date,
|
|
|
|
|
|
|
+ to_char(tpoi.op_create_time, 'mm-dd') acc_date,
|
|
|
</if>
|
|
</if>
|
|
|
<include refid="getSaleProfitInOutBound"/>
|
|
<include refid="getSaleProfitInOutBound"/>
|
|
|
- from dkic_b.t_psi_in_out_record tpr
|
|
|
|
|
- where tpr.cp_id = #{cpId}
|
|
|
|
|
- AND tpr.op_create_time >= now() - interval
|
|
|
|
|
|
|
+ from dkic_b.t_psi_outbound_item tpoi
|
|
|
|
|
+ <include refid="getSaleProfitCond"/>
|
|
|
|
|
+ AND tpoi.op_create_time >= now() - interval
|
|
|
<if test="byDate==null or (byDate!=null and byDate=='false')">
|
|
<if test="byDate==null or (byDate!=null and byDate=='false')">
|
|
|
'1 year'
|
|
'1 year'
|
|
|
</if>
|
|
</if>
|
|
|
<if test="byDate!=null and byDate=='true'">
|
|
<if test="byDate!=null and byDate=='true'">
|
|
|
'1 month'
|
|
'1 month'
|
|
|
</if>
|
|
</if>
|
|
|
- AND tpr.op_create_time < now()
|
|
|
|
|
|
|
+ AND tpoi.op_create_time < now()
|
|
|
group by
|
|
group by
|
|
|
<if test="byDate==null or (byDate!=null and byDate=='false')">
|
|
<if test="byDate==null or (byDate!=null and byDate=='false')">
|
|
|
- to_char(acc_date, 'yyyy-mm')
|
|
|
|
|
|
|
+ to_char(tpoi.op_create_time, 'yyyy-mm')
|
|
|
</if>
|
|
</if>
|
|
|
<if test="byDate!=null and byDate=='true'">
|
|
<if test="byDate!=null and byDate=='true'">
|
|
|
- to_char(acc_date, 'mm-dd')
|
|
|
|
|
|
|
+ to_char(tpoi.op_create_time, 'mm-dd')
|
|
|
</if>
|
|
</if>
|
|
|
) t
|
|
) t
|
|
|
order by t.acc_date
|
|
order by t.acc_date
|
|
@@ -3129,13 +3137,13 @@
|
|
|
select t.org_id,
|
|
select t.org_id,
|
|
|
t.outbound - t.inbound "profit",
|
|
t.outbound - t.inbound "profit",
|
|
|
<include refid="getSaleProfitRate"/>
|
|
<include refid="getSaleProfitRate"/>
|
|
|
- from (select coalesce(tpi.org_id, tpo.org_id) org_id,
|
|
|
|
|
|
|
+ from (select tpo.org_id org_id,
|
|
|
<include refid="getSaleProfitInOutBound"/>
|
|
<include refid="getSaleProfitInOutBound"/>
|
|
|
- from dkic_b.t_psi_in_out_record tpr
|
|
|
|
|
- left join dkic_b.t_psi_inbound tpi on tpi.into_id = biznis_id
|
|
|
|
|
- left join dkic_b.t_psi_outbound tpo on tpo.out_id = biznis_id
|
|
|
|
|
|
|
+ from dkic_b.t_psi_outbound_item tpoi
|
|
|
|
|
+ left join dkic_b.t_psi_outbound tpo on tpo.out_id = tpoi.out_id
|
|
|
<include refid="getSaleProfitCond"/>
|
|
<include refid="getSaleProfitCond"/>
|
|
|
- group by coalesce(tpi.org_id, tpo.org_id)) t
|
|
|
|
|
|
|
+ <include refid="getSaleProfitDateCond"/>
|
|
|
|
|
+ group by tpo.org_id) t
|
|
|
) tt
|
|
) tt
|
|
|
left join dkic_b.t_mst_org tmo on tmo.org_id = tt.org_id
|
|
left join dkic_b.t_mst_org tmo on tmo.org_id = tt.org_id
|
|
|
<include refid="getSaleProfitLimit"/>
|
|
<include refid="getSaleProfitLimit"/>
|
|
@@ -3147,34 +3155,34 @@
|
|
|
select t.staff_id,
|
|
select t.staff_id,
|
|
|
t.outbound - t.inbound "profit",
|
|
t.outbound - t.inbound "profit",
|
|
|
<include refid="getSaleProfitRate"/>
|
|
<include refid="getSaleProfitRate"/>
|
|
|
- from (select coalesce(tpi.staff_id, tpo.staff_id) staff_id,
|
|
|
|
|
|
|
+ from (select tpo.staff_id staff_id,
|
|
|
<include refid="getSaleProfitInOutBound"/>
|
|
<include refid="getSaleProfitInOutBound"/>
|
|
|
- from dkic_b.t_psi_in_out_record tpr
|
|
|
|
|
- left join dkic_b.t_psi_inbound tpi on tpi.into_id = biznis_id
|
|
|
|
|
- left join dkic_b.t_psi_outbound tpo on tpo.out_id = biznis_id
|
|
|
|
|
|
|
+ from dkic_b.t_psi_outbound_item tpoi
|
|
|
|
|
+ left join dkic_b.t_psi_outbound tpo on tpo.out_id = tpoi.out_id
|
|
|
<include refid="getSaleProfitCond"/>
|
|
<include refid="getSaleProfitCond"/>
|
|
|
|
|
+ <include refid="getSaleProfitDateCond"/>
|
|
|
<if test="orgIds!=null and orgIds.size()>0">
|
|
<if test="orgIds!=null and orgIds.size()>0">
|
|
|
and (
|
|
and (
|
|
|
- (tpo.org_id = any(#{orgIds, typeHandler=UuidListTypeHanlder}) and tpi.org_id is null)
|
|
|
|
|
- or (tpi.org_id = any(#{orgIds, typeHandler=UuidListTypeHanlder}) and tpo.org_id is null)
|
|
|
|
|
|
|
+ tpo.org_id = any(#{orgIds, typeHandler=com.dk.common.infrastructure.handler.UuidListTypeHandler})
|
|
|
)
|
|
)
|
|
|
</if>
|
|
</if>
|
|
|
- group by coalesce(tpi.staff_id, tpo.staff_id)) t
|
|
|
|
|
|
|
+ group by tpo.staff_id) t
|
|
|
) tt
|
|
) tt
|
|
|
left join dkic_b.t_mst_staff tms on tms.staff_id = tt.staff_id
|
|
left join dkic_b.t_mst_staff tms on tms.staff_id = tt.staff_id
|
|
|
<include refid="getSaleProfitLimit"/>
|
|
<include refid="getSaleProfitLimit"/>
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="getSaleProfitGroupBySku" resultType="java.util.Map">
|
|
<select id="getSaleProfitGroupBySku" resultType="java.util.Map">
|
|
|
- select tmgs.sku_name "skuName", tt.profit, tt."profitRate"
|
|
|
|
|
|
|
+ select tmgs.sku_model || coalesce('(' || tmgs.sku_name || ')', '') "skuName", tt.profit, tt."profitRate"
|
|
|
from (
|
|
from (
|
|
|
select t.sku_id,
|
|
select t.sku_id,
|
|
|
t.outbound - t.inbound "profit",
|
|
t.outbound - t.inbound "profit",
|
|
|
<include refid="getSaleProfitRate"/>
|
|
<include refid="getSaleProfitRate"/>
|
|
|
from (select sku_id sku_id,
|
|
from (select sku_id sku_id,
|
|
|
<include refid="getSaleProfitInOutBound"/>
|
|
<include refid="getSaleProfitInOutBound"/>
|
|
|
- from dkic_b.t_psi_in_out_record tpr
|
|
|
|
|
|
|
+ from dkic_b.t_psi_outbound_item tpoi
|
|
|
<include refid="getSaleProfitCond"/>
|
|
<include refid="getSaleProfitCond"/>
|
|
|
|
|
+ <include refid="getSaleProfitDateCond"/>
|
|
|
group by sku_id) t
|
|
group by sku_id) t
|
|
|
) tt
|
|
) tt
|
|
|
left join dkic_b.t_mst_goods_sku tmgs on tmgs.sku_id = tt.sku_id
|
|
left join dkic_b.t_mst_goods_sku tmgs on tmgs.sku_id = tt.sku_id
|
|
@@ -3182,15 +3190,18 @@
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<sql id="getSaleProfitInOutBound">
|
|
<sql id="getSaleProfitInOutBound">
|
|
|
- SUM(case biznis_type when 't_psi_outbound' then abs(tpr.into_amt) else 0 end) outbound,
|
|
|
|
|
- SUM(case biznis_type when 't_psi_inbound' then abs(tpr.into_amt) else 0 end) inbound
|
|
|
|
|
|
|
+ sum(tpoi.fact_amt - tpoi.return_amt) outbound,
|
|
|
|
|
+ sum(tpoi.cost_amt) inbound
|
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
|
|
<sql id="getSaleProfitCond">
|
|
<sql id="getSaleProfitCond">
|
|
|
- where tpr.cp_id = #{cpId}
|
|
|
|
|
|
|
+ where tpoi.cp_id = #{cpId} and tpoi.out_status = '出库状态-已出库' and tpoi.sku_id is not null
|
|
|
|
|
+ </sql>
|
|
|
|
|
+
|
|
|
|
|
+ <sql id="getSaleProfitDateCond">
|
|
|
<if test="makeTimeStart != null and makeTimeEnd != null">
|
|
<if test="makeTimeStart != null and makeTimeEnd != null">
|
|
|
- AND tpr.op_create_time >= #{makeTimeStart}::timestamp with time zone
|
|
|
|
|
- AND tpr.op_create_time < #{makeTimeEnd}::timestamp with time zone + interval '1 day'
|
|
|
|
|
|
|
+ AND tpoi.op_create_time >= #{makeTimeStart}::timestamp with time zone
|
|
|
|
|
+ AND tpoi.op_create_time < #{makeTimeEnd}::timestamp with time zone + interval '1 day'
|
|
|
</if>
|
|
</if>
|
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|