|
@@ -0,0 +1,218 @@
|
|
|
+<?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">
|
|
|
+
|
|
|
+<!-- 企业微信客户主体黑名单用户MyBatis映射文件 -->
|
|
|
+<mapper namespace="com.tzld.piaoquan.risk.control.dao.mapper.QywxCorpBlacklistUserMapper">
|
|
|
+
|
|
|
+ <!-- 基础结果映射 -->
|
|
|
+ <resultMap id="BaseResultMap" type="com.tzld.piaoquan.risk.control.model.po.QywxCorpBlacklistUser">
|
|
|
+ <id column="id" jdbcType="BIGINT" property="id" />
|
|
|
+ <result column="vid" jdbcType="BIGINT" property="vid" />
|
|
|
+ <result column="corp_id" jdbcType="BIGINT" property="corpId" />
|
|
|
+ <result column="black_time" jdbcType="TIMESTAMP" property="blackTime" />
|
|
|
+ <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <!-- 动态WHERE条件构建 -->
|
|
|
+ <sql id="Example_Where_Clause">
|
|
|
+ <where>
|
|
|
+ <foreach collection="oredCriteria" item="criteria" separator="or">
|
|
|
+ <if test="criteria.valid">
|
|
|
+ <trim prefix="(" prefixOverrides="and" suffix=")">
|
|
|
+ <foreach collection="criteria.criteria" item="criterion">
|
|
|
+ <choose>
|
|
|
+ <when test="criterion.noValue">
|
|
|
+ and ${criterion.condition}
|
|
|
+ </when>
|
|
|
+ <when test="criterion.singleValue">
|
|
|
+ and ${criterion.condition} #{criterion.value}
|
|
|
+ </when>
|
|
|
+ <when test="criterion.betweenValue">
|
|
|
+ and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
|
|
+ </when>
|
|
|
+ <when test="criterion.listValue">
|
|
|
+ and ${criterion.condition}
|
|
|
+ <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
|
|
+ #{listItem}
|
|
|
+ </foreach>
|
|
|
+ </when>
|
|
|
+ </choose>
|
|
|
+ </foreach>
|
|
|
+ </trim>
|
|
|
+ </if>
|
|
|
+ </foreach>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <!-- 基础字段列表 -->
|
|
|
+ <sql id="Base_Column_List">
|
|
|
+ id, vid, corp_id, black_time, create_time
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <!-- 根据条件查询记录列表 -->
|
|
|
+ <select id="selectByExample" parameterType="com.tzld.piaoquan.risk.control.model.po.QywxCorpBlacklistUserExample" resultMap="BaseResultMap">
|
|
|
+ select
|
|
|
+ <if test="distinct">
|
|
|
+ distinct
|
|
|
+ </if>
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ from qywx_corp_blacklist_user
|
|
|
+ <if test="_parameter != null">
|
|
|
+ <include refid="Example_Where_Clause" />
|
|
|
+ </if>
|
|
|
+ <if test="orderByClause != null">
|
|
|
+ order by ${orderByClause}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 根据主键查询单条记录 -->
|
|
|
+ <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ from qywx_corp_blacklist_user
|
|
|
+ where id = #{id,jdbcType=BIGINT}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 根据vid和corpId查询拉黑时间 -->
|
|
|
+ <select id="selectBlackTimeByVidAndCorpId" resultType="java.util.Date">
|
|
|
+ select black_time
|
|
|
+ from qywx_corp_blacklist_user
|
|
|
+ where vid = #{vid,jdbcType=BIGINT} and corp_id = #{corpId,jdbcType=BIGINT}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 根据主键删除记录 -->
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
|
|
+ delete from qywx_corp_blacklist_user
|
|
|
+ where id = #{id,jdbcType=BIGINT}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <!-- 根据条件批量删除记录 -->
|
|
|
+ <delete id="deleteByExample" parameterType="com.tzld.piaoquan.risk.control.model.po.QywxCorpBlacklistUserExample">
|
|
|
+ delete from qywx_corp_blacklist_user
|
|
|
+ <if test="_parameter != null">
|
|
|
+ <include refid="Example_Where_Clause" />
|
|
|
+ </if>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <!-- 插入完整记录 -->
|
|
|
+ <insert id="insert" parameterType="com.tzld.piaoquan.risk.control.model.po.QywxCorpBlacklistUser">
|
|
|
+ <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
|
|
|
+ SELECT LAST_INSERT_ID()
|
|
|
+ </selectKey>
|
|
|
+ insert into qywx_corp_blacklist_user (vid, corp_id, black_time, create_time)
|
|
|
+ values (#{vid,jdbcType=BIGINT}, #{corpId,jdbcType=BIGINT}, #{blackTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP})
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <!-- 选择性插入记录 -->
|
|
|
+ <insert id="insertSelective" parameterType="com.tzld.piaoquan.risk.control.model.po.QywxCorpBlacklistUser">
|
|
|
+ <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
|
|
|
+ SELECT LAST_INSERT_ID()
|
|
|
+ </selectKey>
|
|
|
+ insert into qywx_corp_blacklist_user
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="vid != null">
|
|
|
+ vid,
|
|
|
+ </if>
|
|
|
+ <if test="corpId != null">
|
|
|
+ corp_id,
|
|
|
+ </if>
|
|
|
+ <if test="blackTime != null">
|
|
|
+ black_time,
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ create_time,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="vid != null">
|
|
|
+ #{vid,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="corpId != null">
|
|
|
+ #{corpId,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="blackTime != null">
|
|
|
+ #{blackTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <!-- 根据条件统计记录数 -->
|
|
|
+ <select id="countByExample" parameterType="com.tzld.piaoquan.risk.control.model.po.QywxCorpBlacklistUserExample" resultType="java.lang.Long">
|
|
|
+ select count(*) from qywx_corp_blacklist_user
|
|
|
+ <if test="_parameter != null">
|
|
|
+ <include refid="Example_Where_Clause" />
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 根据条件选择性更新记录 -->
|
|
|
+ <update id="updateByExampleSelective" parameterType="map">
|
|
|
+ update qywx_corp_blacklist_user
|
|
|
+ <set>
|
|
|
+ <if test="record.id != null">
|
|
|
+ id = #{record.id,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="record.vid != null">
|
|
|
+ vid = #{record.vid,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="record.corpId != null">
|
|
|
+ corp_id = #{record.corpId,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="record.blackTime != null">
|
|
|
+ black_time = #{record.blackTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="record.createTime != null">
|
|
|
+ create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ <if test="_parameter != null">
|
|
|
+ <include refid="Example_Where_Clause" />
|
|
|
+ </if>
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <!-- 根据条件完整更新记录 -->
|
|
|
+ <update id="updateByExample" parameterType="map">
|
|
|
+ update qywx_corp_blacklist_user
|
|
|
+ set id = #{record.id,jdbcType=BIGINT},
|
|
|
+ vid = #{record.vid,jdbcType=BIGINT},
|
|
|
+ corp_id = #{record.corpId,jdbcType=BIGINT},
|
|
|
+ black_time = #{record.blackTime,jdbcType=TIMESTAMP},
|
|
|
+ create_time = #{record.createTime,jdbcType=TIMESTAMP}
|
|
|
+ <if test="_parameter != null">
|
|
|
+ <include refid="Example_Where_Clause" />
|
|
|
+ </if>
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <!-- 根据主键选择性更新记录 -->
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.tzld.piaoquan.risk.control.model.po.QywxCorpBlacklistUser">
|
|
|
+ update qywx_corp_blacklist_user
|
|
|
+ <set>
|
|
|
+ <if test="vid != null">
|
|
|
+ vid = #{vid,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="corpId != null">
|
|
|
+ corp_id = #{corpId,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="blackTime != null">
|
|
|
+ black_time = #{blackTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id = #{id,jdbcType=BIGINT}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <!-- 根据主键完整更新记录 -->
|
|
|
+ <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.risk.control.model.po.QywxCorpBlacklistUser">
|
|
|
+ update qywx_corp_blacklist_user
|
|
|
+ set vid = #{vid,jdbcType=BIGINT},
|
|
|
+ corp_id = #{corpId,jdbcType=BIGINT},
|
|
|
+ black_time = #{blackTime,jdbcType=TIMESTAMP},
|
|
|
+ create_time = #{createTime,jdbcType=TIMESTAMP}
|
|
|
+ where id = #{id,jdbcType=BIGINT}
|
|
|
+ </update>
|
|
|
+
|
|
|
+</mapper>
|