Commit 5aec7ec4 by huluobin

不知道哪个接口加一个来源字段

parent 58877d98
......@@ -16,4 +16,7 @@ public class LogisticsCostDto {
private String currency; // 币种
private String costRemark; // 费用单备注
private String costReason; // 付款理由
//费用来源 1-默认 2-WMS 3-调拨系统
private String sourceFrom;
}
......@@ -79,6 +79,7 @@ public class CostApiServiceImpl implements CostApiService {
costDomain.setCompanyName("香港百伦科技有限公司");
costDomain.setAmount(logisticsCostDto.getAmount());
costDomain.setDic(logisticsCostDto.getCurrency());
costDomain.setSourceFrom(logisticsCostDto.getSourceFrom());
BigDecimal toRmbRate = null;
if ("CNY".equals(logisticsCostDto.getCurrency())){
toRmbRate = BigDecimal.ONE;
......
......@@ -65,6 +65,8 @@ public class CostDomain {
private Date rejectTime; //财务驳回时间
private String cashierFilePath;
private String cashierDownloadPath;
//费用来源 1-默认 2-WMS 3-调拨系统
private String sourceFrom;
public String getDic() {
return dic;
......@@ -574,5 +576,13 @@ public class CostDomain {
", rejectTime=" + rejectTime +
'}';
}
public String getSourceFrom() {
return sourceFrom;
}
public void setSourceFrom(String sourceFrom) {
this.sourceFrom = sourceFrom;
}
}
......@@ -4,21 +4,27 @@
<mapper namespace="com.blt.other.other_cost.dao.CostDao">
<insert id="insert" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
INSERT INTO
cost(
cost_no,company_no,company_name,type_no,type_name,subject_code,kind_no,kind_name,create_usercode,create_username,cost_remark,
create_time,son_cost_no,sup_cost_no,cost_status,file_path,mor_file_path,amount,create_userid,sub_logistics_supplier_id,logistics_supplier_id,
bank_name,bank_card,bank_card_user,mor_remark,cost_form,cost_reason,is_lend,had_pay,lend_status,compensate,counteract,lend_balance,
reject_reason,bank_company,cost_plan_no,dic,pay_counteract,pay_lend_balance,pay_plan_amount,pay_dic,pay_cur,is_tax,
detail_key,pay_user_id,pay_time,amount_rmb,to_rmb_rate,company_value,audit_time
)
INSERT INTO cost(cost_no, company_no, company_name, type_no, type_name, subject_code, kind_no, kind_name,
create_usercode, create_username, cost_remark,
create_time, son_cost_no, sup_cost_no, cost_status, file_path, mor_file_path, amount,
create_userid, sub_logistics_supplier_id, logistics_supplier_id,
bank_name, bank_card, bank_card_user, mor_remark, cost_form, cost_reason, is_lend, had_pay,
lend_status, compensate, counteract, lend_balance,
reject_reason, bank_company, cost_plan_no, dic, pay_counteract, pay_lend_balance,
pay_plan_amount, pay_dic, pay_cur, is_tax,
detail_key, pay_user_id, pay_time, amount_rmb, to_rmb_rate, company_value, audit_time,
source_from)
VALUE
(
#{costNo},#{companyNo},#{companyName},#{typeNo},#{typeName},#{subjectCode},#{kindNo},#{kindName},#{createUsercode},#{createUsername},#{costRemark},
#{createTime},#{sonCostNo},#{supCostNo},#{costStatus},#{filePath},#{morFilePath},#{amount},#{createUserid},#{subLogisticsSupplierId},#{logisticsSupplierId},
#{bankName},#{bankCard},#{bankCardUser},#{morRemark},#{costForm},#{costReason},#{isLend},#{hadPay},#{lendStatus},#{compensate},#{counteract},#{lendBalance},
#{rejectReason},#{bankCompany},#{costPlanNo},#{dic},#{payCounteract},#{payLendBalance},#{payPlanAmount},#{payDic},#{payCur},#{isTax},
#{detailKey},#{payUserId},#{payTime},#{amountRmb},#{toRmbRate},#{companyValue},#{auditTime}
#{costNo}, #{companyNo}, #{companyName}, #{typeNo}, #{typeName}, #{subjectCode}, #{kindNo}, #{kindName},
#{createUsercode}, #{createUsername}, #{costRemark},
#{createTime}, #{sonCostNo}, #{supCostNo}, #{costStatus}, #{filePath}, #{morFilePath}, #{amount},
#{createUserid}, #{subLogisticsSupplierId}, #{logisticsSupplierId},
#{bankName}, #{bankCard}, #{bankCardUser}, #{morRemark}, #{costForm}, #{costReason}, #{isLend}, #{hadPay},
#{lendStatus}, #{compensate}, #{counteract}, #{lendBalance},
#{rejectReason}, #{bankCompany}, #{costPlanNo}, #{dic}, #{payCounteract}, #{payLendBalance},
#{payPlanAmount}, #{payDic}, #{payCur}, #{isTax},
#{detailKey}, #{payUserId}, #{payTime}, #{amountRmb}, #{toRmbRate}, #{companyValue}, #{auditTime}, #{sourceFrom}
)
</insert>
......@@ -35,14 +41,10 @@
</select>
<select id="selectByCostNo" resultType="com.blt.other.other_database.model.CostDomain">
SELECT
*
FROM
cost
WHERE
cost_no = #{costNo}
ORDER BY
id
SELECT *
FROM cost
WHERE cost_no = #{costNo}
ORDER BY id
DESC
</select>
......@@ -100,9 +102,10 @@
<if test=" amountRmb!=null">amount_rmb=#{amountRmb},</if>
<if test=" companyValue!=null">company_value=#{companyValue},</if>
<if test=" auditTime!=null">audit_time=#{auditTime},</if>
<if test="hasInvoice != null">has_invoice = #{hasInvoice}, </if>
<if test="rejectType != null">reject_type = #{rejectType}, </if>
<if test="hasInvoice != null">has_invoice = #{hasInvoice},</if>
<if test="rejectType != null">reject_type = #{rejectType},</if>
<if test="rejectTime != null">reject_time = #{rejectTime}</if>
<if test="sourceFrom != null">source_from = #{sourceFrom}</if>
</set>
WHERE
cost_no = #{costNo}
......@@ -160,104 +163,71 @@
<if test=" toRmbRate!=null">to_rmb_rate=#{toRmbRate},</if>
<if test=" amountRmb!=null">amount_rmb=#{amountRmb},</if>
<if test=" companyValue!=null">company_value=#{companyValue},</if>
<if test=" auditTime!=null">audit_time=#{auditTime}, </if>
<if test="hasInvoice != null">has_invoice = #{hasInvoice}, </if>
<if test=" auditTime!=null">audit_time=#{auditTime},</if>
<if test="hasInvoice != null">has_invoice = #{hasInvoice},</if>
<if test="rejectType != null">reject_type = #{rejectType}</if>
<if test="sourceFrom != null">source_from = #{sourceFrom}</if>
</set>
WHERE
id = #{id}
</update>
<select id="selectByStatus" resultType="com.blt.other.other_database.model.CostDomain">
SELECT
*
FROM
cost
WHERE
cost_status >= #{costStatus}
ORDER BY
id DESC
SELECT *
FROM cost
WHERE cost_status >= #{costStatus}
ORDER BY id DESC
</select>
<select id="selectByLend" resultType="com.blt.other.other_database.model.CostDomain">
SELECT
*
FROM
cost
WHERE
is_lend = #{isLend}
ORDER BY
id DESC
SELECT *
FROM cost
WHERE is_lend = #{isLend}
ORDER BY id DESC
</select>
<select id="selectByLendAndStatus" resultType="com.blt.other.other_database.model.CostDomain">
SELECT
*
FROM
cost
WHERE
cost_status >= #{costStatus}
AND
is_lend = #{isLend}
ORDER BY
id DESC
SELECT *
FROM cost
WHERE cost_status >= #{costStatus}
AND is_lend = #{isLend}
ORDER BY id DESC
</select>
<select id="selectByCostStatus" resultType="com.blt.other.other_database.model.CostDomain">
SELECT
*
FROM
cost
WHERE
cost_status = #{costStatus}
ORDER BY
id DESC
SELECT *
FROM cost
WHERE cost_status = #{costStatus}
ORDER BY id DESC
</select>
<select id="selectByLendStatus" resultType="com.blt.other.other_database.model.CostDomain">
SELECT
*
FROM
cost
WHERE
lend_status = #{lendStatus}
ORDER BY
id DESC
SELECT *
FROM cost
WHERE lend_status = #{lendStatus}
ORDER BY id DESC
</select>
<select id="selectByCostForm" resultType="com.blt.other.other_database.model.CostDomain">
SELECT
*
FROM
cost
WHERE
cost_form = #{costForm}
ORDER BY
id DESC
SELECT *
FROM cost
WHERE cost_form = #{costForm}
ORDER BY id DESC
</select>
<select id="selectByCostFormAndStatus" resultType="com.blt.other.other_database.model.CostDomain">
SELECT
*
FROM
cost
WHERE
cost_status >= #{costStatus}
AND
cost_form = #{costForm}
ORDER BY
id DESC
SELECT *
FROM cost
WHERE cost_status >= #{costStatus}
AND cost_form = #{costForm}
ORDER BY id DESC
</select>
<select id="selectBySupCostNo" resultType="com.blt.other.other_database.model.CostDomain">
SELECT
*
FROM
cost
WHERE
sup_cost_no = #{supCostNo}
ORDER BY
id DESC
SELECT *
FROM cost
WHERE sup_cost_no = #{supCostNo}
ORDER BY id DESC
</select>
<select id="selectByKeys" resultType="com.blt.other.other_database.model.CostDomain">
......@@ -279,78 +249,63 @@
</select>
<select id="selectByKey" resultType="com.blt.other.other_database.model.CostDomain">
SELECT
*
FROM
cost
WHERE
cost_status >= #{costStatus}
AND
(
SELECT *
FROM cost
WHERE cost_status >= #{costStatus}
AND (
cost_no = #{searchKey}
OR
cost_plan_no = #{searchKey}
OR
create_username LIKE CONCAT('%',#{searchKey},'%')
create_username LIKE CONCAT('%', #{searchKey}, '%')
OR
type_name LIKE CONCAT('%',#{searchKey},'%')
type_name LIKE CONCAT('%', #{searchKey}, '%')
OR
kind_name LIKE CONCAT('%',#{searchKey},'%')
kind_name LIKE CONCAT('%', #{searchKey}, '%')
OR
company_name LIKE CONCAT('%',#{searchKey},'%')
company_name LIKE CONCAT('%', #{searchKey}, '%')
)
ORDER BY
id DESC
ORDER BY id DESC
</select>
<select id="selectByCostPlanNo" resultType="com.blt.other.other_database.model.CostDomain">
SELECT
*
FROM
cost
WHERE
cost_plan_no = #{costPlanNo}
ORDER BY
id DESC
SELECT *
FROM cost
WHERE cost_plan_no = #{costPlanNo}
ORDER BY id DESC
</select>
<select id="selectLastCost" resultType="com.blt.other.other_database.model.CostDomain">
SELECT
*
FROM
cost
ORDER BY
id DESC
SELECT *
FROM cost
ORDER BY id DESC
LIMIT 1
</select>
<select id="selectLinkLendCost" resultType="com.blt.other.other_database.model.CostDomain">
SELECT
*
FROM
cost
WHERE
cost_status = 4
AND
create_userid = #{createuserid}
AND
(
SELECT *
FROM cost
WHERE cost_status = 4
AND create_userid = #{createuserid}
AND (
lend_status = 1
OR
lend_status = 2
)
ORDER BY
id DESC
ORDER BY id DESC
</select>
<!--管理成本:查询付款单+收款单+借还单+采购单-->
<select id="selectManageCost" resultType="com.blt.other.other_cost.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,
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
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
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 c.logistics_supplier_id is null AND c.company_value =2 AND d.kind_name not in ('百伦咨询服务费','物流费')
<if test="feeSuperType != null and feeSuperType != ''">AND t.manage_cost_type = #{feeSuperType}</if>
<if test="feeSubType != null and feeSubType != ''">AND d.kind_name = #{feeSubType}</if>
......@@ -358,7 +313,7 @@
<if test="companyValueList != null and companyValueList.size() > 0">
AND c.company_value in
<foreach collection="companyValueList" item="companyValue" index="index" open="(" close=")" separator=",">
<if test="companyValue != null and companyValue != 0"> #{companyValue}</if>
<if test="companyValue != null and companyValue != 0">#{companyValue}</if>
</foreach>
</if>
<if test="companyName != null and companyName != ''">AND c.company_name = #{companyName}</if>
......@@ -367,19 +322,23 @@
<if test="startDate != null">AND c.pay_time <![CDATA[>=]]> #{startDate}</if>
<if test="endDate != null">AND c.pay_time <![CDATA[<]]>#{endDate}</if>
UNION
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,
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
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 c.logistics_supplier_id is null AND c.company_value in (1,3,5,7,8,11,46,48,50,53,59,60,61,66,69) AND d.kind_name not in ('百伦咨询服务费')
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 c.logistics_supplier_id is null AND c.company_value in (1,3,5,7,8,11,46,48,50,53,59,60,61,66,69) AND
d.kind_name not in ('百伦咨询服务费')
<if test="feeSuperType != null and feeSuperType != ''">AND t.manage_cost_type = #{feeSuperType}</if>
<if test="feeSubType != null and feeSubType != ''">AND d.kind_name = #{feeSubType}</if>
<if test="departmentName != null and departmentName != ''">AND u.departmentname1 = #{departmentName}</if>
<if test="companyValueList != null and companyValueList.size() > 0">
AND c.company_value in
<foreach collection="companyValueList" item="companyValue" index="index" open="(" close=")" separator=",">
<if test="companyValue != null and companyValue != 0"> #{companyValue}</if>
<if test="companyValue != null and companyValue != 0">#{companyValue}</if>
</foreach>
</if>
<if test="companyName != null and companyName != ''">AND c.company_name = #{companyName}</if>
......@@ -388,8 +347,10 @@
<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,
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
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
......@@ -403,7 +364,7 @@
<if test="companyValueList != null and companyValueList.size() > 0">
AND c1.company_value in
<foreach collection="companyValueList" item="companyValue" index="index" open="(" close=")" separator=",">
<if test="companyValue != null and companyValue != 0"> #{companyValue}</if>
<if test="companyValue != null and companyValue != 0">#{companyValue}</if>
</foreach>
</if>
<if test="companyName != null and companyName != ''">AND c1.company_name = #{companyName}</if>
......@@ -412,8 +373,10 @@
<if test="startDate != null">AND c1.pay_time <![CDATA[>=]]> #{startDate}</if>
<if test="endDate != null">AND c1.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,
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
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
......@@ -427,7 +390,7 @@
<if test="companyValueList != null and companyValueList.size() > 0">
AND c1.company_value in
<foreach collection="companyValueList" item="companyValue" index="index" open="(" close=")" separator=",">
<if test="companyValue != null and companyValue != 0"> #{companyValue}</if>
<if test="companyValue != null and companyValue != 0">#{companyValue}</if>
</foreach>
</if>
<if test="companyName != null and companyName != ''">AND c1.company_name = #{companyName}</if>
......@@ -436,11 +399,14 @@
<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,
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
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
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.company_value in (1,2,3,5,7,8,11,46,48,50,53,59,60,61,66,69) AND c.kind_name not in ('百伦咨询服务费')
<if test="feeSuperType != null and feeSuperType != ''">AND t.manage_cost_type = #{feeSuperType}</if>
<if test="feeSubType != null and feeSubType != ''">AND c.kind_name = #{feeSubType}</if>
......@@ -448,7 +414,7 @@
<if test="companyValueList != null and companyValueList.size() > 0">
AND c.company_value in
<foreach collection="companyValueList" item="companyValue" index="index" open="(" close=")" separator=",">
<if test="companyValue != null and companyValue != 0"> #{companyValue}</if>
<if test="companyValue != null and companyValue != 0">#{companyValue}</if>
</foreach>
</if>
<if test="companyName != null and companyName != ''">AND c.company_name = #{companyName}</if>
......@@ -457,7 +423,8 @@
<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,
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 FROM buy b
WHERE b.company_value in (1,2,3,5,7,8,11,46,48,50,53,59,60,61,66,69) AND b.sku_type_name in ('固定资产','低值易耗品')
......@@ -468,7 +435,7 @@
<if test="companyValueList != null and companyValueList.size() > 0">
AND b.company_value in
<foreach collection="companyValueList" item="companyValue" index="index" open="(" close=")" separator=",">
<if test="companyValue != null and companyValue != 0"> #{companyValue}</if>
<if test="companyValue != null and companyValue != 0">#{companyValue}</if>
</foreach>
</if>
<if test="companyName != null and companyName != ''">AND b.company = #{companyName}</if>
......@@ -490,8 +457,10 @@
<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,
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
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
......@@ -530,17 +499,44 @@
5、已完成状态的费用类型为"借款-其他应付款"、"收款-其他应付款"的还款单
-->
<select id="selectBalanceSheetCost" resultType="com.blt.other.other_database.model.CostDomain">
SELECT * FROM cost WHERE cost_form = 3 AND is_lend = 1 AND cost_status = 4 AND pay_time <![CDATA[>=]]> #{startDate} AND pay_time <![CDATA[<]]>#{endDate}
SELECT *
FROM cost
WHERE cost_form = 3
AND is_lend = 1
AND cost_status = 4
AND pay_time <![CDATA[>=]]> #{startDate}
AND pay_time <![CDATA[<]]> #{endDate}
UNION
SELECT * FROM cost WHERE cost_form = 3 AND is_lend = 2 AND cost_status = 4 AND pay_time <![CDATA[>=]]> #{startDate} AND pay_time <![CDATA[<]]>#{endDate}
SELECT *
FROM cost
WHERE cost_form = 3
AND is_lend = 2
AND cost_status = 4
AND pay_time <![CDATA[>=]]> #{startDate}
AND pay_time <![CDATA[<]]> #{endDate}
UNION
SELECT * FROM cost WHERE cost_form = 1 AND cost_status = 4 AND pay_time <![CDATA[>=]]> #{startDate} AND pay_time <![CDATA[<]]>#{endDate}
AND kind_name IN ('还款--其他应付款','借出--其他应付款')
SELECT *
FROM cost
WHERE cost_form = 1
AND cost_status = 4
AND pay_time <![CDATA[>=]]> #{startDate}
AND pay_time <![CDATA[<]]> #{endDate}
AND kind_name IN ('还款--其他应付款', '借出--其他应付款')
UNION
SELECT * FROM cost WHERE cost_form = 1 AND cost_status = 2 AND audit_time <![CDATA[>=]]> #{startDate} AND audit_time <![CDATA[<]]>#{endDate}
SELECT *
FROM cost
WHERE cost_form = 1
AND cost_status = 2
AND audit_time <![CDATA[>=]]> #{startDate}
AND audit_time <![CDATA[<]]> #{endDate}
UNION
SELECT * FROM cost WHERE cost_form = 2 AND cost_status = 4 AND pay_time <![CDATA[>=]]> #{startDate} AND pay_time <![CDATA[<]]>#{endDate}
AND kind_name IN ('借款--其他应付款','收款--其他应付款')
SELECT *
FROM cost
WHERE cost_form = 2
AND cost_status = 4
AND pay_time <![CDATA[>=]]> #{startDate}
AND pay_time <![CDATA[<]]> #{endDate}
AND kind_name IN ('借款--其他应付款', '收款--其他应付款')
</select>
<!--查询原来传输到数据中心时为待支付状态 变成 已支付状态后的费用单-->
......@@ -553,27 +549,48 @@
<select id="selectCostStatusByNo" resultType="integer">
select cost_status from cost where cost_no=#{costNo}
select cost_status
from cost
where cost_no = #{costNo}
</select>
<select id="getCostByRejectStatus" resultType="com.blt.other.other_cost.dto.CostDto">
select * from cost where cost_status = 3 and reject_type = 1 and reject_time <![CDATA[<]]> date_sub(now(),INTERVAL 1 DAY)
select *
from cost
where cost_status = 3
and reject_type = 1
and reject_time <![CDATA[<]]> date_sub(now(), INTERVAL 1 DAY)
</select>
<select id="listCostNo" resultType="java.lang.String">
select cost_no from cost where cost_form = 1 and cost_status = 4 and cashier_file_path = ''
select cost_no
from cost
where cost_form = 1
and cost_status = 4
and cashier_file_path = ''
</select>
<select id="listCostNoAll" resultType="java.lang.String">
select cost_no from cost
WHERE
id >= 0
<if test=" params.keys.costForm!=null and params.keys.costForm != ''">and cost_form= #{params.keys.costForm}</if>
<if test=" params.keys.companyNo!=null and params.keys.companyNo != ''">and company_no=#{params.keys.companyNo}</if>
<if test=" params.keys.createUsercode!=null and params.keys.createUsercode != ''">and create_usercode=#{params.keys.createUsercode}</if>
<if test=" params.keys.costForm!=null and params.keys.costForm != ''">and cost_form= #{params.keys.costForm}
</if>
<if test=" params.keys.companyNo!=null and params.keys.companyNo != ''">and
company_no=#{params.keys.companyNo}
</if>
<if test=" params.keys.createUsercode!=null and params.keys.createUsercode != ''">and
create_usercode=#{params.keys.createUsercode}
</if>
<if test=" params.keys.kindNo!=null and params.keys.kindNo != ''">and kind_no=#{params.keys.kindNo}</if>
<if test=" params.keys.costStatus!=null and params.keys.costStatus != '' and params.keys.costStatus != 10">and cost_status=#{params.keys.costStatus}</if>
<if test=" params.keys.costStatus!=null and params.keys.costStatus != '' and params.keys.costStatus == 10">and cost_status=0</if>
<if test=" params.keys.lendStatus!=null and params.keys.lendStatus != ''">and lend_status=#{params.keys.lendStatus}</if>
<if test=" params.keys.costStatus!=null and params.keys.costStatus != '' and params.keys.costStatus != 10">and
cost_status=#{params.keys.costStatus}
</if>
<if test=" params.keys.costStatus!=null and params.keys.costStatus != '' and params.keys.costStatus == 10">and
cost_status=0
</if>
<if test=" params.keys.lendStatus!=null and params.keys.lendStatus != ''">and
lend_status=#{params.keys.lendStatus}
</if>
<if test=" params.keys.isTax!=null and params.keys.isTax == 0">and is_tax=0</if>
<if test=" params.keys.isTax!=null and params.keys.isTax == 1">and is_tax=1</if>
<if test=" params.keys.isLend!=null and params.keys.isLend == 1">and is_lend=1</if>
......@@ -582,7 +599,8 @@
<if test=" params.keys.endTime != null">AND create_time <![CDATA[<=]]>#{params.keys.endTime}</if>
<if test=" params.keys.beginPayTime != null">AND pay_time <![CDATA[>=]]> #{params.keys.beginPayTime}</if>
<if test=" params.keys.endPayTime != null">AND pay_time <![CDATA[<=]]>#{params.keys.endPayTime}</if>
<if test=" params.keys.linkCost!=null and params.keys.linkCost != ''">and sup_cost_no=#{params.keys.linkCost}</if>
<if test=" params.keys.linkCost!=null and params.keys.linkCost != ''">and sup_cost_no=#{params.keys.linkCost}
</if>
<if test=" params.key!=null and params.key != ''">
and (cost_plan_no = #{params.key}
OR
......@@ -600,6 +618,9 @@
</select>
<update id="updateCashierAnnex">
update cost set cashier_file_path = #{filePath}, cashier_download_path = #{downloadUrl} where cost_no = #{costNo}
update cost
set cashier_file_path = #{filePath},
cashier_download_path = #{downloadUrl}
where cost_no = #{costNo}
</update>
</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