Commit 5aec7ec4 by huluobin

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

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