Commit 4cc84c58 by 杨林龙

完成基本开发

1 parent 40909458
<?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.glsx.mapper.PlatformAdMapper">
<resultMap id="BaseResultMap" type="com.glsx.model.PlatformAd">
<!--@mbg.generated-->
<!--@Table t_platform_ad-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="title" jdbcType="VARCHAR" property="title" />
<result column="image" jdbcType="VARCHAR" property="image" />
<result column="position" jdbcType="TINYINT" property="position" />
<result column="interface_type" jdbcType="TINYINT" property="interfaceType" />
<result column="interface_url" jdbcType="VARCHAR" property="interfaceUrl" />
<result column="status" jdbcType="TINYINT" property="status" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="create_by" jdbcType="INTEGER" property="createBy" />
<result column="update_by" jdbcType="INTEGER" property="updateBy" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, title, image, `position`, interface_type, interface_url, `status`, create_time,
update_time, create_by, update_by, remark
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List" />
from t_platform_ad
where id = #{id,jdbcType=INTEGER}
</select>
<select id="getAdMgrList" resultType="com.glsx.model.PlatformAd">
select
<include refid="Base_Column_List" />
from t_platform_ad
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--@mbg.generated-->
delete from t_platform_ad
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.glsx.model.PlatformAd" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into t_platform_ad (title, image, `position`,
interface_type, interface_url, `status`,
create_time, update_time, create_by,
update_by, remark)
values (#{title,jdbcType=VARCHAR}, #{image,jdbcType=VARCHAR}, #{position,jdbcType=TINYINT},
#{interfaceType,jdbcType=TINYINT}, #{interfaceUrl,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{createBy,jdbcType=INTEGER},
#{updateBy,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.glsx.model.PlatformAd" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into t_platform_ad
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="title != null and title != ''">
title,
</if>
<if test="image != null and image != ''">
image,
</if>
<if test="position != null">
`position`,
</if>
<if test="interfaceType != null">
interface_type,
</if>
<if test="interfaceUrl != null and interfaceUrl != ''">
interface_url,
</if>
<if test="status != null">
`status`,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="remark != null and remark != ''">
remark,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="title != null and title != ''">
#{title,jdbcType=VARCHAR},
</if>
<if test="image != null and image != ''">
#{image,jdbcType=VARCHAR},
</if>
<if test="position != null">
#{position,jdbcType=TINYINT},
</if>
<if test="interfaceType != null">
#{interfaceType,jdbcType=TINYINT},
</if>
<if test="interfaceUrl != null and interfaceUrl != ''">
#{interfaceUrl,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=TINYINT},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
#{createBy,jdbcType=INTEGER},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=INTEGER},
</if>
<if test="remark != null and remark != ''">
#{remark,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.glsx.model.PlatformAd">
<!--@mbg.generated-->
update t_platform_ad
<set>
<if test="title != null and title != ''">
title = #{title,jdbcType=VARCHAR},
</if>
<if test="image != null and image != ''">
image = #{image,jdbcType=VARCHAR},
</if>
<if test="position != null">
`position` = #{position,jdbcType=TINYINT},
</if>
<if test="interfaceType != null">
interface_type = #{interfaceType,jdbcType=TINYINT},
</if>
<if test="interfaceUrl != null and interfaceUrl != ''">
interface_url = #{interfaceUrl,jdbcType=VARCHAR},
</if>
<if test="status != null">
`status` = #{status,jdbcType=TINYINT},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=INTEGER},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=INTEGER},
</if>
<if test="remark != null and remark != ''">
remark = #{remark,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.glsx.model.PlatformAd">
<!--@mbg.generated-->
update t_platform_ad
set title = #{title,jdbcType=VARCHAR},
image = #{image,jdbcType=VARCHAR},
`position` = #{position,jdbcType=TINYINT},
interface_type = #{interfaceType,jdbcType=TINYINT},
interface_url = #{interfaceUrl,jdbcType=VARCHAR},
`status` = #{status,jdbcType=TINYINT},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
create_by = #{createBy,jdbcType=INTEGER},
update_by = #{updateBy,jdbcType=INTEGER},
remark = #{remark,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateBatch" parameterType="java.util.List">
<!--@mbg.generated-->
update t_platform_ad
<trim prefix="set" suffixOverrides=",">
<trim prefix="title = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.title,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="image = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.image,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="`position` = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.position,jdbcType=TINYINT}
</foreach>
</trim>
<trim prefix="interface_type = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.interfaceType,jdbcType=TINYINT}
</foreach>
</trim>
<trim prefix="interface_url = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.interfaceUrl,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="`status` = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.status,jdbcType=TINYINT}
</foreach>
</trim>
<trim prefix="create_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="update_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="create_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.createBy,jdbcType=INTEGER}
</foreach>
</trim>
<trim prefix="update_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateBy,jdbcType=INTEGER}
</foreach>
</trim>
<trim prefix="remark = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.remark,jdbcType=VARCHAR}
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=INTEGER}
</foreach>
</update>
<update id="updateBatchSelective" parameterType="java.util.List">
<!--@mbg.generated-->
update t_platform_ad
<trim prefix="set" suffixOverrides=",">
<trim prefix="title = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.title != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.title,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="image = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.image != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.image,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="`position` = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.position != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.position,jdbcType=TINYINT}
</if>
</foreach>
</trim>
<trim prefix="interface_type = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.interfaceType != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.interfaceType,jdbcType=TINYINT}
</if>
</foreach>
</trim>
<trim prefix="interface_url = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.interfaceUrl != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.interfaceUrl,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="`status` = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.status != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.status,jdbcType=TINYINT}
</if>
</foreach>
</trim>
<trim prefix="create_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.createTime != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="update_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.updateTime != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="create_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.createBy != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.createBy,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="update_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.updateBy != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateBy,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="remark = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.remark != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.remark,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=INTEGER}
</foreach>
</update>
<insert id="insertOrUpdate" keyColumn="id" keyProperty="id" parameterType="com.glsx.model.PlatformAd" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into t_platform_ad
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
title,
image,
`position`,
interface_type,
interface_url,
`status`,
create_time,
update_time,
create_by,
update_by,
remark,
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
#{title,jdbcType=VARCHAR},
#{image,jdbcType=VARCHAR},
#{position,jdbcType=TINYINT},
#{interfaceType,jdbcType=TINYINT},
#{interfaceUrl,jdbcType=VARCHAR},
#{status,jdbcType=TINYINT},
#{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP},
#{createBy,jdbcType=INTEGER},
#{updateBy,jdbcType=INTEGER},
#{remark,jdbcType=VARCHAR},
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
title = #{title,jdbcType=VARCHAR},
image = #{image,jdbcType=VARCHAR},
`position` = #{position,jdbcType=TINYINT},
interface_type = #{interfaceType,jdbcType=TINYINT},
interface_url = #{interfaceUrl,jdbcType=VARCHAR},
`status` = #{status,jdbcType=TINYINT},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
create_by = #{createBy,jdbcType=INTEGER},
update_by = #{updateBy,jdbcType=INTEGER},
remark = #{remark,jdbcType=VARCHAR},
</trim>
</insert>
<insert id="insertOrUpdateSelective" keyColumn="id" keyProperty="id" parameterType="com.glsx.model.PlatformAd" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into t_platform_ad
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="title != null and title != ''">
title,
</if>
<if test="image != null and image != ''">
image,
</if>
<if test="position != null">
`position`,
</if>
<if test="interfaceType != null">
interface_type,
</if>
<if test="interfaceUrl != null and interfaceUrl != ''">
interface_url,
</if>
<if test="status != null">
`status`,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="remark != null and remark != ''">
remark,
</if>
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="title != null and title != ''">
#{title,jdbcType=VARCHAR},
</if>
<if test="image != null and image != ''">
#{image,jdbcType=VARCHAR},
</if>
<if test="position != null">
#{position,jdbcType=TINYINT},
</if>
<if test="interfaceType != null">
#{interfaceType,jdbcType=TINYINT},
</if>
<if test="interfaceUrl != null and interfaceUrl != ''">
#{interfaceUrl,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=TINYINT},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
#{createBy,jdbcType=INTEGER},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=INTEGER},
</if>
<if test="remark != null and remark != ''">
#{remark,jdbcType=VARCHAR},
</if>
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
<if test="title != null and title != ''">
title = #{title,jdbcType=VARCHAR},
</if>
<if test="image != null and image != ''">
image = #{image,jdbcType=VARCHAR},
</if>
<if test="position != null">
`position` = #{position,jdbcType=TINYINT},
</if>
<if test="interfaceType != null">
interface_type = #{interfaceType,jdbcType=TINYINT},
</if>
<if test="interfaceUrl != null and interfaceUrl != ''">
interface_url = #{interfaceUrl,jdbcType=VARCHAR},
</if>
<if test="status != null">
`status` = #{status,jdbcType=TINYINT},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=INTEGER},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=INTEGER},
</if>
<if test="remark != null and remark != ''">
remark = #{remark,jdbcType=VARCHAR},
</if>
</trim>
</insert>
</mapper>
\ No newline at end of file \ No newline at end of file
<?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.glsx.mapper.PlatformApiCallMapper">
<resultMap id="BaseResultMap" type="com.glsx.model.PlatformApiCall">
<!--@mbg.generated-->
<!--@Table t_platform_api_call-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="customer_id" jdbcType="INTEGER" property="customerId" />
<result column="customer_name" jdbcType="INTEGER" property="customerName" />
<result column="api_id" jdbcType="INTEGER" property="apiId" />
<result column="api_name" jdbcType="INTEGER" property="apiName" />
<result column="call_result" jdbcType="TINYINT" property="callResult" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="create_by" jdbcType="INTEGER" property="createBy" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, customer_id, api_id, call_result, create_time, create_by, remark
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List" />
from t_platform_api_call
where id = #{id,jdbcType=INTEGER}
</select>
<select id="getApiCallMgrList" parameterType="com.glsx.vo.ApiCallVo" resultMap="BaseResultMap">
select
a.id,
b.customer_name,
c.api_name,
a.call_result,
a.create_time,
a.create_by,
a.remark
from t_platform_api_call a
left join t_platform_customer b
on a.customer_id = b.id
left join t_platform_api c
on a.api_id = c.id
where 1=1
<if test="accessStartTime != null ">
and create_time &gt;= #{accessStartTime,jdbcType=TIMESTAMP}
</if>
<if test="accessEndTime != null ">
and create_time &lt;= #{accessEndTime,jdbcType=TIMESTAMP}
</if>
</select>
<select id="getApiCallCount" resultType="java.lang.Integer">
select count(1)
from t_platform_api_call
</select>
<select id="getApiCallGraphData" resultType="java.util.Map">
select b.api_classification ,count(a.id)
from t_platform_api_call a
left join t_platform_api b
on a.api_id = b.id
group by b.api_classification
</select>
<select id="getApiCallTrendList" resultType="java.util.Map">
select
date_format(create_time,'%Y-%m-%d') as create_time,
count(id)
from t_platform_api_call
group by create_time
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--@mbg.generated-->
delete from t_platform_api_call
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.glsx.model.PlatformApiCall" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into t_platform_api_call (customer_id, api_id, call_result,
create_time, create_by, remark
)
values (#{customerId,jdbcType=INTEGER}, #{apiId,jdbcType=INTEGER}, #{callResult,jdbcType=TINYINT},
#{createTime,jdbcType=TIMESTAMP}, #{createBy,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.glsx.model.PlatformApiCall" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into t_platform_api_call
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="customerId != null">
customer_id,
</if>
<if test="apiId != null">
api_id,
</if>
<if test="callResult != null">
call_result,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="remark != null and remark != ''">
remark,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="customerId != null">
#{customerId,jdbcType=INTEGER},
</if>
<if test="apiId != null">
#{apiId,jdbcType=INTEGER},
</if>
<if test="callResult != null">
#{callResult,jdbcType=TINYINT},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
#{createBy,jdbcType=INTEGER},
</if>
<if test="remark != null and remark != ''">
#{remark,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.glsx.model.PlatformApiCall">
<!--@mbg.generated-->
update t_platform_api_call
<set>
<if test="customerId != null">
customer_id = #{customerId,jdbcType=INTEGER},
</if>
<if test="apiId != null">
api_id = #{apiId,jdbcType=INTEGER},
</if>
<if test="callResult != null">
call_result = #{callResult,jdbcType=TINYINT},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=INTEGER},
</if>
<if test="remark != null and remark != ''">
remark = #{remark,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.glsx.model.PlatformApiCall">
<!--@mbg.generated-->
update t_platform_api_call
set customer_id = #{customerId,jdbcType=INTEGER},
api_id = #{apiId,jdbcType=INTEGER},
call_result = #{callResult,jdbcType=TINYINT},
create_time = #{createTime,jdbcType=TIMESTAMP},
create_by = #{createBy,jdbcType=INTEGER},
remark = #{remark,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateBatch" parameterType="java.util.List">
<!--@mbg.generated-->
update t_platform_api_call
<trim prefix="set" suffixOverrides=",">
<trim prefix="customer_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.customerId,jdbcType=INTEGER}
</foreach>
</trim>
<trim prefix="api_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.apiId,jdbcType=INTEGER}
</foreach>
</trim>
<trim prefix="call_result = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.callResult,jdbcType=TINYINT}
</foreach>
</trim>
<trim prefix="create_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="create_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.createBy,jdbcType=INTEGER}
</foreach>
</trim>
<trim prefix="remark = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.remark,jdbcType=VARCHAR}
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=INTEGER}
</foreach>
</update>
<update id="updateBatchSelective" parameterType="java.util.List">
<!--@mbg.generated-->
update t_platform_api_call
<trim prefix="set" suffixOverrides=",">
<trim prefix="customer_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.customerId != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.customerId,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="api_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.apiId != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.apiId,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="call_result = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.callResult != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.callResult,jdbcType=TINYINT}
</if>
</foreach>
</trim>
<trim prefix="create_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.createTime != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="create_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.createBy != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.createBy,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="remark = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.remark != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.remark,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=INTEGER}
</foreach>
</update>
<insert id="insertOrUpdate" keyColumn="id" keyProperty="id" parameterType="com.glsx.model.PlatformApiCall" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into t_platform_api_call
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
customer_id,
api_id,
call_result,
create_time,
create_by,
remark,
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
#{customerId,jdbcType=INTEGER},
#{apiId,jdbcType=INTEGER},
#{callResult,jdbcType=TINYINT},
#{createTime,jdbcType=TIMESTAMP},
#{createBy,jdbcType=INTEGER},
#{remark,jdbcType=VARCHAR},
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
customer_id = #{customerId,jdbcType=INTEGER},
api_id = #{apiId,jdbcType=INTEGER},
call_result = #{callResult,jdbcType=TINYINT},
create_time = #{createTime,jdbcType=TIMESTAMP},
create_by = #{createBy,jdbcType=INTEGER},
remark = #{remark,jdbcType=VARCHAR},
</trim>
</insert>
<insert id="insertOrUpdateSelective" keyColumn="id" keyProperty="id" parameterType="com.glsx.model.PlatformApiCall" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into t_platform_api_call
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="customerId != null">
customer_id,
</if>
<if test="apiId != null">
api_id,
</if>
<if test="callResult != null">
call_result,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="remark != null and remark != ''">
remark,
</if>
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="customerId != null">
#{customerId,jdbcType=INTEGER},
</if>
<if test="apiId != null">
#{apiId,jdbcType=INTEGER},
</if>
<if test="callResult != null">
#{callResult,jdbcType=TINYINT},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
#{createBy,jdbcType=INTEGER},
</if>
<if test="remark != null and remark != ''">
#{remark,jdbcType=VARCHAR},
</if>
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
<if test="customerId != null">
customer_id = #{customerId,jdbcType=INTEGER},
</if>
<if test="apiId != null">
api_id = #{apiId,jdbcType=INTEGER},
</if>
<if test="callResult != null">
call_result = #{callResult,jdbcType=TINYINT},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=INTEGER},
</if>
<if test="remark != null and remark != ''">
remark = #{remark,jdbcType=VARCHAR},
</if>
</trim>
</insert>
</mapper>
\ No newline at end of file \ No newline at end of file
<?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.glsx.mapper.PlatformApiMapper">
<resultMap id="BaseResultMap" type="com.glsx.model.PlatformApi">
<!--@mbg.generated-->
<!--@Table t_platform_api-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="api_classification" jdbcType="TINYINT" property="apiClassification" />
<result column="api_name" jdbcType="VARCHAR" property="apiName" />
<result column="request_method" jdbcType="TINYINT" property="requestMethod" />
<result column="api_interface" jdbcType="VARCHAR" property="apiInterface" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="status" jdbcType="TINYINT" property="status" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="create_by" jdbcType="INTEGER" property="createBy" />
<result column="update_by" jdbcType="INTEGER" property="updateBy" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, api_classification, api_name, request_method, api_interface, description, `status`,
create_time, update_time, create_by, update_by, remark
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List" />
from t_platform_api
where id = #{id,jdbcType=INTEGER}
</select>
<select id="getApiMgrList" resultType="com.glsx.model.PlatformApi">
select
<include refid="Base_Column_List" />
from t_platform_api
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--@mbg.generated-->
delete from t_platform_api
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.glsx.model.PlatformApi" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into t_platform_api (api_classification, api_name, request_method,
api_interface, description, `status`,
create_time, update_time, create_by,
update_by, remark)
values (#{apiClassification,jdbcType=TINYINT}, #{apiName,jdbcType=VARCHAR}, #{requestMethod,jdbcType=TINYINT},
#{apiInterface,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{createBy,jdbcType=INTEGER},
#{updateBy,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.glsx.model.PlatformApi" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into t_platform_api
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="apiClassification != null">
api_classification,
</if>
<if test="apiName != null and apiName != ''">
api_name,
</if>
<if test="requestMethod != null">
request_method,
</if>
<if test="apiInterface != null and apiInterface != ''">
api_interface,
</if>
<if test="description != null and description != ''">
description,
</if>
<if test="status != null">
`status`,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="remark != null and remark != ''">
remark,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="apiClassification != null">
#{apiClassification,jdbcType=TINYINT},
</if>
<if test="apiName != null and apiName != ''">
#{apiName,jdbcType=VARCHAR},
</if>
<if test="requestMethod != null">
#{requestMethod,jdbcType=TINYINT},
</if>
<if test="apiInterface != null and apiInterface != ''">
#{apiInterface,jdbcType=VARCHAR},
</if>
<if test="description != null and description != ''">
#{description,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=TINYINT},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
#{createBy,jdbcType=INTEGER},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=INTEGER},
</if>
<if test="remark != null and remark != ''">
#{remark,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.glsx.model.PlatformApi">
<!--@mbg.generated-->
update t_platform_api
<set>
<if test="apiClassification != null">
api_classification = #{apiClassification,jdbcType=TINYINT},
</if>
<if test="apiName != null and apiName != ''">
api_name = #{apiName,jdbcType=VARCHAR},
</if>
<if test="requestMethod != null">
request_method = #{requestMethod,jdbcType=TINYINT},
</if>
<if test="apiInterface != null and apiInterface != ''">
api_interface = #{apiInterface,jdbcType=VARCHAR},
</if>
<if test="description != null and description != ''">
description = #{description,jdbcType=VARCHAR},
</if>
<if test="status != null">
`status` = #{status,jdbcType=TINYINT},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=INTEGER},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=INTEGER},
</if>
<if test="remark != null and remark != ''">
remark = #{remark,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.glsx.model.PlatformApi">
<!--@mbg.generated-->
update t_platform_api
set api_classification = #{apiClassification,jdbcType=TINYINT},
api_name = #{apiName,jdbcType=VARCHAR},
request_method = #{requestMethod,jdbcType=TINYINT},
api_interface = #{apiInterface,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
`status` = #{status,jdbcType=TINYINT},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
create_by = #{createBy,jdbcType=INTEGER},
update_by = #{updateBy,jdbcType=INTEGER},
remark = #{remark,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateBatch" parameterType="java.util.List">
<!--@mbg.generated-->
update t_platform_api
<trim prefix="set" suffixOverrides=",">
<trim prefix="api_classification = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.apiClassification,jdbcType=TINYINT}
</foreach>
</trim>
<trim prefix="api_name = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.apiName,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="request_method = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.requestMethod,jdbcType=TINYINT}
</foreach>
</trim>
<trim prefix="api_interface = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.apiInterface,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="description = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.description,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="`status` = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.status,jdbcType=TINYINT}
</foreach>
</trim>
<trim prefix="create_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="update_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="create_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.createBy,jdbcType=INTEGER}
</foreach>
</trim>
<trim prefix="update_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateBy,jdbcType=INTEGER}
</foreach>
</trim>
<trim prefix="remark = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.remark,jdbcType=VARCHAR}
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=INTEGER}
</foreach>
</update>
<update id="updateBatchSelective" parameterType="java.util.List">
<!--@mbg.generated-->
update t_platform_api
<trim prefix="set" suffixOverrides=",">
<trim prefix="api_classification = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.apiClassification != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.apiClassification,jdbcType=TINYINT}
</if>
</foreach>
</trim>
<trim prefix="api_name = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.apiName != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.apiName,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="request_method = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.requestMethod != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.requestMethod,jdbcType=TINYINT}
</if>
</foreach>
</trim>
<trim prefix="api_interface = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.apiInterface != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.apiInterface,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="description = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.description != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.description,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="`status` = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.status != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.status,jdbcType=TINYINT}
</if>
</foreach>
</trim>
<trim prefix="create_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.createTime != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="update_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.updateTime != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="create_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.createBy != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.createBy,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="update_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.updateBy != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateBy,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="remark = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.remark != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.remark,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=INTEGER}
</foreach>
</update>
<insert id="insertOrUpdate" keyColumn="id" keyProperty="id" parameterType="com.glsx.model.PlatformApi" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into t_platform_api
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
api_classification,
api_name,
request_method,
api_interface,
description,
`status`,
create_time,
update_time,
create_by,
update_by,
remark,
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
#{apiClassification,jdbcType=TINYINT},
#{apiName,jdbcType=VARCHAR},
#{requestMethod,jdbcType=TINYINT},
#{apiInterface,jdbcType=VARCHAR},
#{description,jdbcType=VARCHAR},
#{status,jdbcType=TINYINT},
#{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP},
#{createBy,jdbcType=INTEGER},
#{updateBy,jdbcType=INTEGER},
#{remark,jdbcType=VARCHAR},
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
api_classification = #{apiClassification,jdbcType=TINYINT},
api_name = #{apiName,jdbcType=VARCHAR},
request_method = #{requestMethod,jdbcType=TINYINT},
api_interface = #{apiInterface,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
`status` = #{status,jdbcType=TINYINT},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
create_by = #{createBy,jdbcType=INTEGER},
update_by = #{updateBy,jdbcType=INTEGER},
remark = #{remark,jdbcType=VARCHAR},
</trim>
</insert>
<insert id="insertOrUpdateSelective" keyColumn="id" keyProperty="id" parameterType="com.glsx.model.PlatformApi" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into t_platform_api
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="apiClassification != null">
api_classification,
</if>
<if test="apiName != null and apiName != ''">
api_name,
</if>
<if test="requestMethod != null">
request_method,
</if>
<if test="apiInterface != null and apiInterface != ''">
api_interface,
</if>
<if test="description != null and description != ''">
description,
</if>
<if test="status != null">
`status`,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="remark != null and remark != ''">
remark,
</if>
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="apiClassification != null">
#{apiClassification,jdbcType=TINYINT},
</if>
<if test="apiName != null and apiName != ''">
#{apiName,jdbcType=VARCHAR},
</if>
<if test="requestMethod != null">
#{requestMethod,jdbcType=TINYINT},
</if>
<if test="apiInterface != null and apiInterface != ''">
#{apiInterface,jdbcType=VARCHAR},
</if>
<if test="description != null and description != ''">
#{description,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=TINYINT},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
#{createBy,jdbcType=INTEGER},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=INTEGER},
</if>
<if test="remark != null and remark != ''">
#{remark,jdbcType=VARCHAR},
</if>
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
<if test="apiClassification != null">
api_classification = #{apiClassification,jdbcType=TINYINT},
</if>
<if test="apiName != null and apiName != ''">
api_name = #{apiName,jdbcType=VARCHAR},
</if>
<if test="requestMethod != null">
request_method = #{requestMethod,jdbcType=TINYINT},
</if>
<if test="apiInterface != null and apiInterface != ''">
api_interface = #{apiInterface,jdbcType=VARCHAR},
</if>
<if test="description != null and description != ''">
description = #{description,jdbcType=VARCHAR},
</if>
<if test="status != null">
`status` = #{status,jdbcType=TINYINT},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=INTEGER},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=INTEGER},
</if>
<if test="remark != null and remark != ''">
remark = #{remark,jdbcType=VARCHAR},
</if>
</trim>
</insert>
</mapper>
\ No newline at end of file \ No newline at end of file
<?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.glsx.mapper.PlatformAppDownloadMapper">
<resultMap id="BaseResultMap" type="com.glsx.model.PlatformAppDownload">
<!--@mbg.generated-->
<!--@Table t_platform_app_download-->
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="customer_id" jdbcType="INTEGER" property="customerId"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="create_by" jdbcType="INTEGER" property="createBy"/>
<result column="remark" jdbcType="VARCHAR" property="remark"/>
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, customer_id, create_time, create_by, remark
</sql>
<select id="getApiCallCountAuth" resultType="java.lang.Integer">
select count(1)
from t_platform_app_download a
left join t_platform_customer b
on a.customer_id = b.id
where b.customer_name = #{customerName,jdbcType=VARCHAR}
</select>
<select id="getAppDownloadStatistic" resultType="map">
select date_format(pad.create_time, '%Y-%m-%d') `time`,
count(pad.create_time) `count`
from t_platform_app_download pad
left join t_platform_customer pc on pc.id = pad.customer_id
<where>
pad.create_time >= #{startTime,jdbcType=TIMESTAMP}
and pad.create_time &lt; #{endTime,jdbcType=TIMESTAMP}
<if test="customerName != null and customerName != ''">
and pc.customer_name = #{customerName,jdbcType=VARCHAR}
</if>
</where>
group by time
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List"/>
from t_platform_app_download
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--@mbg.generated-->
delete
from t_platform_app_download
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id"
parameterType="com.glsx.model.PlatformAppDownload" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into t_platform_app_download (customer_id, create_time, create_by,
remark)
values (#{customerId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{createBy,jdbcType=INTEGER},
#{remark,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id"
parameterType="com.glsx.model.PlatformAppDownload" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into t_platform_app_download
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="customerId != null">
customer_id,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="remark != null and remark != ''">
remark,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="customerId != null">
#{customerId,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
#{createBy,jdbcType=INTEGER},
</if>
<if test="remark != null and remark != ''">
#{remark,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.glsx.model.PlatformAppDownload">
<!--@mbg.generated-->
update t_platform_app_download
<set>
<if test="customerId != null">
customer_id = #{customerId,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=INTEGER},
</if>
<if test="remark != null and remark != ''">
remark = #{remark,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.glsx.model.PlatformAppDownload">
<!--@mbg.generated-->
update t_platform_app_download
set customer_id = #{customerId,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
create_by = #{createBy,jdbcType=INTEGER},
remark = #{remark,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateBatch" parameterType="java.util.List">
<!--@mbg.generated-->
update t_platform_app_download
<trim prefix="set" suffixOverrides=",">
<trim prefix="customer_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.customerId,jdbcType=INTEGER}
</foreach>
</trim>
<trim prefix="create_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="create_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.createBy,jdbcType=INTEGER}
</foreach>
</trim>
<trim prefix="remark = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.remark,jdbcType=VARCHAR}
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=INTEGER}
</foreach>
</update>
<update id="updateBatchSelective" parameterType="java.util.List">
<!--@mbg.generated-->
update t_platform_app_download
<trim prefix="set" suffixOverrides=",">
<trim prefix="customer_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.customerId != null">
when id = #{item.id,jdbcType=INTEGER}
then #{item.customerId,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="create_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.createTime != null">
when id = #{item.id,jdbcType=INTEGER}
then #{item.createTime,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="create_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.createBy != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.createBy,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="remark = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.remark != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.remark,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=INTEGER}
</foreach>
</update>
<insert id="insertOrUpdate" keyColumn="id" keyProperty="id"
parameterType="com.glsx.model.PlatformAppDownload" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into t_platform_app_download
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
customer_id,
create_time,
create_by,
remark,
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
#{customerId,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP},
#{createBy,jdbcType=INTEGER},
#{remark,jdbcType=VARCHAR},
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
customer_id = #{customerId,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
create_by = #{createBy,jdbcType=INTEGER},
remark = #{remark,jdbcType=VARCHAR},
</trim>
</insert>
<insert id="insertOrUpdateSelective" keyColumn="id" keyProperty="id"
parameterType="com.glsx.model.PlatformAppDownload" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into t_platform_app_download
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="customerId != null">
customer_id,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="remark != null and remark != ''">
remark,
</if>
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="customerId != null">
#{customerId,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
#{createBy,jdbcType=INTEGER},
</if>
<if test="remark != null and remark != ''">
#{remark,jdbcType=VARCHAR},
</if>
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
<if test="customerId != null">
customer_id = #{customerId,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=INTEGER},
</if>
<if test="remark != null and remark != ''">
remark = #{remark,jdbcType=VARCHAR},
</if>
</trim>
</insert>
</mapper>
<?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.glsx.mapper.PlatformCustomerMapper">
<resultMap id="BaseResultMap" type="com.glsx.model.PlatformCustomer">
<!--@mbg.generated-->
<!--@Table t_platform_customer-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="customer_name" jdbcType="VARCHAR" property="customerName" />
<result column="contact_person" jdbcType="VARCHAR" property="contactPerson" />
<result column="password" jdbcType="VARCHAR" property="password" />
<result column="contact_number" jdbcType="VARCHAR" property="contactNumber" />
<result column="contact_email" jdbcType="VARCHAR" property="contactEmail" />
<result column="province" jdbcType="INTEGER" property="province" />
<result column="city" jdbcType="INTEGER" property="city" />
<result column="address" jdbcType="VARCHAR" property="address" />
<result column="status" jdbcType="TINYINT" property="status" />
<result column="public_key" jdbcType="VARCHAR" property="publicKey" />
<result column="private_key" jdbcType="VARCHAR" property="privateKey" />
<result column="channel_number" jdbcType="VARCHAR" property="channelNumber" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="create_by" jdbcType="INTEGER" property="createBy" />
<result column="update_by" jdbcType="INTEGER" property="updateBy" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, customer_name, contact_person, `password`, contact_number, contact_email, province,
city, address, `status`, public_key, private_key, channel_number, create_time, update_time,
create_by, update_by, remark
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List" />
from t_platform_customer
where id = #{id,jdbcType=INTEGER}
</select>
<select id="getCustomerMgrList" resultType="com.glsx.model.PlatformCustomer">
select
<include refid="Base_Column_List" />
from t_platform_customer
</select>
<select id="getCustomerNameList" resultType="java.lang.String">
select distinct
customer_name
from t_platform_customer
</select>
<select id="getCustomerCount" resultType="java.lang.Integer">
select count(1)
from t_platform_customer
</select>
<select id="login" parameterType="com.glsx.model.PlatformCustomer" resultType="java.lang.Integer">
select count(1)
from t_platform_customer
where contact_number = #{contactNumber,jdbcType=VARCHAR}
and password = #{password,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--@mbg.generated-->
delete from t_platform_customer
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.glsx.model.PlatformCustomer" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into t_platform_customer (customer_name, contact_person, `password`,
contact_number, contact_email, province,
city, address, `status`,
public_key, private_key, channel_number,
create_time, update_time, create_by,
update_by, remark)
values (#{customerName,jdbcType=VARCHAR}, #{contactPerson,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
#{contactNumber,jdbcType=VARCHAR}, #{contactEmail,jdbcType=VARCHAR}, #{province,jdbcType=INTEGER},
#{city,jdbcType=INTEGER}, #{address,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT},
#{publicKey,jdbcType=VARCHAR}, #{privateKey,jdbcType=VARCHAR}, #{channelNumber,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{createBy,jdbcType=INTEGER},
#{updateBy,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.glsx.model.PlatformCustomer" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into t_platform_customer
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="customerName != null and customerName != ''">
customer_name,
</if>
<if test="contactPerson != null and contactPerson != ''">
contact_person,
</if>
<if test="password != null and password != ''">
`password`,
</if>
<if test="contactNumber != null and contactNumber != ''">
contact_number,
</if>
<if test="contactEmail != null and contactEmail != ''">
contact_email,
</if>
<if test="province != null">
province,
</if>
<if test="city != null">
city,
</if>
<if test="address != null and address != ''">
address,
</if>
<if test="status != null">
`status`,
</if>
<if test="publicKey != null and publicKey != ''">
public_key,
</if>
<if test="privateKey != null and privateKey != ''">
private_key,
</if>
<if test="channelNumber != null and channelNumber != ''">
channel_number,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="remark != null and remark != ''">
remark,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="customerName != null and customerName != ''">
#{customerName,jdbcType=VARCHAR},
</if>
<if test="contactPerson != null and contactPerson != ''">
#{contactPerson,jdbcType=VARCHAR},
</if>
<if test="password != null and password != ''">
#{password,jdbcType=VARCHAR},
</if>
<if test="contactNumber != null and contactNumber != ''">
#{contactNumber,jdbcType=VARCHAR},
</if>
<if test="contactEmail != null and contactEmail != ''">
#{contactEmail,jdbcType=VARCHAR},
</if>
<if test="province != null">
#{province,jdbcType=INTEGER},
</if>
<if test="city != null">
#{city,jdbcType=INTEGER},
</if>
<if test="address != null and address != ''">
#{address,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=TINYINT},
</if>
<if test="publicKey != null and publicKey != ''">
#{publicKey,jdbcType=VARCHAR},
</if>
<if test="privateKey != null and privateKey != ''">
#{privateKey,jdbcType=VARCHAR},
</if>
<if test="channelNumber != null and channelNumber != ''">
#{channelNumber,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
#{createBy,jdbcType=INTEGER},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=INTEGER},
</if>
<if test="remark != null and remark != ''">
#{remark,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.glsx.model.PlatformCustomer">
<!--@mbg.generated-->
update t_platform_customer
<set>
<if test="customerName != null and customerName != ''">
customer_name = #{customerName,jdbcType=VARCHAR},
</if>
<if test="contactPerson != null and contactPerson != ''">
contact_person = #{contactPerson,jdbcType=VARCHAR},
</if>
<if test="password != null and password != ''">
`password` = #{password,jdbcType=VARCHAR},
</if>
<if test="contactNumber != null and contactNumber != ''">
contact_number = #{contactNumber,jdbcType=VARCHAR},
</if>
<if test="contactEmail != null and contactEmail != ''">
contact_email = #{contactEmail,jdbcType=VARCHAR},
</if>
<if test="province != null">
province = #{province,jdbcType=INTEGER},
</if>
<if test="city != null">
city = #{city,jdbcType=INTEGER},
</if>
<if test="address != null and address != ''">
address = #{address,jdbcType=VARCHAR},
</if>
<if test="status != null">
`status` = #{status,jdbcType=TINYINT},
</if>
<if test="publicKey != null and publicKey != ''">
public_key = #{publicKey,jdbcType=VARCHAR},
</if>
<if test="privateKey != null and privateKey != ''">
private_key = #{privateKey,jdbcType=VARCHAR},
</if>
<if test="channelNumber != null and channelNumber != ''">
channel_number = #{channelNumber,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=INTEGER},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=INTEGER},
</if>
<if test="remark != null and remark != ''">
remark = #{remark,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.glsx.model.PlatformCustomer">
<!--@mbg.generated-->
update t_platform_customer
set customer_name = #{customerName,jdbcType=VARCHAR},
contact_person = #{contactPerson,jdbcType=VARCHAR},
`password` = #{password,jdbcType=VARCHAR},
contact_number = #{contactNumber,jdbcType=VARCHAR},
contact_email = #{contactEmail,jdbcType=VARCHAR},
province = #{province,jdbcType=INTEGER},
city = #{city,jdbcType=INTEGER},
address = #{address,jdbcType=VARCHAR},
`status` = #{status,jdbcType=TINYINT},
public_key = #{publicKey,jdbcType=VARCHAR},
private_key = #{privateKey,jdbcType=VARCHAR},
channel_number = #{channelNumber,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
create_by = #{createBy,jdbcType=INTEGER},
update_by = #{updateBy,jdbcType=INTEGER},
remark = #{remark,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateBatch" parameterType="java.util.List">
<!--@mbg.generated-->
update t_platform_customer
<trim prefix="set" suffixOverrides=",">
<trim prefix="customer_name = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.customerName,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="contact_person = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.contactPerson,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="`password` = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.password,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="contact_number = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.contactNumber,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="contact_email = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.contactEmail,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="province = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.province,jdbcType=INTEGER}
</foreach>
</trim>
<trim prefix="city = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.city,jdbcType=INTEGER}
</foreach>
</trim>
<trim prefix="address = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.address,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="`status` = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.status,jdbcType=TINYINT}
</foreach>
</trim>
<trim prefix="public_key = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.publicKey,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="private_key = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.privateKey,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="channel_number = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.channelNumber,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="create_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="update_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="create_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.createBy,jdbcType=INTEGER}
</foreach>
</trim>
<trim prefix="update_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateBy,jdbcType=INTEGER}
</foreach>
</trim>
<trim prefix="remark = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.remark,jdbcType=VARCHAR}
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=INTEGER}
</foreach>
</update>
<update id="updateBatchSelective" parameterType="java.util.List">
<!--@mbg.generated-->
update t_platform_customer
<trim prefix="set" suffixOverrides=",">
<trim prefix="customer_name = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.customerName != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.customerName,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="contact_person = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.contactPerson != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.contactPerson,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="`password` = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.password != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.password,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="contact_number = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.contactNumber != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.contactNumber,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="contact_email = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.contactEmail != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.contactEmail,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="province = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.province != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.province,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="city = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.city != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.city,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="address = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.address != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.address,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="`status` = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.status != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.status,jdbcType=TINYINT}
</if>
</foreach>
</trim>
<trim prefix="public_key = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.publicKey != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.publicKey,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="private_key = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.privateKey != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.privateKey,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="channel_number = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.channelNumber != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.channelNumber,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="create_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.createTime != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="update_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.updateTime != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="create_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.createBy != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.createBy,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="update_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.updateBy != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateBy,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="remark = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.remark != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.remark,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=INTEGER}
</foreach>
</update>
<insert id="insertOrUpdate" keyColumn="id" keyProperty="id" parameterType="com.glsx.model.PlatformCustomer" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into t_platform_customer
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
customer_name,
contact_person,
`password`,
contact_number,
contact_email,
province,
city,
address,
`status`,
public_key,
private_key,
channel_number,
create_time,
update_time,
create_by,
update_by,
remark,
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
#{customerName,jdbcType=VARCHAR},
#{contactPerson,jdbcType=VARCHAR},
#{password,jdbcType=VARCHAR},
#{contactNumber,jdbcType=VARCHAR},
#{contactEmail,jdbcType=VARCHAR},
#{province,jdbcType=INTEGER},
#{city,jdbcType=INTEGER},
#{address,jdbcType=VARCHAR},
#{status,jdbcType=TINYINT},
#{publicKey,jdbcType=VARCHAR},
#{privateKey,jdbcType=VARCHAR},
#{channelNumber,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP},
#{createBy,jdbcType=INTEGER},
#{updateBy,jdbcType=INTEGER},
#{remark,jdbcType=VARCHAR},
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
customer_name = #{customerName,jdbcType=VARCHAR},
contact_person = #{contactPerson,jdbcType=VARCHAR},
`password` = #{password,jdbcType=VARCHAR},
contact_number = #{contactNumber,jdbcType=VARCHAR},
contact_email = #{contactEmail,jdbcType=VARCHAR},
province = #{province,jdbcType=INTEGER},
city = #{city,jdbcType=INTEGER},
address = #{address,jdbcType=VARCHAR},
`status` = #{status,jdbcType=TINYINT},
public_key = #{publicKey,jdbcType=VARCHAR},
private_key = #{privateKey,jdbcType=VARCHAR},
channel_number = #{channelNumber,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
create_by = #{createBy,jdbcType=INTEGER},
update_by = #{updateBy,jdbcType=INTEGER},
remark = #{remark,jdbcType=VARCHAR},
</trim>
</insert>
<insert id="insertOrUpdateSelective" keyColumn="id" keyProperty="id" parameterType="com.glsx.model.PlatformCustomer" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into t_platform_customer
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="customerName != null and customerName != ''">
customer_name,
</if>
<if test="contactPerson != null and contactPerson != ''">
contact_person,
</if>
<if test="password != null and password != ''">
`password`,
</if>
<if test="contactNumber != null and contactNumber != ''">
contact_number,
</if>
<if test="contactEmail != null and contactEmail != ''">
contact_email,
</if>
<if test="province != null">
province,
</if>
<if test="city != null">
city,
</if>
<if test="address != null and address != ''">
address,
</if>
<if test="status != null">
`status`,
</if>
<if test="publicKey != null and publicKey != ''">
public_key,
</if>
<if test="privateKey != null and privateKey != ''">
private_key,
</if>
<if test="channelNumber != null and channelNumber != ''">
channel_number,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="remark != null and remark != ''">
remark,
</if>
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="customerName != null and customerName != ''">
#{customerName,jdbcType=VARCHAR},
</if>
<if test="contactPerson != null and contactPerson != ''">
#{contactPerson,jdbcType=VARCHAR},
</if>
<if test="password != null and password != ''">
#{password,jdbcType=VARCHAR},
</if>
<if test="contactNumber != null and contactNumber != ''">
#{contactNumber,jdbcType=VARCHAR},
</if>
<if test="contactEmail != null and contactEmail != ''">
#{contactEmail,jdbcType=VARCHAR},
</if>
<if test="province != null">
#{province,jdbcType=INTEGER},
</if>
<if test="city != null">
#{city,jdbcType=INTEGER},
</if>
<if test="address != null and address != ''">
#{address,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=TINYINT},
</if>
<if test="publicKey != null and publicKey != ''">
#{publicKey,jdbcType=VARCHAR},
</if>
<if test="privateKey != null and privateKey != ''">
#{privateKey,jdbcType=VARCHAR},
</if>
<if test="channelNumber != null and channelNumber != ''">
#{channelNumber,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
#{createBy,jdbcType=INTEGER},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=INTEGER},
</if>
<if test="remark != null and remark != ''">
#{remark,jdbcType=VARCHAR},
</if>
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
<if test="customerName != null and customerName != ''">
customer_name = #{customerName,jdbcType=VARCHAR},
</if>
<if test="contactPerson != null and contactPerson != ''">
contact_person = #{contactPerson,jdbcType=VARCHAR},
</if>
<if test="password != null and password != ''">
`password` = #{password,jdbcType=VARCHAR},
</if>
<if test="contactNumber != null and contactNumber != ''">
contact_number = #{contactNumber,jdbcType=VARCHAR},
</if>
<if test="contactEmail != null and contactEmail != ''">
contact_email = #{contactEmail,jdbcType=VARCHAR},
</if>
<if test="province != null">
province = #{province,jdbcType=INTEGER},
</if>
<if test="city != null">
city = #{city,jdbcType=INTEGER},
</if>
<if test="address != null and address != ''">
address = #{address,jdbcType=VARCHAR},
</if>
<if test="status != null">
`status` = #{status,jdbcType=TINYINT},
</if>
<if test="publicKey != null and publicKey != ''">
public_key = #{publicKey,jdbcType=VARCHAR},
</if>
<if test="privateKey != null and privateKey != ''">
private_key = #{privateKey,jdbcType=VARCHAR},
</if>
<if test="channelNumber != null and channelNumber != ''">
channel_number = #{channelNumber,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=INTEGER},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=INTEGER},
</if>
<if test="remark != null and remark != ''">
remark = #{remark,jdbcType=VARCHAR},
</if>
</trim>
</insert>
</mapper>
\ No newline at end of file \ No newline at end of file
<?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.glsx.mapper.PlatformDeviceMapper">
<resultMap id="BaseResultMap" type="com.glsx.model.PlatformDevice">
<!--@mbg.generated-->
<!--@Table t_platform_device-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="device_sn" jdbcType="VARCHAR" property="deviceSn" />
<result column="device_type" jdbcType="VARCHAR" property="deviceType" />
<result column="customer_id" jdbcType="INTEGER" property="customerId" />
<result column="customer_name" jdbcType="INTEGER" property="customerName" />
<result column="activat_time" jdbcType="TIMESTAMP" property="activatTime" />
<result column="status" jdbcType="TINYINT" property="status" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="create_by" jdbcType="INTEGER" property="createBy" />
<result column="update_by" jdbcType="INTEGER" property="updateBy" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, device_sn, device_type, customer_id, activat_time, `status`, create_time, update_time,
create_by, update_by, remark
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List" />
from t_platform_device
where id = #{id,jdbcType=INTEGER}
</select>
<select id="getDeviceMgrList" parameterType="com.glsx.vo.DeviceVo" resultMap="BaseResultMap">
select
a.id,
a.device_sn,
a.device_type,
b.customer_name,
a.activat_time,
a.`status`,
a.create_time,
a.update_time,
a.create_by,
a.update_by,
a.remark
from t_platform_device a
left join t_platform_customer b
on a.customer_id = b.id
where 1 = 1
<if test="customerName != null and customerName != '' ">
and b.customer_name = #{customerName,jdbcType=VARCHAR}
</if>
<if test="deviceType != null and deviceType != '' ">
and a.device_type = #{deviceType,jdbcType=VARCHAR}
</if>
<if test="activatStartTime != null and activatStartTime != '' ">
and a.create_time &gt;= #{accessStartTime,jdbcType=TIMESTAMP}
</if>
<if test="activatEndTime != null and activatEndTime != '' ">
and a.create_time &lt;= #{accessEndTime,jdbcType=TIMESTAMP}
</if>
</select>
<select id="getDeviceTypeList" resultType="java.lang.String">
select distinct
device_type
from t_platform_device
</select>
<select id="getDeviceCount" resultType="java.lang.Integer">
select count(1)
from t_platform_device
</select>
<select id="getDeviceGraphData" resultType="java.util.Map">
select
device_type,
count(id)
from t_platform_device
group by device_type
</select>
<select id="getDeviceCountAuth" resultType="java.lang.Integer">
select count(1)
from t_platform_device a
left join t_platform_customer b
on a.customer_id = b.id
where b.customer_name = #{customerName,jdbcType=VARCHAR}
</select>
<select id="getDeviceAccessTrendList" resultType="java.util.Map">
select
date_format(activat_time,'%Y-%m-%d') as activat_time,
count(id)
from t_platform_device
group by activat_time
</select>
<select id="getDeviceActivationStatistic" resultType="map">
select date_format(pd.activat_time, '%Y-%m-%d') `time`,
count(pd.activat_time) `count`
from t_platform_device pd
left join t_platform_customer pc on pc.id = pd.customer_id
<where>
pd.activat_time >= #{startTime,jdbcType=TIMESTAMP}
and pd.activat_time &lt; #{endTime,jdbcType=TIMESTAMP}
<if test="customerName != null and customerName != ''">
and pc.customer_name = #{customerName,jdbcType=VARCHAR}
</if>
</where>
group by time
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--@mbg.generated-->
delete from t_platform_device
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.glsx.model.PlatformDevice" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into t_platform_device (device_sn, device_type, customer_id,
activat_time, `status`, create_time,
update_time, create_by, update_by,
remark)
values (#{deviceSn,jdbcType=VARCHAR}, #{deviceType,jdbcType=VARCHAR}, #{customerId,jdbcType=INTEGER},
#{activatTime,jdbcType=TIMESTAMP}, #{status,jdbcType=TINYINT}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{createBy,jdbcType=INTEGER}, #{updateBy,jdbcType=INTEGER},
#{remark,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.glsx.model.PlatformDevice" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into t_platform_device
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="deviceSn != null and deviceSn != ''">
device_sn,
</if>
<if test="deviceType != null and deviceType != ''">
device_type,
</if>
<if test="customerId != null">
customer_id,
</if>
<if test="activatTime != null">
activat_time,
</if>
<if test="status != null">
`status`,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="remark != null and remark != ''">
remark,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="deviceSn != null and deviceSn != ''">
#{deviceSn,jdbcType=VARCHAR},
</if>
<if test="deviceType != null and deviceType != ''">
#{deviceType,jdbcType=VARCHAR},
</if>
<if test="customerId != null">
#{customerId,jdbcType=INTEGER},
</if>
<if test="activatTime != null">
#{activatTime,jdbcType=TIMESTAMP},
</if>
<if test="status != null">
#{status,jdbcType=TINYINT},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
#{createBy,jdbcType=INTEGER},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=INTEGER},
</if>
<if test="remark != null and remark != ''">
#{remark,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.glsx.model.PlatformDevice">
<!--@mbg.generated-->
update t_platform_device
<set>
<if test="deviceSn != null and deviceSn != ''">
device_sn = #{deviceSn,jdbcType=VARCHAR},
</if>
<if test="deviceType != null and deviceType != ''">
device_type = #{deviceType,jdbcType=VARCHAR},
</if>
<if test="customerId != null">
customer_id = #{customerId,jdbcType=INTEGER},
</if>
<if test="activatTime != null">
activat_time = #{activatTime,jdbcType=TIMESTAMP},
</if>
<if test="status != null">
`status` = #{status,jdbcType=TINYINT},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=INTEGER},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=INTEGER},
</if>
<if test="remark != null and remark != ''">
remark = #{remark,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.glsx.model.PlatformDevice">
<!--@mbg.generated-->
update t_platform_device
set device_sn = #{deviceSn,jdbcType=VARCHAR},
device_type = #{deviceType,jdbcType=VARCHAR},
customer_id = #{customerId,jdbcType=INTEGER},
activat_time = #{activatTime,jdbcType=TIMESTAMP},
`status` = #{status,jdbcType=TINYINT},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
create_by = #{createBy,jdbcType=INTEGER},
update_by = #{updateBy,jdbcType=INTEGER},
remark = #{remark,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateBatch" parameterType="java.util.List">
<!--@mbg.generated-->
update t_platform_device
<trim prefix="set" suffixOverrides=",">
<trim prefix="device_sn = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.deviceSn,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="device_type = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.deviceType,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="customer_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.customerId,jdbcType=INTEGER}
</foreach>
</trim>
<trim prefix="activat_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.activatTime,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="`status` = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.status,jdbcType=TINYINT}
</foreach>
</trim>
<trim prefix="create_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="update_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="create_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.createBy,jdbcType=INTEGER}
</foreach>
</trim>
<trim prefix="update_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateBy,jdbcType=INTEGER}
</foreach>
</trim>
<trim prefix="remark = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.remark,jdbcType=VARCHAR}
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=INTEGER}
</foreach>
</update>
<update id="updateBatchSelective" parameterType="java.util.List">
<!--@mbg.generated-->
update t_platform_device
<trim prefix="set" suffixOverrides=",">
<trim prefix="device_sn = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.deviceSn != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.deviceSn,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="device_type = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.deviceType != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.deviceType,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="customer_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.customerId != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.customerId,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="activat_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.activatTime != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.activatTime,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="`status` = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.status != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.status,jdbcType=TINYINT}
</if>
</foreach>
</trim>
<trim prefix="create_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.createTime != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="update_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.updateTime != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="create_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.createBy != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.createBy,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="update_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.updateBy != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateBy,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="remark = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.remark != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.remark,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=INTEGER}
</foreach>
</update>
<insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into t_platform_device
(device_sn, device_type, customer_id, activat_time, `status`, create_time, update_time,
create_by, update_by, remark)
values
<foreach collection="list" item="item" separator=",">
(#{item.deviceSn,jdbcType=VARCHAR}, #{item.deviceType,jdbcType=VARCHAR}, #{item.customerId,jdbcType=INTEGER},
#{item.activatTime,jdbcType=TIMESTAMP}, #{item.status,jdbcType=TINYINT}, #{item.createTime,jdbcType=TIMESTAMP},
#{item.updateTime,jdbcType=TIMESTAMP}, #{item.createBy,jdbcType=INTEGER}, #{item.updateBy,jdbcType=INTEGER},
#{item.remark,jdbcType=VARCHAR})
</foreach>
</insert>
<insert id="insertOrUpdate" keyColumn="id" keyProperty="id" parameterType="com.glsx.model.PlatformDevice" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into t_platform_device
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
device_sn,
device_type,
customer_id,
activat_time,
`status`,
create_time,
update_time,
create_by,
update_by,
remark,
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
#{deviceSn,jdbcType=VARCHAR},
#{deviceType,jdbcType=VARCHAR},
#{customerId,jdbcType=INTEGER},
#{activatTime,jdbcType=TIMESTAMP},
#{status,jdbcType=TINYINT},
#{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP},
#{createBy,jdbcType=INTEGER},
#{updateBy,jdbcType=INTEGER},
#{remark,jdbcType=VARCHAR},
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
device_sn = #{deviceSn,jdbcType=VARCHAR},
device_type = #{deviceType,jdbcType=VARCHAR},
customer_id = #{customerId,jdbcType=INTEGER},
activat_time = #{activatTime,jdbcType=TIMESTAMP},
`status` = #{status,jdbcType=TINYINT},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
create_by = #{createBy,jdbcType=INTEGER},
update_by = #{updateBy,jdbcType=INTEGER},
remark = #{remark,jdbcType=VARCHAR},
</trim>
</insert>
<insert id="insertOrUpdateSelective" keyColumn="id" keyProperty="id" parameterType="com.glsx.model.PlatformDevice" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into t_platform_device
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="deviceSn != null and deviceSn != ''">
device_sn,
</if>
<if test="deviceType != null and deviceType != ''">
device_type,
</if>
<if test="customerId != null">
customer_id,
</if>
<if test="activatTime != null">
activat_time,
</if>
<if test="status != null">
`status`,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="remark != null and remark != ''">
remark,
</if>
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="deviceSn != null and deviceSn != ''">
#{deviceSn,jdbcType=VARCHAR},
</if>
<if test="deviceType != null and deviceType != ''">
#{deviceType,jdbcType=VARCHAR},
</if>
<if test="customerId != null">
#{customerId,jdbcType=INTEGER},
</if>
<if test="activatTime != null">
#{activatTime,jdbcType=TIMESTAMP},
</if>
<if test="status != null">
#{status,jdbcType=TINYINT},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
#{createBy,jdbcType=INTEGER},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=INTEGER},
</if>
<if test="remark != null and remark != ''">
#{remark,jdbcType=VARCHAR},
</if>
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
<if test="deviceSn != null and deviceSn != ''">
device_sn = #{deviceSn,jdbcType=VARCHAR},
</if>
<if test="deviceType != null and deviceType != ''">
device_type = #{deviceType,jdbcType=VARCHAR},
</if>
<if test="customerId != null">
customer_id = #{customerId,jdbcType=INTEGER},
</if>
<if test="activatTime != null">
activat_time = #{activatTime,jdbcType=TIMESTAMP},
</if>
<if test="status != null">
`status` = #{status,jdbcType=TINYINT},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=INTEGER},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=INTEGER},
</if>
<if test="remark != null and remark != ''">
remark = #{remark,jdbcType=VARCHAR},
</if>
</trim>
</insert>
</mapper>
\ No newline at end of file \ No newline at end of file
<?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.glsx.mapper.PlatformUserMapper">
<resultMap id="BaseResultMap" type="com.glsx.model.PlatformUser">
<!--@mbg.generated-->
<!--@Table t_platform_user-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="nickname" jdbcType="VARCHAR" property="nickname" />
<result column="contact_number" jdbcType="VARCHAR" property="contactNumber" />
<result column="wechat_id" jdbcType="VARCHAR" property="wechatId" />
<result column="province" jdbcType="INTEGER" property="province" />
<result column="city" jdbcType="INTEGER" property="city" />
<result column="customer_id" jdbcType="INTEGER" property="customerId" />
<result column="customer_name" jdbcType="INTEGER" property="customerName" />
<result column="last_login_time" jdbcType="TIMESTAMP" property="lastLoginTime" />
<result column="app_account_id" jdbcType="INTEGER" property="appAccountId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="create_by" jdbcType="INTEGER" property="createBy" />
<result column="update_by" jdbcType="INTEGER" property="updateBy" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, nickname, contact_number, wechat_id, province, city, customer_id, last_login_time,
app_account_id, create_time, update_time, create_by, update_by, remark
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List" />
from t_platform_user
where id = #{id,jdbcType=INTEGER}
</select>
<select id="getUserMgrList" parameterType="com.glsx.vo.UserVo" resultMap="BaseResultMap">
select
a.id,
a.nickname,
a.contact_number,
a.wechat_id,
a.province,
a.city,
b.customer_name,
a.last_login_time,
a.app_account_id,
a.create_time,
a.update_time,
a.create_by,
a.update_by,
a.remark
from t_platform_user a
left join t_platform_customer b
on a.customer_id = b.id
where 1 = 1
<if test="customerName != null and customerName != '' ">
and b.customer_name = #{customerName,jdbcType=VARCHAR}
</if>
<if test="registerStartTime != null and registerStartTime != '' ">
and a.create_time &gt;= #{registerStartTime,jdbcType=VARCHAR}
</if>
<if test="registerEndTime != null and registerEndTime != '' ">
and a.create_time &lt;= #{registerEndTime,jdbcType=VARCHAR}
</if>
</select>
<select id="getUserCount" resultType="java.lang.Integer">
select count(1)
from t_platform_user
</select>
<select id="getUserCountAuth" resultType="java.lang.Integer">
select count(1)
from t_platform_user a
left join t_platform_customer b
on a.customer_id = b.id
where b.customer_name = #{customerName,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--@mbg.generated-->
delete from t_platform_user
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.glsx.model.PlatformUser" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into t_platform_user (nickname, contact_number, wechat_id,
province, city, customer_id,
last_login_time, app_account_id, create_time,
update_time, create_by, update_by,
remark)
values (#{nickname,jdbcType=VARCHAR}, #{contactNumber,jdbcType=VARCHAR}, #{wechatId,jdbcType=VARCHAR},
#{province,jdbcType=INTEGER}, #{city,jdbcType=INTEGER}, #{customerId,jdbcType=INTEGER},
#{lastLoginTime,jdbcType=TIMESTAMP}, #{appAccountId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{createBy,jdbcType=INTEGER}, #{updateBy,jdbcType=INTEGER},
#{remark,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.glsx.model.PlatformUser" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into t_platform_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="nickname != null and nickname != ''">
nickname,
</if>
<if test="contactNumber != null and contactNumber != ''">
contact_number,
</if>
<if test="wechatId != null and wechatId != ''">
wechat_id,
</if>
<if test="province != null">
province,
</if>
<if test="city != null">
city,
</if>
<if test="customerId != null">
customer_id,
</if>
<if test="lastLoginTime != null">
last_login_time,
</if>
<if test="appAccountId != null">
app_account_id,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="remark != null and remark != ''">
remark,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="nickname != null and nickname != ''">
#{nickname,jdbcType=VARCHAR},
</if>
<if test="contactNumber != null and contactNumber != ''">
#{contactNumber,jdbcType=VARCHAR},
</if>
<if test="wechatId != null and wechatId != ''">
#{wechatId,jdbcType=VARCHAR},
</if>
<if test="province != null">
#{province,jdbcType=INTEGER},
</if>
<if test="city != null">
#{city,jdbcType=INTEGER},
</if>
<if test="customerId != null">
#{customerId,jdbcType=INTEGER},
</if>
<if test="lastLoginTime != null">
#{lastLoginTime,jdbcType=TIMESTAMP},
</if>
<if test="appAccountId != null">
#{appAccountId,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
#{createBy,jdbcType=INTEGER},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=INTEGER},
</if>
<if test="remark != null and remark != ''">
#{remark,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.glsx.model.PlatformUser">
<!--@mbg.generated-->
update t_platform_user
<set>
<if test="nickname != null and nickname != ''">
nickname = #{nickname,jdbcType=VARCHAR},
</if>
<if test="contactNumber != null and contactNumber != ''">
contact_number = #{contactNumber,jdbcType=VARCHAR},
</if>
<if test="wechatId != null and wechatId != ''">
wechat_id = #{wechatId,jdbcType=VARCHAR},
</if>
<if test="province != null">
province = #{province,jdbcType=INTEGER},
</if>
<if test="city != null">
city = #{city,jdbcType=INTEGER},
</if>
<if test="customerId != null">
customer_id = #{customerId,jdbcType=INTEGER},
</if>
<if test="lastLoginTime != null">
last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP},
</if>
<if test="appAccountId != null">
app_account_id = #{appAccountId,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=INTEGER},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=INTEGER},
</if>
<if test="remark != null and remark != ''">
remark = #{remark,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.glsx.model.PlatformUser">
<!--@mbg.generated-->
update t_platform_user
set nickname = #{nickname,jdbcType=VARCHAR},
contact_number = #{contactNumber,jdbcType=VARCHAR},
wechat_id = #{wechatId,jdbcType=VARCHAR},
province = #{province,jdbcType=INTEGER},
city = #{city,jdbcType=INTEGER},
customer_id = #{customerId,jdbcType=INTEGER},
last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP},
app_account_id = #{appAccountId,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
create_by = #{createBy,jdbcType=INTEGER},
update_by = #{updateBy,jdbcType=INTEGER},
remark = #{remark,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateBatch" parameterType="java.util.List">
<!--@mbg.generated-->
update t_platform_user
<trim prefix="set" suffixOverrides=",">
<trim prefix="nickname = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.nickname,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="contact_number = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.contactNumber,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="wechat_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.wechatId,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="province = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.province,jdbcType=INTEGER}
</foreach>
</trim>
<trim prefix="city = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.city,jdbcType=INTEGER}
</foreach>
</trim>
<trim prefix="customer_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.customerId,jdbcType=INTEGER}
</foreach>
</trim>
<trim prefix="last_login_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.lastLoginTime,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="app_account_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.appAccountId,jdbcType=INTEGER}
</foreach>
</trim>
<trim prefix="create_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="update_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="create_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.createBy,jdbcType=INTEGER}
</foreach>
</trim>
<trim prefix="update_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateBy,jdbcType=INTEGER}
</foreach>
</trim>
<trim prefix="remark = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.remark,jdbcType=VARCHAR}
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=INTEGER}
</foreach>
</update>
<update id="updateBatchSelective" parameterType="java.util.List">
<!--@mbg.generated-->
update t_platform_user
<trim prefix="set" suffixOverrides=",">
<trim prefix="nickname = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.nickname != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.nickname,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="contact_number = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.contactNumber != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.contactNumber,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="wechat_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.wechatId != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.wechatId,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="province = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.province != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.province,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="city = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.city != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.city,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="customer_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.customerId != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.customerId,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="last_login_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.lastLoginTime != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.lastLoginTime,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="app_account_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.appAccountId != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.appAccountId,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="create_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.createTime != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="update_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.updateTime != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="create_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.createBy != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.createBy,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="update_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.updateBy != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateBy,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="remark = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.remark != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.remark,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=INTEGER}
</foreach>
</update>
<insert id="insertOrUpdate" keyColumn="id" keyProperty="id" parameterType="com.glsx.model.PlatformUser" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into t_platform_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
nickname,
contact_number,
wechat_id,
province,
city,
customer_id,
last_login_time,
app_account_id,
create_time,
update_time,
create_by,
update_by,
remark,
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
#{nickname,jdbcType=VARCHAR},
#{contactNumber,jdbcType=VARCHAR},
#{wechatId,jdbcType=VARCHAR},
#{province,jdbcType=INTEGER},
#{city,jdbcType=INTEGER},
#{customerId,jdbcType=INTEGER},
#{lastLoginTime,jdbcType=TIMESTAMP},
#{appAccountId,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP},
#{createBy,jdbcType=INTEGER},
#{updateBy,jdbcType=INTEGER},
#{remark,jdbcType=VARCHAR},
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
nickname = #{nickname,jdbcType=VARCHAR},
contact_number = #{contactNumber,jdbcType=VARCHAR},
wechat_id = #{wechatId,jdbcType=VARCHAR},
province = #{province,jdbcType=INTEGER},
city = #{city,jdbcType=INTEGER},
customer_id = #{customerId,jdbcType=INTEGER},
last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP},
app_account_id = #{appAccountId,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
create_by = #{createBy,jdbcType=INTEGER},
update_by = #{updateBy,jdbcType=INTEGER},
remark = #{remark,jdbcType=VARCHAR},
</trim>
</insert>
<insert id="insertOrUpdateSelective" keyColumn="id" keyProperty="id" parameterType="com.glsx.model.PlatformUser" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into t_platform_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="nickname != null and nickname != ''">
nickname,
</if>
<if test="contactNumber != null and contactNumber != ''">
contact_number,
</if>
<if test="wechatId != null and wechatId != ''">
wechat_id,
</if>
<if test="province != null">
province,
</if>
<if test="city != null">
city,
</if>
<if test="customerId != null">
customer_id,
</if>
<if test="lastLoginTime != null">
last_login_time,
</if>
<if test="appAccountId != null">
app_account_id,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="remark != null and remark != ''">
remark,
</if>
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="nickname != null and nickname != ''">
#{nickname,jdbcType=VARCHAR},
</if>
<if test="contactNumber != null and contactNumber != ''">
#{contactNumber,jdbcType=VARCHAR},
</if>
<if test="wechatId != null and wechatId != ''">
#{wechatId,jdbcType=VARCHAR},
</if>
<if test="province != null">
#{province,jdbcType=INTEGER},
</if>
<if test="city != null">
#{city,jdbcType=INTEGER},
</if>
<if test="customerId != null">
#{customerId,jdbcType=INTEGER},
</if>
<if test="lastLoginTime != null">
#{lastLoginTime,jdbcType=TIMESTAMP},
</if>
<if test="appAccountId != null">
#{appAccountId,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
#{createBy,jdbcType=INTEGER},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=INTEGER},
</if>
<if test="remark != null and remark != ''">
#{remark,jdbcType=VARCHAR},
</if>
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
<if test="nickname != null and nickname != ''">
nickname = #{nickname,jdbcType=VARCHAR},
</if>
<if test="contactNumber != null and contactNumber != ''">
contact_number = #{contactNumber,jdbcType=VARCHAR},
</if>
<if test="wechatId != null and wechatId != ''">
wechat_id = #{wechatId,jdbcType=VARCHAR},
</if>
<if test="province != null">
province = #{province,jdbcType=INTEGER},
</if>
<if test="city != null">
city = #{city,jdbcType=INTEGER},
</if>
<if test="customerId != null">
customer_id = #{customerId,jdbcType=INTEGER},
</if>
<if test="lastLoginTime != null">
last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP},
</if>
<if test="appAccountId != null">
app_account_id = #{appAccountId,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=INTEGER},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=INTEGER},
</if>
<if test="remark != null and remark != ''">
remark = #{remark,jdbcType=VARCHAR},
</if>
</trim>
</insert>
</mapper>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!