mybatisflex分页修改

This commit is contained in:
张松
2025-02-18 09:46:16 +08:00
parent 33930a96e8
commit 28b5a7d2d4
3 changed files with 26 additions and 14 deletions

View File

@@ -19,17 +19,7 @@
and amount - #{money} >= 0
</update>
<select id="selectPageByKeyAndIsVip" resultType="com.czg.account.entity.ShopUser">
select a.* from tb_user_info as a
left join tb_shop_user as b on a.id=b.user_id
where b.shop_id=#{shopId}
<if test="key != null and key != ''">
and (a.nick_name like %#{key}% or a.phone like %#{key}%)
</if>
<if test="isVip != null">
and b.is_vip=#{isVip}
</if>
</select>
<select id="selectUserSummary" resultType="com.czg.account.dto.shopuser.ShopUserSummaryDTO">
select count(a.id) userTotal, sum(IFNULL(a.amount, 0)) balanceTotal,sum(IFNULL(b.amount,0)) chargeTotal from
tb_shop_user as a
@@ -53,4 +43,12 @@
left join tb_shop_activate_in_record as c on c.shop_id = b.shop_id
where a.id=#{userId}
</select>
<select id="selectPageByKeyAndIsVip" resultType="com.czg.account.entity.ShopUser">
select tb_user_info.* from tb_user_info
left join tb_shop_user on tb_user_info.id=tb_shop_user.user_id ${qwSql} limit ${pageOffset}, ${pageSize}
</select>
<select id="selectPageByKeyAndIsVip_COUNT" resultType="java.lang.Long">
select count(1) from tb_user_info
left join tb_shop_user on tb_user_info.id=tb_shop_user.user_id ${qwSql}
</select>
</mapper>