jiangqs
2023-05-26 aed4e4c7d76de4d0fbfe8c0b26fcdeecbd5c5b24
ruoyi-modules/ruoyi-member/src/main/resources/mapper/member/MemberMapper.xml
@@ -26,6 +26,7 @@
        <result property="avatar"    column="avatar"    />
        <result property="bindingFlag"    column="binding_flag"    />
        <result property="goodsType"    column="goods_type"    />
        <result property="relationShopName"    column="relation_shop_name"    />
    </resultMap>
    <sql id="selectMemberVo">
@@ -57,7 +58,7 @@
        where user_id = #{userId}
    </select>
    <select id="selectMemberByUserId" parameterType="Long" resultMap="MemberResult">
    <select id="selectMemberByMobile" parameterType="Long" resultMap="MemberResult">
        <include refid="selectMemberVo"/>
        where mobile = #{mobile}
    </select>
@@ -189,4 +190,34 @@
            AND (tm.real_name LIKE CONCAT('%',#{param.keyword},'%') OR tm.mobile LIKE CONCAT('%',#{param.keyword},'%'))
        </if>
    </select>
    <select id="pageMgtMember" resultType="com.ruoyi.member.domain.vo.MgtMemberPageVo">
        SELECT
        tm.user_id userId,
        tm.relation_shop_id relationShopId,
        tm.member_no memberNo,
        tm.real_name realName,
        tm.nick_name nickName,
        tm.mobile mobile,
        CASE tm.gender WHEN 0 THEN "男" WHEN 1 THEN "女" ELSE "未知" END gender,
        (YEAR(CURRENT_DATE) - YEAR(tm.birthday)) - (RIGHT(CURRENT_DATE, 5) &lt; RIGHT(tm.birthday, 5)) age,
        tm.user_tags memberTags,
        tm.belong_district belongDistrict,
        CASE tm.binding_flag WHEN 0 THEN "否" WHEN 1 THEN "是" ELSE "否" END memberFlag,
        tm.create_time createTime,
        tmt.last_pay_time lastPayTime,
        tm.goods_type goodsType,
        tm.relation_shop_name relationShopName,
        tmt.total_integral integral,
        tm.referrer referrer,
        tm.customer_source memberFrom,
        tmt.total_pay_money totalPayMoney
        FROM t_member tm
        INNER JOIN t_member_total tmt ON tm.member_id = tmt.member_id
        WHERE del_flag = 0
        <if test="param.keyword != null and param.keyword != ''">
            AND (tm.member_no LIKE CONCAT('%',#{param.keyword},'%') OR tm.mobile LIKE CONCAT('%',#{param.keyword},'%') OR tm.real_name LIKE CONCAT('%',#{param.keyword},'%') OR tm.nick_name LIKE CONCAT('%',#{param.keyword},'%') OR FIND_IN_SET(tm.member_nurse,#{param.keyword}))
        </if>
    </select>
</mapper>