根据userId获取vip详细信息

This commit is contained in:
曹磊 2024-06-12 19:40:43 +08:00
parent 878e111867
commit 4f60a1a043
2 changed files with 24 additions and 0 deletions

View File

@ -6,4 +6,7 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper @Mapper
public interface VipDetailsDao extends BaseMapper<VipDetails> { public interface VipDetailsDao extends BaseMapper<VipDetails> {
VipDetails getVipDetailByUser(Long userId);
} }

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.sqx.modules.app.dao.VipDetailsDao">
<select id="getVipDetailByUser" resultType="com.sqx.modules.app.entity.VipDetails">
SELECT a.id,
a.vip_name_type,
a.money,
a.vip_name,
a.rate,
a.award,
a.vip_type,
b.user_id
FROM vip_details a
JOIN user_vip b ON a.vip_name_type = b.vip_name_type
WHERE b.user_id = #{userId}
AND a.vip_type = 0
LIMIT 1
</select>
</mapper>