123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546 |
- <?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.platform.yijia.dao.AppUserInfoMapper">
- <resultMap id="BaseResultMap" type="com.platform.yijia.pojo.AppUserInfo">
- <id column="user_id" jdbcType="INTEGER" property="userId" />
- <result column="user_type" jdbcType="VARCHAR" property="userType" />
- <result column="blog_openid" jdbcType="VARCHAR" property="blogOpenid" />
- <result column="mina_openid" jdbcType="VARCHAR" property="minaOpenid" />
- <result column="mobile_phone" jdbcType="VARCHAR" property="mobilePhone" />
- <result column="blog_nick_name" jdbcType="VARCHAR" property="blogNickName" />
- <result column="sex_flag" jdbcType="VARCHAR" property="sexFlag" />
- <result column="registe_date" jdbcType="TIMESTAMP" property="registeDate" />
- <result column="blog_profile_photo" jdbcType="VARCHAR" property="blogProfilePhoto" />
- <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" />
- <result column="union_id" jdbcType="VARCHAR" property="unionId" />
- <result column="ali_id" jdbcType="VARCHAR" property="aLiId" />
- <result column="station_id" jdbcType="INTEGER" property="stationId" />
- </resultMap>
- <sql id="Example_Where_Clause">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- <where>
- <foreach collection="oredCriteria" item="criteria" separator="or">
- <if test="criteria.valid">
- <trim prefix="(" prefixOverrides="and" suffix=")">
- <foreach collection="criteria.criteria" item="criterion">
- <choose>
- <when test="criterion.noValue">
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue">
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue">
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue">
- and ${criterion.condition}
- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Update_By_Example_Where_Clause">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- <where>
- <foreach collection="example.oredCriteria" item="criteria" separator="or">
- <if test="criteria.valid">
- <trim prefix="(" prefixOverrides="and" suffix=")">
- <foreach collection="criteria.criteria" item="criterion">
- <choose>
- <when test="criterion.noValue">
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue">
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue">
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue">
- and ${criterion.condition}
- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Base_Column_List">
- user_id, user_type, blog_openid, mina_openid, mobile_phone, blog_nick_name, sex_flag,
- registe_date blog_profile_photo, update_date, union_id, ali_id, station_id
- </sql>
- <!-- 获取用户信息-->
- <select id="getAppUserInfo" parameterType="com.platform.yijia.pojo.AppUserInfo" resultMap="BaseResultMap">
- SELECT
- <include refid="Base_Column_List" />
- FROM
- app_user_info
- <where>
- <if test="stationId !=null and stationId !=''">
- station_id = #{stationId}
- </if>
- <if test="mobilePhone !=null and mobilePhone !=''">
- AND mobile_phone = #{mobilePhone}
- </if>
- <if test="unionId !=null and unionId !=''">
- AND union_id = #{unionId}
- </if>
- <if test="minaOpenid !=null and minaOpenid !=''">
- AND mina_openid = #{minaOpenid}
- </if>
- <if test="aLiId !=null and aLiId !=''">
- AND ali_id = #{aLiId}
- </if>
- </where>
- </select>
- <!-- selectAppUserInfoByMobilePhoneAndStationId -->
- <!-- 根据手机号和油站ID获取用户信息-->
- <select id="selectAppUserInfoByMobilePhoneAndStationId" parameterType="com.platform.yijia.pojo.AppUserInfo" resultMap="BaseResultMap">
- SELECT
- <include refid="Base_Column_List" />
- FROM
- app_user_info
- <where>
- <if test="stationId !=null and stationId !=''">
- station_id = #{stationId}
- </if>
- <if test="mobilePhone !=null and mobilePhone !=''">
- AND mobile_phone = #{mobilePhone}
- </if>
- </where>
- </select>
- <!-- 判断注册账户是否已存在-->
- <select id="isExistAppUser" parameterType="map" resultType="int">
- SELECT
- COUNT(user_id)
- FROM
- app_user_info
- <where>
- <if test="userType !=null and userType !=''">
- user_type = #{userType}
- </if>
- <if test="userType !=null and userType ==1 ">
- AND blog_openid = #{openId}
- </if>
- <if test="userType !=null and userType ==2 ">
- AND mina_openid = #{openId}
- </if>
- <if test="stationId !=null and stationId !=''">
- AND station_id = #{stationId}
- </if>
- </where>
- </select>
- <select id="selectByExample" parameterType="com.platform.yijia.pojo.AppUserInfoExample" resultMap="BaseResultMap">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- select
- <if test="distinct">
- distinct
- </if>
- <include refid="Base_Column_List" />
- from app_user_info
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- <if test="orderByClause != null">
- order by ${orderByClause}
- </if>
- </select>
- <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- select
- <include refid="Base_Column_List" />
- from app_user_info
- where user_id = #{userId,jdbcType=INTEGER}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- delete from app_user_info
- where user_id = #{userId,jdbcType=INTEGER}
- </delete>
- <delete id="deleteByExample" parameterType="com.platform.yijia.pojo.AppUserInfoExample">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- delete from app_user_info
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- </delete>
- <insert id="insert" parameterType="com.platform.yijia.pojo.AppUserInfo">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- insert into app_user_info (user_id, user_type, blog_openid,
- mina_openid, mobile_phone, blog_nick_name,
- sex_flag, registe_date, blog_profile_photo, update_date, union_id,station_id
- )
- values (#{userId,jdbcType=INTEGER}, #{userType,jdbcType=VARCHAR}, #{blogOpenid,jdbcType=VARCHAR},
- #{minaOpenid,jdbcType=VARCHAR}, #{mobilePhone,jdbcType=VARCHAR}, #{blogNickName,jdbcType=VARCHAR},
- #{sexFlag,jdbcType=VARCHAR}, #{registeDate,jdbcType=TIMESTAMP}, #{blogProfilePhoto,jdbcType=VARCHAR}, #{updateDate,jdbcType=TIMESTAMP},
- #{unionId,jdbcType=VARCHAR},#{stationId,jdbcType=INTEGER}
- )
- </insert>
- <insert id="insertSelective" parameterType="com.platform.yijia.pojo.AppUserInfo">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- insert into app_user_info
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="userId != null">
- user_id,
- </if>
- <if test="userType != null">
- user_type,
- </if>
- <if test="blogOpenid != null">
- blog_openid,
- </if>
- <if test="minaOpenid != null">
- mina_openid,
- </if>
- <if test="mobilePhone != null">
- mobile_phone,
- </if>
- <if test="blogNickName != null">
- blog_nick_name,
- </if>
- <if test="sexFlag != null">
- sex_flag,
- </if>
- <if test="registeDate != null">
- registe_date,
- </if>
- <if test="blogToken != null">
- blog_token,
- </if>
- <if test="minaToken != null">
- mina_token,
- </if>
- <if test="blogProfilePhoto != null">
- blog_profile_photo,
- </if>
- <if test="updateDate != null">
- update_date,
- </if>
- <if test="unionId != null">
- union_id,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="userId != null">
- #{userId,jdbcType=INTEGER},
- </if>
- <if test="userType != null">
- #{userType,jdbcType=VARCHAR},
- </if>
- <if test="blogOpenid != null">
- #{blogOpenid,jdbcType=VARCHAR},
- </if>
- <if test="minaOpenid != null">
- #{minaOpenid,jdbcType=VARCHAR},
- </if>
- <if test="mobilePhone != null">
- #{mobilePhone,jdbcType=VARCHAR},
- </if>
- <if test="blogNickName != null">
- #{blogNickName,jdbcType=VARCHAR},
- </if>
- <if test="sexFlag != null">
- #{sexFlag,jdbcType=VARCHAR},
- </if>
- <if test="registeDate != null">
- #{registeDate,jdbcType=TIMESTAMP},
- </if>
- <if test="blogToken != null">
- #{blogToken,jdbcType=VARCHAR},
- </if>
- <if test="minaToken != null">
- #{minaToken,jdbcType=VARCHAR},
- </if>
- <if test="blogProfilePhoto != null">
- #{blogProfilePhoto,jdbcType=VARCHAR},
- </if>
- <if test="updateDate != null">
- #{updateDate,jdbcType=TIMESTAMP},
- </if>
- <if test="unionId != null">
- #{unionId,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <select id="countByExample" parameterType="com.platform.yijia.pojo.AppUserInfoExample" resultType="java.lang.Long">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- select count(*) from app_user_info
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- </select>
- <update id="updateByExampleSelective" parameterType="map">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- update app_user_info
- <set>
- <if test="record.userId != null">
- user_id = #{record.userId,jdbcType=INTEGER},
- </if>
- <if test="record.userType != null">
- user_type = #{record.userType,jdbcType=VARCHAR},
- </if>
- <if test="record.blogOpenid != null">
- blog_openid = #{record.blogOpenid,jdbcType=VARCHAR},
- </if>
- <if test="record.minaOpenid != null">
- mina_openid = #{record.minaOpenid,jdbcType=VARCHAR},
- </if>
- <if test="record.mobilePhone != null">
- mobile_phone = #{record.mobilePhone,jdbcType=VARCHAR},
- </if>
- <if test="record.blogNickName != null">
- blog_nick_name = #{record.blogNickName,jdbcType=VARCHAR},
- </if>
- <if test="record.sexFlag != null">
- sex_flag = #{record.sexFlag,jdbcType=VARCHAR},
- </if>
- <if test="record.registeDate != null">
- registe_date = #{record.registeDate,jdbcType=TIMESTAMP},
- </if>
- <if test="record.blogToken != null">
- blog_token = #{record.blogToken,jdbcType=VARCHAR},
- </if>
- <if test="record.minaToken != null">
- mina_token = #{record.minaToken,jdbcType=VARCHAR},
- </if>
- <if test="record.blogProfilePhoto != null">
- blog_profile_photo = #{record.blogProfilePhoto,jdbcType=VARCHAR},
- </if>
- <if test="record.updateDate != null">
- update_date = #{record.updateDate,jdbcType=TIMESTAMP},
- </if>
- <if test="record.unionId != null">
- union_id = #{record.unionId,jdbcType=VARCHAR},
- </if>
- </set>
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByExample" parameterType="map">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- update app_user_info
- set user_id = #{record.userId,jdbcType=INTEGER},
- user_type = #{record.userType,jdbcType=VARCHAR},
- blog_openid = #{record.blogOpenid,jdbcType=VARCHAR},
- mina_openid = #{record.minaOpenid,jdbcType=VARCHAR},
- mobile_phone = #{record.mobilePhone,jdbcType=VARCHAR},
- blog_nick_name = #{record.blogNickName,jdbcType=VARCHAR},
- sex_flag = #{record.sexFlag,jdbcType=VARCHAR},
- registe_date = #{record.registeDate,jdbcType=TIMESTAMP},
- blog_token = #{record.blogToken,jdbcType=VARCHAR},
- mina_token = #{record.minaToken,jdbcType=VARCHAR},
- blog_profile_photo = #{record.blogProfilePhoto,jdbcType=VARCHAR},
- update_date = #{record.updateDate,jdbcType=TIMESTAMP}
- union_id = #{record.unionId,jdbcType=VARCHAR}
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.platform.yijia.pojo.AppUserInfo">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- update app_user_info
- <set>
- <if test="userType != null">
- user_type = #{userType,jdbcType=VARCHAR},
- </if>
- <if test="blogOpenid != null">
- blog_openid = #{blogOpenid,jdbcType=VARCHAR},
- </if>
- <if test="minaOpenid != null">
- mina_openid = #{minaOpenid,jdbcType=VARCHAR},
- </if>
- <if test="mobilePhone != null">
- mobile_phone = #{mobilePhone,jdbcType=VARCHAR},
- </if>
- <if test="blogNickName != null">
- blog_nick_name = #{blogNickName,jdbcType=VARCHAR},
- </if>
- <if test="sexFlag != null">
- sex_flag = #{sexFlag,jdbcType=VARCHAR},
- </if>
- <if test="registeDate != null">
- registe_date = #{registeDate,jdbcType=TIMESTAMP},
- </if>
- <if test="blogToken != null">
- blog_token = #{blogToken,jdbcType=VARCHAR},
- </if>
- <if test="minaToken != null">
- mina_token = #{minaToken,jdbcType=VARCHAR},
- </if>
- <if test="blogProfilePhoto != null">
- blog_profile_photo = #{blogProfilePhoto,jdbcType=VARCHAR},
- </if>
- <if test="updateDate != null">
- update_date = #{updateDate,jdbcType=TIMESTAMP},
- </if>
- <if test="unionId != null">
- union_id = #{unionId,jdbcType=VARCHAR},
- </if>
- </set>
- where user_id = #{userId,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.platform.yijia.pojo.AppUserInfo">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- update app_user_info
- set user_type = #{userType,jdbcType=VARCHAR},
- blog_openid = #{blogOpenid,jdbcType=VARCHAR},
- mina_openid = #{minaOpenid,jdbcType=VARCHAR},
- mobile_phone = #{mobilePhone,jdbcType=VARCHAR},
- blog_nick_name = #{blogNickName,jdbcType=VARCHAR},
- sex_flag = #{sexFlag,jdbcType=VARCHAR},
- registe_date = #{registeDate,jdbcType=TIMESTAMP},
- blog_token = #{blogToken,jdbcType=VARCHAR},
- mina_token = #{minaToken,jdbcType=VARCHAR},
- blog_profile_photo = #{blogProfilePhoto,jdbcType=VARCHAR},
- update_date = #{updateDate,jdbcType=TIMESTAMP},
- union_id = #{unionId,jdbcType=VARCHAR}
- where user_id = #{userId,jdbcType=INTEGER}
- </update>
- <!--查询客户unionId-->
- <select id="getUserInfo" parameterType="com.platform.yijia.pojo.AppUserInfo" resultMap="BaseResultMap">
- SELECT
- <include refid="Base_Column_List" />
- FROM app_user_info
- <where>
- <if test="userType !=null and userType !=''">
- user_type = #{userType}
- </if>
- <if test="stationId !=null and stationId !=''">
- station_id = #{stationId}
- </if>
- <if test="blogOpenid !=null and blogOpenid !=''">
- AND blog_openid = #{blogOpenid}
- </if>
- <if test="minaOpenid !=null and minaOpenid !=''">
- AND mina_openid = #{minaOpenid}
- </if>
- <if test="mobilePhone !=null and mobilePhone !=''">
- AND mobile_phone = #{mobilePhone}
- </if>
- </where>
- </select>
- <!--更新用户信息-->
- <update id="updateAppUserInfo" parameterType="com.platform.yijia.pojo.AppUserInfo">
- UPDATE app_user_info
- <set>
- <if test="userType != null">
- user_type = #{userType},
- </if>
- <if test="blogOpenid != null">
- blog_openid = #{blogOpenid},
- </if>
- <if test="minaOpenid != null">
- mina_openid = #{minaOpenid},
- </if>
- <if test="mobilePhone != null">
- mobile_phone = #{mobilePhone},
- </if>
- <if test="blogNickName != null">
- blog_nick_name = #{blogNickName},
- </if>
- <if test="sexFlag != null">
- sex_flag = #{sexFlag},
- </if>
- <if test="registeDate != null">
- registe_date = #{registeDate},
- </if>
- <if test="blogProfilePhoto != null">
- blog_profile_photo = #{blogProfilePhoto},
- </if>
- <if test="updateDate != null">
- update_date = #{updateDate},
- </if>
- </set>
- <where>
- <if test="stationId !=null and stationId !=''">
- station_id = #{stationId}
- </if>
- <if test="unionId !=null and unionId !=''">
- AND union_id = #{unionId}
- </if>
- <!-- <if test="mobilePhone !=null and mobilePhone !=''">-->
- <!-- AND mobile_phone = #{mobilePhone}-->
- <!-- </if>-->
- </where>
- </update>
- <!-- 判断使用小程序支付的用户是否关注公众号-->
- <select id="whetherFollowGzh" parameterType="map" resultType="String">
- SELECT
- blog_openid AS openId
- FROM
- app_user_info
- <where>
- <if test="userType !=null and userType !=''">
- user_type = #{userType}
- </if>
- <if test="unionId !=null and unionId !=''">
- AND union_id = #{unionId}
- </if>
- <if test="stationId !=null and stationId !=''">
- AND station_id = #{stationId}
- </if>
- </where>
- </select>
- </mapper>
|