|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253 |
- <?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.iformall.mapper.TtBuserMapper">
- <resultMap id="BaseResultMap" type="com.iformall.domain.po.TtBuser">
- <id column="id" jdbcType="BIGINT" property="id"/>
- <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
- <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/>
- <result column="open_id" jdbcType="VARCHAR" property="openId"/>
- <result column="union_id" jdbcType="VARCHAR" property="unionId"/>
- <result column="nick_name" jdbcType="VARCHAR" property="nickName"/>
- <result column="gender" jdbcType="INTEGER" property="gender"/>
- <result column="avatar_url" jdbcType="VARCHAR" property="avatarUrl"/>
- <result column="phone" jdbcType="VARCHAR" property="phone"/>
- <result column="pure_phone" jdbcType="VARCHAR" property="purePhone"/>
- <result column="city" jdbcType="VARCHAR" property="city"/>
- <result column="province" jdbcType="VARCHAR" property="province"/>
- <result column="language" jdbcType="VARCHAR" property="language"/>
- <result column="country_code" jdbcType="VARCHAR" property="countryCode"/>
- <result column="register_ip" jdbcType="VARCHAR" property="registerIp"/>
- <result column="verify_code_phone" jdbcType="VARCHAR" property="verifyCodePhone"/>
- <result column="qrcode_source" jdbcType="VARCHAR" property="qrcodeSource"/>
- <result column="scene" jdbcType="VARCHAR" property="scene"/>
- <result column="scene_address" jdbcType="VARCHAR" property="sceneAddress"/>
- <result column="session_key" jdbcType="VARCHAR" property="sessionKey"/>
- <result column="score" jdbcType="INTEGER" property="score"/>
- <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
- <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
- <result column="app_id" jdbcType="VARCHAR" property="appId"/>
- <result column="token" jdbcType="VARCHAR" property="token"/>
- <result column="expire_time" jdbcType="TIMESTAMP" property="expireTime"/>
- <result column="latitude" jdbcType="DECIMAL" property="latitude"/>
- <result column="longitude" jdbcType="DECIMAL" property="longitude"/>
- <result column="login_count" jdbcType="INTEGER" property="loginCount"/>
- <result column="extra_info" jdbcType="VARCHAR" property="extraInfo"/>
- <result column="is_subscribe" jdbcType="TINYINT" property="isSubscribe"/>
- <result column="open_app_id" jdbcType="VARCHAR" property="openAppId"/>
- <result column="mp_open_id" jdbcType="VARCHAR" property="mpOpenId"/>
- <result column="mp_app_id" jdbcType="VARCHAR" property="mpAppId"/>
- <result column="mp_subscribe" jdbcType="TINYINT" property="mpSubscribe"/>
- <result column="mp_subscribe_time" jdbcType="TIMESTAMP" property="mpSubscribeTime"/>
- <result column="mp_subscribe_scene" jdbcType="VARCHAR" property="mpSubscribeScene"/>
- <result column="subs_open_id" jdbcType="VARCHAR" property="subsOpenId"/>
- <result column="subs_app_id" jdbcType="VARCHAR" property="subsAppId"/>
- <result column="subs_subscribe" jdbcType="TINYINT" property="subsSubscribe"/>
- <result column="subs_subscribe_time" jdbcType="TIMESTAMP" property="subsSubscribeTime"/>
- <result column="subs_subscribe_scene" jdbcType="VARCHAR" property="subsSubscribeScene"/>
- <result column="credit" jdbcType="INTEGER" property="credit"/>
- <result column="active_time" jdbcType="TIMESTAMP" property="activeTime"/>
- <result column="qr_code" jdbcType="VARCHAR" property="qrCode"/>
- <result column="user_id" jdbcType="BIGINT" property="userId"/>
-
- </resultMap>
-
- <sql id="allColumns">
- `id`,`tenant_id`,`parent_tenant_id`,`open_id`,`union_id`,`nick_name`,`gender`,`avatar_url`,`phone`,`pure_phone`,
- `city`,`province`,`language`,`country_code`,`register_ip`,`verify_code_phone`,
- `qrcode_source`,`scene`,`scene_address`,`session_key`,`score`,
- `update_date`,`create_date`,`app_id`,`token`,`expire_time`,`latitude`, `longitude`,
- `login_count`, `extra_info`, `is_subscribe`,`open_app_id`,`user_id`,
- `mp_open_id`,`mp_app_id`,`mp_subscribe`,`mp_subscribe_time`,`mp_subscribe_scene`,
- `subs_open_id`,`subs_app_id`,`subs_subscribe`,`subs_subscribe_time`,`subs_subscribe_scene`,`credit`,`active_time`,`qr_code`
- </sql>
-
- <sql id="dynamicWhereConditions">
- where 1 = 1
-
- <if test=" null != id ">
- and `id` = #{id}
- </if>
-
- <if test=" null != tenantId and '' != tenantId">
- and `tenant_id` = #{tenantId}
- </if>
- <if test=" null != parentTenantId and '' != parentTenantId">
- and `parent_tenant_id` = #{parentTenantId}
- </if>
-
- <if test=" null != openId ">
- and `open_id` = #{openId}
- </if>
-
- <if test=" null != unionId ">
- and `union_id` = #{unionId}
- </if>
-
- <if test=" null != nickName ">
- and `nick_name` like concat('%', #{nickName},'%')
- </if>
-
- <if test=" null != gender ">
- and `gender` = #{gender}
- </if>
-
- <if test=" null != avatarUrl ">
- and `avatar_url` like concat('%', #{avatarUrl},'%')
- </if>
-
- <if test=" null != phone ">
- and `phone` like concat('%', #{phone},'%')
- </if>
-
- <if test=" null != purePhone ">
- and `pure_phone` like concat('%', #{purePhone},'%')
- </if>
-
- <if test=" null != city ">
- and `city` like concat('%', #{city},'%')
- </if>
-
- <if test=" null != province ">
- and `province` like concat('%', #{province},'%')
- </if>
-
- <if test=" null != language ">
- and `language` like concat('%', #{language},'%')
- </if>
-
- <if test=" null != countryCode ">
- and `country_code` like concat('%', #{countryCode},'%')
- </if>
-
- <if test=" null != registerIp ">
- and `register_ip` like concat('%', #{registerIp},'%')
- </if>
-
- <if test=" null != verifyCodePhone ">
- and `verify_code_phone` like concat('%', #{verifyCodePhone},'%')
- </if>
-
- <if test=" null != qrcodeSource ">
- and `qrcode_source` like concat('%', #{qrcodeSource},'%')
- </if>
-
- <if test=" null != scene ">
- and `scene` like concat('%', #{scene},'%')
- </if>
-
- <if test=" null != sceneAddress ">
- and `scene_address` like concat('%', #{sceneAddress},'%')
- </if>
-
- <if test=" null != sessionKey ">
- and `session_key` like concat('%', #{sessionKey},'%')
- </if>
-
- <if test=" null != score ">
- and `score` = #{score}
- </if>
-
- <if test=" null != updateDate ">
- and `update_date` = #{updateDate}
- </if>
-
- <if test=" null != createDate ">
- and `create_date` = #{createDate}
- </if>
-
- <if test=" null != appId ">
- and `app_id` like concat('%', #{appId},'%')
- </if>
-
- <if test=" null != token ">
- and `token` like concat('%', #{token},'%')
- </if>
-
- <if test=" null != expireTime ">
- and `expire_time` = #{expireTime}
- </if>
-
- <if test=" null != latitude ">
- and `latitude` = #{latitude}
- </if>
-
- <if test=" null != longitude ">
- and `longitude` = #{longitude}
- </if>
-
- <if test=" null != loginCount ">
- and `login_count` = #{loginCount}
- </if>
-
- <if test=" null != extraInfo ">
- and `extra_info` = #{extraInfo}
- </if>
-
- <if test=" null != isSubscribe ">
- and `is_subscribe` = #{isSubscribe}
- </if>
-
- <if test=" null != openAppId ">
- and `open_app_id` = #{openAppId}
- </if>
-
- <if test=" null != mpOpenId ">
- and `mp_open_id` = #{mpOpenId}
- </if>
-
- <if test=" null != mpAppId ">
- and `mp_app_id` = #{mpAppId}
- </if>
-
- <if test=" null != subsOpenId ">
- and `subs_open_id` = #{subsOpenId}
- </if>
-
- <if test=" null != subsAppId ">
- and `subs_app_id` = #{subsAppId}
- </if>
-
- <if test=" null != credit ">
- and `credit` = #{credit}
- </if>
-
- <if test=" null != userId ">
- and `user_id` = #{userId}
- </if>
- <if test=" null != ids ">
- and id in
- <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
- #{idItem}
- </foreach>
- </if>
- <if test=" null != sortColumns">order by ${sortColumns}</if>
- </sql>
-
- <select id="findList" parameterType="com.iformall.domain.po.TtBuser" resultMap="BaseResultMap">
- select
- <include refid="allColumns"/>
- from tt_buser
- <include refid="dynamicWhereConditions"/>
- </select>
-
- <select id="findByOpenId" parameterType="com.iformall.domain.po.TtBuser" resultMap="BaseResultMap">
- select * from tt_buser
- where `open_id` = #{openId}
- <if test=" null != appId and '' != appId">
- and `app_id` = #{appId}
- </if>
- </select>
-
- <select id="findByUnionId" parameterType="com.iformall.domain.po.TtBuser" resultMap="BaseResultMap">
- select * from tt_buser
- where `open_app_id` = #{openAppId} and `union_id` = #{unionId}
- </select>
-
-
- <select id="findByToken" resultMap="BaseResultMap">
- select * from tt_buser
- where `token` = #{token}
- </select>
-
-
- </mapper>
|