shinnosuke
2026-08-06 79ae06e6b4172d90df77b0e49ad3ab12ba63cd45
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package com.talentcard.server.mapper;
 
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.talentcard.server.entity.DependentCardApply;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
 
@Mapper
public interface DependentCardApplyMapper extends BaseMapper<DependentCardApply> {
 
    @Select("""
            select c.id as talentCardId, c.talent_id as talentId, c.card_no as talentCardNo,
                   c.card_level as cardLevel, c.is_family_card_enabled as isFamilyCardEnabled,
                   c.family_card_limit as familyCardLimit, u.name as talentName, u.mobile as talentMobile
            from talent_card c
            join talent_user u on u.id = c.talent_id and u.deleted = 0
            where c.id = #{talentCardId}
              and c.deleted = 0
              and c.card_type = 'PERSONAL'
              and c.status = 1
            limit 1
            for update
            """)
    DependentCardApply selectOwnerCard(@Param("talentCardId") Long talentCardId);
 
    @Select("""
            select *
            from dependent_card_apply
            where id = #{id} and deleted = 0
            limit 1
            for update
            """)
    DependentCardApply selectByIdForUpdate(@Param("id") Long id);
}