Commit 2a99e04d authored by chase's avatar chase

fix bug

parent a3b88a86
......@@ -342,17 +342,15 @@ public class ReportServiceImpl extends BaseService {
andStartDateLessThanOrEqualTo(queryDate).andEndDateGreaterThanOrEqualTo(queryDate).
andStatusEqualTo(0);
List<RevenueTypeMapping> mappingList = revenueTypeMappingMapper.selectByExample(mappingExample);
//先清除数据
InvoiceRecord delRecord = new InvoiceRecord();
delRecord.setRevenueCofId(null);
if(!isMergeManualData){
delRecord.setModifyRevenueCofId(null);
}
InvoiceRecordExample delExample = new InvoiceRecordExample();
delExample.createCriteria().andProjectIdEqualTo(projectId)
.andProjectIdEqualTo(projectId).
delExample.createCriteria().andProjectIdEqualTo(projectId).
andPeriodEqualTo(Integer.valueOf(queryDate.replace("-", "")));
invoiceRecordMapper.deleteByExample(delExample);
if(isMergeManualData){
invoiceRecordMapper.clearRevenueCof(true,false,delExample);
}else{
invoiceRecordMapper.clearRevenueCof(true,true,delExample);
}
Map<String, Long> map = new HashMap<>();
for (RevenueTypeMapping mapping : mappingList) {
if (!map.containsKey(mapping.getContent())) {
......
......@@ -129,4 +129,6 @@ public interface InvoiceRecordMapper extends MyVatMapper {
List<String> queryBillTypeGroupBy(@Param("projectId") String projectId,
@Param("period") Integer period);
int clearRevenueCof(@Param("clearRevenue") boolean clearRevenue, @Param("clearModifyRevenue") boolean clearModifyRevenue,@Param("example") InvoiceRecordExample example);
}
\ No newline at end of file
......@@ -15,15 +15,17 @@
</if>
</sql>
<select id="selectByCondition" parameterType="pwc.taxtech.atms.vat.dpo.InvoiceRecordCondition" resultMap="BaseResultMap">
<select id="selectByCondition" parameterType="pwc.taxtech.atms.vat.dpo.InvoiceRecordCondition"
resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
<include refid="Base_Column_List"/>
from invoice_record
where
<include refid="QueryCondition"/>
</select>
<select id="selectCountByCondition" parameterType="pwc.taxtech.atms.vat.dpo.InvoiceRecordCondition" resultType="Integer">
<select id="selectCountByCondition" parameterType="pwc.taxtech.atms.vat.dpo.InvoiceRecordCondition"
resultType="Integer">
select
count(*)
from invoice_record
......@@ -135,7 +137,8 @@
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.customerCompanyTaxNum != null">#{item.customerCompanyTaxNum,jdbcType=VARCHAR},</when>
<when test="item.customerCompanyTaxNum != null">#{item.customerCompanyTaxNum,jdbcType=VARCHAR},
</when>
<otherwise>'',</otherwise>
</choose>
<choose>
......@@ -167,7 +170,8 @@
<otherwise>CURRENT_TIMESTAMP,</otherwise>
</choose>
</trim>
</foreach>;
</foreach>
;
SELECT 1 FROM DUAL;
</insert>
......@@ -210,7 +214,8 @@
and bd.invoice_num like concat('%',#{billNumber},'%')
</if>
<if test="revenueCofId != null">
and if(bd.modify_revenue_cof_id is null,bd.revenue_cof_id = #{revenueCofId},bd.modify_revenue_cof_id = #{revenueCofId})
and if(bd.modify_revenue_cof_id is null,bd.revenue_cof_id = #{revenueCofId},bd.modify_revenue_cof_id =
#{revenueCofId})
</if>
<if test="billContent != null and billContent != ''">
and bd.billing_content like concat('%',#{billContent},'%')
......@@ -238,4 +243,18 @@
group by invoice_type;
</select>
<update id="clearRevenueCof">
update invoice_record
<set>
<if test="clearRevenue">
revenue_cof_id = null,
</if>
<if test="clearModifyRevenue">
modify_revenue_cof_id = null,
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
</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