123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?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.miaxis.user.mapper.UserInfoMapper">
- <resultMap type="UserInfo" id="UserInfoResult">
- <result property="id" column="id" />
- <result property="phone" column="phone" />
- <result property="wechar" column="wechar" />
- <result property="headImage" column="head_image" />
- <result property="nickName" column="nick_name" />
- <result property="openid" column="openid" />
- <result property="createTime" column="create_time" />
- <result property="updateTime" column="update_time" />
- <result property="status" column="status" />
- <result property="isVip" column="is_vip" />
- <result property="unionId" column="union_id" />
- </resultMap>
- <sql id="selectUserInfoVo">
- select * from user_info
- </sql>
- <select id="selectUserInfoList" parameterType="UserInfo" resultMap="UserInfoResult">
- <include refid="selectUserInfoVo"/>
- <where>
- <if test="phone != null and phone != ''"> and phone = #{phone}</if>
- <if test="wechar != null and wechar != ''"> and wechar = #{wechar}</if>
- <if test="headImage != null and headImage != ''"> and head_image = #{headImage}</if>
- <if test="nickName != null and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
- <if test="openid != null and openid != ''"> and openid = #{openid}</if>
- <if test="status != null "> and status = #{status}</if>
- <if test="isVip != null "> and is_vip = #{isVip}</if>
- <if test="unionId != null and unionId != ''"> and union_id = #{unionId}</if>
- </where>
- </select>
- <select id="selectUserByParentOpenid" resultType="com.miaxis.common.core.domain.entity.UserInfo">
- SELECT
- u.openid,
- u.nick_name,
- u.head_image,
- u.create_time
- FROM
- user_info u
- LEFT JOIN wx_spread_relation sr ON sr.openid = u.openid
- WHERE sr.parent_openid = #{openid}
- ORDER BY u.create_time desc
- </select>
- <select id="selectUserByList" resultType="com.miaxis.common.core.domain.entity.UserInfo">
- SELECT
- u.openid,
- u.nick_name,
- u.head_image,
- u.create_time
- FROM
- user_info u
- WHERE u.openid in
- <foreach collection="list" item="openid" open="(" separator="," close=")">
- #{openid}
- </foreach>
- ORDER BY u.create_time desc
- </select>
- </mapper>
|