Commit ac3bacc4 by huluobin

update

parent 17cf5624
...@@ -307,6 +307,60 @@ ...@@ -307,6 +307,60 @@
ORDER BY id DESC ORDER BY id DESC
</select> </select>
<!--查询所有的物流费用单和采购单-->
<select id="getLogisticsCostList" resultType="com.bailuntec.cost.api.dto.ManageCostDto">
SELECT c.cost_no no,c.bank_company receiveUnit,d.cost_reason reason,c.pay_time payTime,c.cost_form
manageCostType,u.departmentname1 departmentName,
c.company_value companyValue,c.company_name companyName,t.manage_cost_type feeSuperType,d.kind_name
feeSubType,d.amount amount,c.dic currency,
d.amount * c.to_rmb_rate amountRmb, d.id as costId1, c.id as costId
FROM user u, cost c, cost_detail d, type_relation t
WHERE c.create_userid = u.userid AND c.cost_no = d.cost_no AND t.fee_type = c.type_name AND c.cost_form = 1 AND
c.cost_status = 4
AND d.kind_name = '物流费'
<if test="startDate != null">AND c.pay_time <![CDATA[>=]]> #{startDate}</if>
<if test="endDate != null">AND c.pay_time <![CDATA[<]]>#{endDate}</if>
UNION
SELECT c1.cost_no no,c1.bank_company receiveUnit,c1.cost_reason reason,c1.pay_time payTime,c1.cost_form
manageCostType,u.departmentname1 departmentName,
c1.company_value companyValue,c1.company_name companyName,t.manage_cost_type feeSuperType,c1.kind_name
feeSubType,-c1.amount amount,c1.dic currency,
-c1.amount * c1.to_rmb_rate amountRmb, 0 as costId1, c1.id as costId
FROM user u, type_relation t ,cost c1
WHERE c1.create_userid = u.userid AND t.fee_type = c1.type_name AND c1.cost_form = 2 AND c1.cost_status = 4
AND c1.kind_name = '物流费'
<if test="startDate != null">AND c1.pay_time <![CDATA[>=]]> #{startDate}</if>
<if test="endDate != null">AND c1.pay_time <![CDATA[<]]>#{endDate}</if>
UNION
SELECT c.cost_no no,c.bank_company receiveUnit,c.cost_reason reason,c.pay_time payTime,c.cost_form
manageCostType,u.departmentname1 departmentName,
c.company_value companyValue,c.company_name companyName,t.manage_cost_type feeSuperType,c.kind_name
feeSubType,c.amount amount,c.dic currency,
c.amount * c.to_rmb_rate amountRmb, 0 as costId1, c.id as costId
FROM user u, cost c, type_relation t
WHERE c.create_userid = u.userid AND t.fee_type = c.type_name AND c.cost_form = 3 AND c.is_lend = 2 AND
c.cost_status = 4
AND c.kind_name = '物流费'
<if test="startDate != null">AND c.pay_time <![CDATA[>=]]> #{startDate}</if>
<if test="endDate != null">AND c.pay_time <![CDATA[<]]>#{endDate}</if>
UNION
SELECT b.buyno no,b.suppliername receiveUnit,b.note reason,b.pay_time payTime,0 as
manageCostType,b.departmentname departmentName,
b.company_value companyValue,b.company companyName,b.sku_type_name feeSuperType,b.sku_type_name feeSubType,
b.amount amount,'CNY',b.amount amountRmb, 0 as costId1, 0 as costId
FROM buy b
WHERE b.sku_type_name = '物流费'
and b.buystatus <![CDATA[>]]> 3 and b.buystatus <![CDATA[<]]> 7 and b.buy_type <![CDATA[<]]> 3
<if test="startDate != null">AND b.pay_time <![CDATA[>=]]> #{startDate}</if>
<if test="endDate != null">AND b.pay_time <![CDATA[<]]>#{endDate}</if>
</select>
<select id="getCostList" resultType="com.bailuntec.cost.api.dto.CostDto">
select *
from cost
where last_modify_date &gt;= #{startDate}
and last_modify_date &lt;= #{endDate}
</select>
<!--管理成本:查询付款单+收款单+借还单+采购单--> <!--管理成本:查询付款单+收款单+借还单+采购单-->
<select id="selectManageCost" resultType="com.bailuntec.cost.api.dto.ManageCostDto"> <select id="selectManageCost" resultType="com.bailuntec.cost.api.dto.ManageCostDto">
...@@ -457,56 +511,6 @@ ...@@ -457,56 +511,6 @@
<if test="endDate != null">AND b.pay_time <![CDATA[<]]>#{endDate}</if> <if test="endDate != null">AND b.pay_time <![CDATA[<]]>#{endDate}</if>
</select> </select>
<!--查询所有的物流费用单和采购单-->
<select id="getLogisticsCostList" resultType="com.bailuntec.cost.api.dto.ManageCostDto">
SELECT c.cost_no no,c.bank_company receiveUnit,d.cost_reason reason,c.pay_time payTime,c.cost_form
manageCostType,u.departmentname1 departmentName,
c.company_value companyValue,c.company_name companyName,t.manage_cost_type feeSuperType,d.kind_name
feeSubType,d.amount amount,c.dic currency,
d.amount * c.to_rmb_rate amountRmb, d.id as costId1, c.id as costId
FROM user u, cost c, cost_detail d, type_relation t
WHERE c.create_userid = u.userid AND c.cost_no = d.cost_no AND t.fee_type = c.type_name AND c.cost_form = 1 AND
c.cost_status = 4
AND d.kind_name = '物流费'
<if test="startDate != null">AND c.pay_time <![CDATA[>=]]> #{startDate}</if>
<if test="endDate != null">AND c.pay_time <![CDATA[<]]>#{endDate}</if>
UNION
SELECT c1.cost_no no,c1.bank_company receiveUnit,c1.cost_reason reason,c1.pay_time payTime,c1.cost_form
manageCostType,u.departmentname1 departmentName,
c1.company_value companyValue,c1.company_name companyName,t.manage_cost_type feeSuperType,c1.kind_name
feeSubType,-c1.amount amount,c1.dic currency,
-c1.amount * c1.to_rmb_rate amountRmb, 0 as costId1, c1.id as costId
FROM user u, type_relation t ,cost c1
WHERE c1.create_userid = u.userid AND t.fee_type = c1.type_name AND c1.cost_form = 2 AND c1.cost_status = 4
AND c1.kind_name = '物流费'
<if test="startDate != null">AND c1.pay_time <![CDATA[>=]]> #{startDate}</if>
<if test="endDate != null">AND c1.pay_time <![CDATA[<]]>#{endDate}</if>
UNION
SELECT c.cost_no no,c.bank_company receiveUnit,c.cost_reason reason,c.pay_time payTime,c.cost_form
manageCostType,u.departmentname1 departmentName,
c.company_value companyValue,c.company_name companyName,t.manage_cost_type feeSuperType,c.kind_name
feeSubType,c.amount amount,c.dic currency,
c.amount * c.to_rmb_rate amountRmb, 0 as costId1, c.id as costId
FROM user u, cost c, type_relation t
WHERE c.create_userid = u.userid AND t.fee_type = c.type_name AND c.cost_form = 3 AND c.is_lend = 2 AND
c.cost_status = 4
AND c.kind_name = '物流费'
<if test="startDate != null">AND c.pay_time <![CDATA[>=]]> #{startDate}</if>
<if test="endDate != null">AND c.pay_time <![CDATA[<]]>#{endDate}</if>
UNION
SELECT b.buyno no,b.suppliername receiveUnit,b.note reason,b.pay_time payTime,0 as
manageCostType,b.departmentname departmentName,
b.company_value companyValue,b.company companyName,b.sku_type_name feeSuperType,b.sku_type_name feeSubType,
b.amount amount,'CNY',b.amount amountRmb, 0 as costId1, 0 as costId
FROM buy b
WHERE b.sku_type_name = '物流费'
and b.buystatus <![CDATA[>]]> 3 and b.buystatus <![CDATA[<]]> 7 and b.buy_type <![CDATA[<]]> 3
<if test="startDate != null">AND b.pay_time <![CDATA[>=]]> #{startDate}</if>
<if test="endDate != null">AND b.pay_time <![CDATA[<]]>#{endDate}</if>
</select>
<!-- <!--
资产负债表相关费用单 资产负债表相关费用单
1、已完成状态的所有费用类型借支单 1、已完成状态的所有费用类型借支单
...@@ -633,12 +637,6 @@ ...@@ -633,12 +637,6 @@
</if> </if>
</select> </select>
<select id="getCostList" resultType="com.bailuntec.cost.api.dto.CostDto">
select *
from cost
where last_modify_date &gt;= #{startDate}
and last_modify_date &lt;= #{endDate}
</select>
<update id="updateCashierAnnex"> <update id="updateCashierAnnex">
update cost update cost
......
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