<?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.ruoyi.study.mapper.TUserMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.ruoyi.study.domain.TUser">
|
<id column="id" property="id" />
|
<result column="name" property="name" />
|
<result column="account" property="account" />
|
<result column="phone" property="phone" />
|
<result column="password" property="password" />
|
<result column="openId" property="openId" />
|
<result column="birthday" property="birthday" />
|
<result column="gender" property="gender" />
|
<result column="headImg" property="headImg" />
|
<result column="integral" property="integral" />
|
<result column="state" property="state" />
|
<result column="insertTime" property="insertTime" />
|
<result column="vipEndTime" property="vipEndTime" />
|
<result column="vipPayTime" property="vipPayTime" />
|
</resultMap>
|
|
<!-- 通用查询结果列 -->
|
<sql id="Base_Column_List">
|
id, name, account, phone, password, openId, birthday, gender, headImg, integral, state, insertTime, vipEndTime, vipPayTime, isBack, backTime
|
</sql>
|
<update id="updateOne">
|
update t_user
|
<set>
|
vipEndTime = #{vipEndTime},
|
vipPayTime = #{vipPayTime}
|
</set>
|
where id = #{id}
|
</update>
|
<select id="listAll" resultType="com.ruoyi.study.vo.AppUserVO">
|
select *
|
from t_user
|
where 1=1
|
<if test="req.name !=null and req.name!=''">
|
AND name LIKE concat('%',#{req.name},'%')
|
</if>
|
<if test="req.phone !=null and req.phone!=''">
|
AND phone LIKE concat('%',#{req.phone},'%')
|
</if>
|
<if test="req.state !=null ">
|
AND state = #{req.state}
|
</if>
|
<if test="req.isVip !=null and req.isVip == 0 ">
|
AND (isNull(vipEndTime) or vipEndTime <= NOW())
|
</if>
|
<if test="req.isVip !=null and req.isVip == 1 ">
|
AND (vipEndTime IS NOT NULL and vipEndTime >= NOW())
|
</if>
|
and state!=3
|
order by insertTime desc
|
</select>
|
|
</mapper>
|