5 changed files with 81 additions and 2 deletions
@ -0,0 +1,49 @@ |
|||||
|
package com.qs.serve.modules.tbs.mapper; |
||||
|
|
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
import org.apache.ibatis.annotations.Select; |
||||
|
import org.apache.ibatis.annotations.Update; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 维护拓展状态Mapper |
||||
|
* @author YenHex |
||||
|
* @since 2023/11/24 |
||||
|
* -- * 不参与业务流程,核销状态: |
||||
|
* -- * 有这四个状态: |
||||
|
* -- * 0-未核销:代表这案子里面的所有活动都还未开始核销; |
||||
|
* -- * 1-已通过:代表这个案子的所有活动都已经核销完成; |
||||
|
* -- * 2-核销中:代表这个案子的某些活动在核销中; |
||||
|
* -- * 3-被拒绝;代表这个案子里面的所有活动金额都被释放了 |
||||
|
* -- * 4-部分核销,部分已核销,还有未完成部分 |
||||
|
*/ |
||||
|
public interface TbsCostCheckStateMapper { |
||||
|
|
||||
|
@Update("update tbs_cost_apply set check_state = 0 where charge_state is null ") |
||||
|
int updateCheckState0(); |
||||
|
|
||||
|
@Update("update tbs_cost_apply set check_state = 1 where charge_state = 3 ") |
||||
|
int updateCheckState1(); |
||||
|
|
||||
|
@Update("update tbs_cost_apply set check_state = 2 where id in ( " + |
||||
|
" SELECT cost_apply_id from vtb_verification where verification_state = 0 and del_flag = 0 " + |
||||
|
")") |
||||
|
int updateCheckState2(); |
||||
|
|
||||
|
@Select("select cost_apply_id " + |
||||
|
" from tbs_activity " + |
||||
|
" group by cost_apply_id " + |
||||
|
" HAVING count(total_amount) = sum(release_amount) ") |
||||
|
List<Long> selectCheckState3(); |
||||
|
|
||||
|
@Update("<script>" + |
||||
|
"update tbs_cost_apply set check_state = 3 where id in " + |
||||
|
"<foreach collection='costIds' item='selectId' open='(' separator=',' close=')'> " + |
||||
|
"#{selectId}" + |
||||
|
"</foreach>" + |
||||
|
"</script>") |
||||
|
int updateCheckState3(@Param("costIds") List<Long> costIds); |
||||
|
|
||||
|
@Update("update tbs_cost_apply set check_state = 4 where charge_state = 2 and total_activity_used_amount > 0") |
||||
|
int updateCheckState4(); |
||||
|
} |
Loading…
Reference in new issue