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 { @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); }