<?xml version="1.0" encoding="UTF-8" ?>
|
<!DOCTYPE mapper
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<mapper namespace="phoneBillFlowServiceDaoImpl">
|
|
<!-- 保存话费流水信息 -->
|
<insert id="savePhoneBillFlowInfo" parameterType="Map">
|
insert into phone_bill_flow(
|
id,community_id,room_id,profit_share_serial,device_number,payee,account_name,`handler`,is_transfer,
|
transferred_company,transfer_date,address,year,month,bill_cycle,last_payment_date,package_fixed_fee,
|
extra_voice_fee,comprehensive_info_fee,other_fee,payable_amount,remark1,invoiced_amount,uninvoiced_amount,
|
late_fee,subtotal,affiliated_unit,payment_date,remark2,data_entry_person,data_entry_date,
|
financial_auditor,financial_audit_date
|
) values (
|
#{id},#{communityId},#{roomId},#{profitShareSerial},#{deviceNumber},#{payee},#{accountName},#{handler},#{isTransfer},
|
#{transferredCompany},#{transferDate},#{address},#{year},#{month},#{billCycle},#{lastPaymentDate},#{packageFixedFee},
|
#{extraVoiceFee},#{comprehensiveInfoFee},#{otherFee},#{payableAmount},#{remark1},#{invoicedAmount},#{uninvoicedAmount},
|
#{lateFee},#{subtotal},#{affiliatedUnit},#{paymentDate},#{remark2},#{dataEntryPerson},#{dataEntryDate},
|
#{financialAuditor},#{financialAuditDate}
|
)
|
</insert>
|
|
<!-- 查询话费流水信息 -->
|
<select id="getPhoneBillFlowInfo" parameterType="Map" resultType="Map">
|
select t.id,
|
t.community_id communityId,t.room_id roomId,t.profit_share_serial profitShareSerial,
|
t.device_number deviceNumber,t.payee payee,t.account_name accountName,t.`handler` handler,
|
t.is_transfer isTransfer,t.transferred_company transferredCompany,t.transfer_date transferDate,
|
t.address address,t.year year,t.month month,t.bill_cycle billCycle,t.last_payment_date lastPaymentDate,
|
t.package_fixed_fee packageFixedFee,t.extra_voice_fee extraVoiceFee,t.comprehensive_info_fee comprehensiveInfoFee,
|
t.other_fee otherFee,t.payable_amount payableAmount,t.remark1 remark1,t.invoiced_amount invoicedAmount,
|
t.uninvoiced_amount uninvoicedAmount,t.late_fee lateFee,t.subtotal subtotal,t.affiliated_unit affiliatedUnit,
|
t.payment_date paymentDate,t.remark2 remark2,t.data_entry_person dataEntryPerson,t.data_entry_date dataEntryDate,
|
t.financial_auditor financialAuditor,t.financial_audit_date financialAuditDate,br.room_num as roomNum, bu.unit_num as unitNum,bf.floor_num as floorNum, br.road_name as roadName
|
from phone_bill_flow t
|
inner join building_room br on br.room_id = t.room_id
|
left join building_unit bu on bu.unit_id = br.unit_id
|
left join f_floor bf on bf.floor_id = bu.floor_id
|
where 1 =1
|
<if test="id !=null and id != ''">
|
and t.id= #{id}
|
</if>
|
<if test="communityId !=null and communityId != ''">
|
and t.community_id= #{communityId}
|
</if>
|
<if test="roomId !=null and roomId != ''">
|
and t.room_id= #{roomId}
|
</if>
|
<if test="profitShareSerial !=null and profitShareSerial != ''">
|
and t.profit_share_serial= #{profitShareSerial}
|
</if>
|
<if test="deviceNumber !=null and deviceNumber != ''">
|
and t.device_number= #{deviceNumber}
|
</if>
|
<if test="payee !=null and payee != ''">
|
and t.payee= #{payee}
|
</if>
|
<if test="accountName !=null and accountName != ''">
|
and t.account_name= #{accountName}
|
</if>
|
<if test="handler !=null and handler != ''">
|
and t.`handler`= #{handler}
|
</if>
|
<if test="isTransfer !=null and isTransfer != ''">
|
and t.is_transfer= #{isTransfer}
|
</if>
|
<if test="transferredCompany !=null and transferredCompany != ''">
|
and t.transferred_company= #{transferredCompany}
|
</if>
|
<if test="transferDate !=null and transferDate != ''">
|
and t.transfer_date= #{transferDate}
|
</if>
|
<if test="address !=null and address != ''">
|
and t.address= #{address}
|
</if>
|
<if test="year !=null and year != ''">
|
and t.year= #{year}
|
</if>
|
<if test="month !=null and month != ''">
|
and t.month= #{month}
|
</if>
|
<if test="billCycle !=null and billCycle != ''">
|
and t.bill_cycle= #{billCycle}
|
</if>
|
<if test="lastPaymentDate !=null and lastPaymentDate != ''">
|
and t.last_payment_date= #{lastPaymentDate}
|
</if>
|
<if test="packageFixedFee !=null and packageFixedFee != ''">
|
and t.package_fixed_fee= #{packageFixedFee}
|
</if>
|
<if test="extraVoiceFee !=null and extraVoiceFee != ''">
|
and t.extra_voice_fee= #{extraVoiceFee}
|
</if>
|
<if test="comprehensiveInfoFee !=null and comprehensiveInfoFee != ''">
|
and t.comprehensive_info_fee= #{comprehensiveInfoFee}
|
</if>
|
<if test="otherFee !=null and otherFee != ''">
|
and t.other_fee= #{otherFee}
|
</if>
|
<if test="payableAmount !=null and payableAmount != ''">
|
and t.payable_amount= #{payableAmount}
|
</if>
|
<if test="remark1 !=null and remark1 != ''">
|
and t.remark1= #{remark1}
|
</if>
|
<if test="invoicedAmount !=null and invoicedAmount != ''">
|
and t.invoiced_amount= #{invoicedAmount}
|
</if>
|
<if test="uninvoicedAmount !=null and uninvoicedAmount != ''">
|
and t.uninvoiced_amount= #{uninvoicedAmount}
|
</if>
|
<if test="lateFee !=null and lateFee != ''">
|
and t.late_fee= #{lateFee}
|
</if>
|
<if test="subtotal !=null and subtotal != ''">
|
and t.subtotal= #{subtotal}
|
</if>
|
<if test="affiliatedUnit !=null and affiliatedUnit != ''">
|
and t.affiliated_unit= #{affiliatedUnit}
|
</if>
|
<if test="paymentDate !=null and paymentDate != ''">
|
and t.payment_date= #{paymentDate}
|
</if>
|
<if test="remark2 !=null and remark2 != ''">
|
and t.remark2= #{remark2}
|
</if>
|
<if test="dataEntryPerson !=null and dataEntryPerson != ''">
|
and t.data_entry_person= #{dataEntryPerson}
|
</if>
|
<if test="dataEntryDate !=null and dataEntryDate != ''">
|
and t.data_entry_date= #{dataEntryDate}
|
</if>
|
<if test="financialAuditor !=null and financialAuditor != ''">
|
and t.financial_auditor= #{financialAuditor}
|
</if>
|
<if test="financialAuditDate !=null and financialAuditDate != ''">
|
and t.financial_audit_date= #{financialAuditDate}
|
</if>
|
order by t.data_entry_date desc
|
<if test="page != -1 and page != null ">
|
limit #{page}, #{row}
|
</if>
|
</select>
|
|
<!-- 修改话费流水信息 -->
|
<update id="updatePhoneBillFlowInfo" parameterType="Map">
|
update phone_bill_flow t
|
<if test="communityId !=null and communityId != ''">
|
,t.community_id= #{communityId}
|
</if>
|
<if test="roomId !=null and roomId != ''">
|
,t.room_id= #{roomId}
|
</if>
|
<if test="profitShareSerial !=null and profitShareSerial != ''">
|
,t.profit_share_serial= #{profitShareSerial}
|
</if>
|
<if test="deviceNumber !=null and deviceNumber != ''">
|
,t.device_number= #{deviceNumber}
|
</if>
|
<if test="payee !=null and payee != ''">
|
,t.payee= #{payee}
|
</if>
|
<if test="accountName !=null and accountName != ''">
|
,t.account_name= #{accountName}
|
</if>
|
<if test="handler !=null and handler != ''">
|
,t.`handler`= #{handler}
|
</if>
|
<if test="isTransfer !=null and isTransfer != ''">
|
,t.is_transfer= #{isTransfer}
|
</if>
|
<if test="transferredCompany !=null and transferredCompany != ''">
|
,t.transferred_company= #{transferredCompany}
|
</if>
|
<if test="transferDate !=null and transferDate != ''">
|
,t.transfer_date= #{transferDate}
|
</if>
|
<if test="address !=null and address != ''">
|
,t.address= #{address}
|
</if>
|
<if test="year !=null and year != ''">
|
,t.year= #{year}
|
</if>
|
<if test="month !=null and month != ''">
|
,t.month= #{month}
|
</if>
|
<if test="billCycle !=null and billCycle != ''">
|
,t.bill_cycle= #{billCycle}
|
</if>
|
<if test="lastPaymentDate !=null and lastPaymentDate != ''">
|
,t.last_payment_date= #{lastPaymentDate}
|
</if>
|
<if test="packageFixedFee !=null and packageFixedFee != ''">
|
,t.package_fixed_fee= #{packageFixedFee}
|
</if>
|
<if test="extraVoiceFee !=null and extraVoiceFee != ''">
|
,t.extra_voice_fee= #{extraVoiceFee}
|
</if>
|
<if test="comprehensiveInfoFee !=null and comprehensiveInfoFee != ''">
|
,t.comprehensive_info_fee= #{comprehensiveInfoFee}
|
</if>
|
<if test="otherFee !=null and otherFee != ''">
|
,t.other_fee= #{otherFee}
|
</if>
|
<if test="payableAmount !=null and payableAmount != ''">
|
,t.payable_amount= #{payableAmount}
|
</if>
|
<if test="remark1 !=null and remark1 != ''">
|
,t.remark1= #{remark1}
|
</if>
|
<if test="invoicedAmount !=null and invoicedAmount != ''">
|
,t.invoiced_amount= #{invoicedAmount}
|
</if>
|
<if test="uninvoicedAmount !=null and uninvoicedAmount != ''">
|
,t.uninvoiced_amount= #{uninvoicedAmount}
|
</if>
|
<if test="lateFee !=null and lateFee != ''">
|
,t.late_fee= #{lateFee}
|
</if>
|
<if test="subtotal !=null and subtotal != ''">
|
,t.subtotal= #{subtotal}
|
</if>
|
<if test="affiliatedUnit !=null and affiliatedUnit != ''">
|
,t.affiliated_unit= #{affiliatedUnit}
|
</if>
|
<if test="paymentDate !=null and paymentDate != ''">
|
,t.payment_date= #{paymentDate}
|
</if>
|
<if test="remark2 !=null and remark2 != ''">
|
,t.remark2= #{remark2}
|
</if>
|
<if test="dataEntryPerson !=null and dataEntryPerson != ''">
|
,t.data_entry_person= #{dataEntryPerson}
|
</if>
|
<if test="dataEntryDate !=null and dataEntryDate != ''">
|
,t.data_entry_date= #{dataEntryDate}
|
</if>
|
<if test="financialAuditor !=null and financialAuditor != ''">
|
,t.financial_auditor= #{financialAuditor}
|
</if>
|
<if test="financialAuditDate !=null and financialAuditDate != ''">
|
,t.financial_audit_date= #{financialAuditDate}
|
</if>
|
where 1=1
|
<if test="id !=null and id != ''">
|
and t.id= #{id}
|
</if>
|
</update>
|
|
<!-- 查询话费流水数量 -->
|
<select id="queryPhoneBillFlowsCount" parameterType="Map" resultType="Map">
|
select count(1) count
|
from phone_bill_flow t
|
where 1 = 1
|
<if test="id !=null and id != ''">
|
and t.id= #{id}
|
</if>
|
<if test="communityId !=null and communityId != ''">
|
and t.community_id= #{communityId}
|
</if>
|
<if test="roomId !=null and roomId != ''">
|
and t.room_id= #{roomId}
|
</if>
|
<if test="profitShareSerial !=null and profitShareSerial != ''">
|
and t.profit_share_serial= #{profitShareSerial}
|
</if>
|
<if test="deviceNumber !=null and deviceNumber != ''">
|
and t.device_number= #{deviceNumber}
|
</if>
|
<if test="payee !=null and payee != ''">
|
and t.payee= #{payee}
|
</if>
|
<if test="accountName !=null and accountName != ''">
|
and t.account_name= #{accountName}
|
</if>
|
<if test="handler !=null and handler != ''">
|
and t.`handler`= #{handler}
|
</if>
|
<if test="isTransfer !=null and isTransfer != ''">
|
and t.is_transfer= #{isTransfer}
|
</if>
|
<if test="transferredCompany !=null and transferredCompany != ''">
|
and t.transferred_company= #{transferredCompany}
|
</if>
|
<if test="transferDate !=null and transferDate != ''">
|
and t.transfer_date= #{transferDate}
|
</if>
|
<if test="address !=null and address != ''">
|
and t.address= #{address}
|
</if>
|
<if test="year !=null and year != ''">
|
and t.year= #{year}
|
</if>
|
<if test="month !=null and month != ''">
|
and t.month= #{month}
|
</if>
|
<if test="billCycle !=null and billCycle != ''">
|
and t.bill_cycle= #{billCycle}
|
</if>
|
<if test="lastPaymentDate !=null and lastPaymentDate != ''">
|
and t.last_payment_date= #{lastPaymentDate}
|
</if>
|
<if test="packageFixedFee !=null and packageFixedFee != ''">
|
and t.package_fixed_fee= #{packageFixedFee}
|
</if>
|
<if test="extraVoiceFee !=null and extraVoiceFee != ''">
|
and t.extra_voice_fee= #{extraVoiceFee}
|
</if>
|
<if test="comprehensiveInfoFee !=null and comprehensiveInfoFee != ''">
|
and t.comprehensive_info_fee= #{comprehensiveInfoFee}
|
</if>
|
<if test="otherFee !=null and otherFee != ''">
|
and t.other_fee= #{otherFee}
|
</if>
|
<if test="payableAmount !=null and payableAmount != ''">
|
and t.payable_amount= #{payableAmount}
|
</if>
|
<if test="remark1 !=null and remark1 != ''">
|
and t.remark1= #{remark1}
|
</if>
|
<if test="invoicedAmount !=null and invoicedAmount != ''">
|
and t.invoiced_amount= #{invoicedAmount}
|
</if>
|
<if test="uninvoicedAmount !=null and uninvoicedAmount != ''">
|
and t.uninvoiced_amount= #{uninvoicedAmount}
|
</if>
|
<if test="lateFee !=null and lateFee != ''">
|
and t.late_fee= #{lateFee}
|
</if>
|
<if test="subtotal !=null and subtotal != ''">
|
and t.subtotal= #{subtotal}
|
</if>
|
<if test="affiliatedUnit !=null and affiliatedUnit != ''">
|
and t.affiliated_unit= #{affiliatedUnit}
|
</if>
|
<if test="paymentDate !=null and paymentDate != ''">
|
and t.payment_date= #{paymentDate}
|
</if>
|
<if test="remark2 !=null and remark2 != ''">
|
and t.remark2= #{remark2}
|
</if>
|
<if test="dataEntryPerson !=null and dataEntryPerson != ''">
|
and t.data_entry_person= #{dataEntryPerson}
|
</if>
|
<if test="dataEntryDate !=null and dataEntryDate != ''">
|
and t.data_entry_date= #{dataEntryDate}
|
</if>
|
<if test="financialAuditor !=null and financialAuditor != ''">
|
and t.financial_auditor= #{financialAuditor}
|
</if>
|
<if test="financialAuditDate !=null and financialAuditDate != ''">
|
and t.financial_audit_date= #{financialAuditDate}
|
</if>
|
</select>
|
|
<!-- 批量插入话费流水信息 -->
|
<insert id="insertPhoneBillFlows" parameterType="Map">
|
insert into phone_bill_flow
|
(id,community_id,room_id,profit_share_serial,device_number,payee,account_name,`handler`,is_transfer,
|
transferred_company,transfer_date,address,year,month,bill_cycle,last_payment_date,package_fixed_fee,
|
extra_voice_fee,comprehensive_info_fee,other_fee,payable_amount,remark1,invoiced_amount,uninvoiced_amount,
|
late_fee,subtotal,affiliated_unit,payment_date,remark2,data_entry_person,data_entry_date,
|
financial_auditor,financial_audit_date)
|
VALUES
|
<foreach collection="phoneBillFlowList" item="item" separator=",">
|
(#{item.id},#{item.communityId},#{item.roomId},#{item.profitShareSerial},#{item.deviceNumber},#{item.payee},
|
#{item.accountName},#{item.handler},#{item.isTransfer},#{item.transferredCompany},#{item.transferDate},
|
#{item.address},#{item.year},#{item.month},#{item.billCycle},#{item.lastPaymentDate},#{item.packageFixedFee},
|
#{item.extraVoiceFee},#{item.comprehensiveInfoFee},#{item.otherFee},#{item.payableAmount},#{item.remark1},
|
#{item.invoicedAmount},#{item.uninvoicedAmount},#{item.lateFee},#{item.subtotal},#{item.affiliatedUnit},
|
#{item.paymentDate},#{item.remark2},#{item.dataEntryPerson},#{item.dataEntryDate},#{item.financialAuditor},
|
#{item.financialAuditDate})
|
</foreach>
|
</insert>
|
|
</mapper>
|