111
rk
2025-08-28 99e92a155a1b21a8386b482e7aab6fef649aeffa
server/services/src/main/java/com/doumee/dao/business/MemberMapper.java
@@ -2,11 +2,28 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.doumee.dao.business.model.Member;
import com.github.yulichang.base.MPJBaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.math.BigDecimal;
import java.util.List;
/**
 * @author 江蹄蹄
 * @date 2025/07/09 12:00
 */
public interface MemberMapper extends BaseMapper<Member> {
public interface MemberMapper extends MPJBaseMapper<Member> {
    @Select(" select * , " +
            " ifnull((select r.level from receive_weight r where r.RECEIVE_MAX > RECEIVE_NUM and RECEIVE_NUM > r.RECEIVE_MIN limit 1  ),0) as level ," +
            "  ifnull( (select CONVERT( ST_Distance_Sphere ( POINT ( ii.lgt, ii.lat ), POINT ( #{lgt}, #{lat}  )) /1000,DECIMAL(15,2)) from identity_info ii where ii.AUDIT_STATUS = 2 and type = 0 and ii.member_id = ID limit  1 ),0) as distance " +
            " from member  " +
            " where  id in (   " +
            "  select ii.member_id from identity_info ii where ii.AUDIT_STATUS = 2 and type = #{orderType}  " +
            "  and ( CONVERT( ST_Distance_Sphere ( POINT ( ii.lgt, ii.lat ), POINT ( #{lgt}, #{lat} )) /1000,DECIMAL(15,2))) < 100 " +
            "  )" +
            " order by level , score desc , distance asc  ")
    List<Member> getList(@Param("lgt") BigDecimal lgt, @Param("lat") BigDecimal lat, @Param("orderType") Integer orderType);
}