<?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.ks.lucky.mapper.LuckySponsorsMapper">
|
<resultMap id="BaseResultMap" type="com.ks.lucky.pojo.DO.LuckySponsors">
|
<id column="id" jdbcType="BIGINT" property="id"/>
|
<result column="account" jdbcType="VARCHAR" property="account"/>
|
<result column="pwd" jdbcType="VARCHAR" property="pwd"/>
|
<result column="name" jdbcType="VARCHAR" property="name"/>
|
<result column="mobile" jdbcType="VARCHAR" property="mobile"/>
|
<result column="balance" jdbcType="DECIMAL" property="balance"/>
|
<result column="state" jdbcType="INTEGER" property="state"/>
|
<result column="state_remarks" jdbcType="VARCHAR" property="stateRemarks"/>
|
<result column="latest_login_time" jdbcType="TIMESTAMP" property="latestLoginTime"/>
|
<result column="remarks" jdbcType="VARCHAR" property="remarks"/>
|
<result column="email" jdbcType="VARCHAR" property="email"/>
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
</resultMap>
|
<sql id="Base_Column_List">
|
id, account, pwd, name, mobile, balance, state, state_remarks, latest_login_time,
|
remarks, email, create_time, update_time
|
</sql>
|
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
select
|
<include refid="Base_Column_List"/>
|
from lucky_sponsors
|
where id = #{id,jdbcType=BIGINT}
|
</select>
|
|
|
<!-- 非模板 -->
|
<sql id="listWhere">
|
<if test="query.state!=null">
|
and state=#{query.state}
|
</if>
|
<if test="query.account!=null">
|
and account=#{query.account}
|
</if>
|
<if test="query.key!=null">
|
and `name` like '${query.key}%'
|
</if>
|
|
<if test="query.minCreateTime!=null">
|
and create_time>=#{query.minCreateTime}
|
</if>
|
|
<if test="query.maxCreateTime!=null">
|
and #{query.maxCreateTime}>create_time
|
</if>
|
|
</sql>
|
|
|
<select id="list" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
select
|
<include refid="Base_Column_List"/>
|
from lucky_sponsors
|
where 1=1
|
<include refid="listWhere"></include>
|
|
<if test="query.sortList!=null">
|
<foreach collection="query.sortList" item="item" separator="," open=" order by ">
|
#{item}
|
</foreach>
|
</if>
|
limit #{query.start},#{query.count}
|
</select>
|
|
<select id="count" resultType="java.lang.Long">
|
select
|
count(*)
|
from lucky_sponsors
|
where 1=1
|
<include refid="listWhere"></include>
|
</select>
|
|
|
<select id="listDetail" resultMap="BaseResultMap">
|
select
|
<include refid="Base_Column_List"/>
|
from lucky_sponsors
|
where
|
<foreach collection="ids" item="id" open="(" separator=" or " close=")">
|
id=#{id}
|
</foreach>
|
</select>
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
delete from lucky_sponsors
|
where id = #{id,jdbcType=BIGINT}
|
</delete>
|
<insert id="insert" useGeneratedKeys="true" keyProperty="id" parameterType="com.ks.lucky.pojo.DO.LuckySponsors">
|
insert into lucky_sponsors (id, account, pwd,
|
name, mobile, balance,
|
state, state_remarks, latest_login_time,
|
remarks, email, create_time,
|
update_time)
|
values (#{id,jdbcType=BIGINT}, #{account,jdbcType=VARCHAR}, #{pwd,jdbcType=VARCHAR},
|
#{name,jdbcType=VARCHAR}, #{mobile,jdbcType=VARCHAR}, #{balance,jdbcType=DECIMAL},
|
#{state,jdbcType=INTEGER}, #{stateRemarks,jdbcType=VARCHAR}, #{latestLoginTime,jdbcType=TIMESTAMP},
|
#{remarks,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
|
#{updateTime,jdbcType=TIMESTAMP})
|
</insert>
|
<insert id="insertSelective" useGeneratedKeys="true" keyProperty="id"
|
parameterType="com.ks.lucky.pojo.DO.LuckySponsors">
|
insert into lucky_sponsors
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">
|
id,
|
</if>
|
<if test="account != null">
|
account,
|
</if>
|
<if test="pwd != null">
|
pwd,
|
</if>
|
<if test="name != null">
|
name,
|
</if>
|
<if test="mobile != null">
|
mobile,
|
</if>
|
<if test="balance != null">
|
balance,
|
</if>
|
<if test="state != null">
|
state,
|
</if>
|
<if test="stateRemarks != null">
|
state_remarks,
|
</if>
|
<if test="latestLoginTime != null">
|
latest_login_time,
|
</if>
|
<if test="remarks != null">
|
remarks,
|
</if>
|
<if test="email != null">
|
email,
|
</if>
|
<if test="createTime != null">
|
create_time,
|
</if>
|
<if test="updateTime != null">
|
update_time,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null">
|
#{id,jdbcType=BIGINT},
|
</if>
|
<if test="account != null">
|
#{account,jdbcType=VARCHAR},
|
</if>
|
<if test="pwd != null">
|
#{pwd,jdbcType=VARCHAR},
|
</if>
|
<if test="name != null">
|
#{name,jdbcType=VARCHAR},
|
</if>
|
<if test="mobile != null">
|
#{mobile,jdbcType=VARCHAR},
|
</if>
|
<if test="balance != null">
|
#{balance,jdbcType=DECIMAL},
|
</if>
|
<if test="state != null">
|
#{state,jdbcType=INTEGER},
|
</if>
|
<if test="stateRemarks != null">
|
#{stateRemarks,jdbcType=VARCHAR},
|
</if>
|
<if test="latestLoginTime != null">
|
#{latestLoginTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="remarks != null">
|
#{remarks,jdbcType=VARCHAR},
|
</if>
|
<if test="email != null">
|
#{email,jdbcType=VARCHAR},
|
</if>
|
<if test="createTime != null">
|
#{createTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="updateTime != null">
|
#{updateTime,jdbcType=TIMESTAMP},
|
</if>
|
</trim>
|
</insert>
|
<update id="updateByPrimaryKeySelective" parameterType="com.ks.lucky.pojo.DO.LuckySponsors">
|
update lucky_sponsors
|
<set>
|
<if test="account != null">
|
account = #{account,jdbcType=VARCHAR},
|
</if>
|
<if test="pwd != null">
|
pwd = #{pwd,jdbcType=VARCHAR},
|
</if>
|
<if test="name != null">
|
name = #{name,jdbcType=VARCHAR},
|
</if>
|
<if test="mobile != null">
|
mobile = #{mobile,jdbcType=VARCHAR},
|
</if>
|
<if test="balance != null">
|
balance = #{balance,jdbcType=DECIMAL},
|
</if>
|
<if test="state != null">
|
state = #{state,jdbcType=INTEGER},
|
</if>
|
<if test="stateRemarks != null">
|
state_remarks = #{stateRemarks,jdbcType=VARCHAR},
|
</if>
|
<if test="latestLoginTime != null">
|
latest_login_time = #{latestLoginTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="remarks != null">
|
remarks = #{remarks,jdbcType=VARCHAR},
|
</if>
|
<if test="email != null">
|
email = #{email,jdbcType=VARCHAR},
|
</if>
|
<if test="createTime != null">
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="updateTime != null">
|
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
</if>
|
</set>
|
where id = #{id,jdbcType=BIGINT}
|
</update>
|
<update id="updateByPrimaryKey" parameterType="com.ks.lucky.pojo.DO.LuckySponsors">
|
update lucky_sponsors
|
set account = #{account,jdbcType=VARCHAR},
|
pwd = #{pwd,jdbcType=VARCHAR},
|
name = #{name,jdbcType=VARCHAR},
|
mobile = #{mobile,jdbcType=VARCHAR},
|
balance = #{balance,jdbcType=DECIMAL},
|
state = #{state,jdbcType=INTEGER},
|
state_remarks = #{stateRemarks,jdbcType=VARCHAR},
|
latest_login_time = #{latestLoginTime,jdbcType=TIMESTAMP},
|
remarks = #{remarks,jdbcType=VARCHAR},
|
email = #{email,jdbcType=VARCHAR},
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
update_time = #{updateTime,jdbcType=TIMESTAMP}
|
where id = #{id,jdbcType=BIGINT}
|
</update>
|
</mapper>
|