@@ -8,4 +8,6 @@ import org.apache.ibatis.annotations.Param;
@Mapper
public interface DeletionTypeStatisticsMapper extends BaseMapper<DeletionTypeStatisticsDO> {
DeletionTypeStatisticsDO getDeletionTypeStatistics(@Param("fundId") String fundId, @Param("deletionType")Integer deletionType,@Param("channelId")Integer channelId);
+
+ void truncateTable();
}
@@ -15,6 +15,9 @@
<result column="updaterid" property="updaterId"/>
<result column="updatetime" property="updateTime"/>
</resultMap>
+ <delete id="truncateTable">
+ truncate table ppw_email.deletion_type_statistics
+ </delete>
<select id="getDeletionTypeStatistics" resultMap="StatisticsResultMap">
select id,fund_id,deletion_type,channel_id,last_deletion_date,deletion_num,processed_num,creatorid,isvalid,createtime,updaterid,updatetime
from ppw_email.deletion_type_statistics where isvalid=1 and fund_id=#{fundId} and deletion_type=#{deletionType} and channel_id=#{channelId}
@@ -227,6 +227,7 @@ public class DeletionServiceImpl implements DeletionService {
@Override
public void computeDeletionTypeNum(List<FundDeletionTypeDO> fundDeletionTypeList) {
+ deletionTypeStatisticsMapper.truncateTable();
for (FundDeletionTypeDO fundDeletionType : fundDeletionTypeList) {
String fundId = fundDeletionType.getFundId();
Integer deletionType = fundDeletionType.getDeletionType();