|
@@ -0,0 +1,158 @@
|
|
|
|
+<?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.ruixuan.jinniu.mapper.KuaishouAccountMapper">
|
|
|
|
+
|
|
|
|
+ <resultMap type="com.ruixuan.jinniu.entity.KuaishouAccount" id="KuaishouAccountResult">
|
|
|
|
+ <result property="id" column="id"/>
|
|
|
|
+ <result property="accountId" column="account_id"/>
|
|
|
|
+ <result property="accountName" column="account_name"/>
|
|
|
|
+ <result property="projectId" column="project_id"/>
|
|
|
|
+ <result property="projectName" column="project_name"/>
|
|
|
|
+ <result property="mediaCode" column="media_code"/>
|
|
|
|
+ <result property="ksId" column="ks_id"/>
|
|
|
|
+ <result property="ksName" column="ks_name"/>
|
|
|
|
+ <result property="operatorId" column="operator_id"/>
|
|
|
|
+ <result property="operatorLeader" column="operator_leader"/>
|
|
|
|
+ <result property="productName" column="product_name"/>
|
|
|
|
+ <result property="industry" column="industry"/>
|
|
|
|
+ <result property="secondIndustry" column="second_industry"/>
|
|
|
|
+ <result property="corporationName" column="corporation_name"/>
|
|
|
|
+ <result property="accountStatus" column="account_status"/>
|
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
|
+ <result property="updateTime" column="update_time"/>
|
|
|
|
+ </resultMap>
|
|
|
|
+
|
|
|
|
+ <sql id="selectKuaishouAccountVo">
|
|
|
|
+ select id,
|
|
|
|
+ account_id,
|
|
|
|
+ account_name,
|
|
|
|
+ project_id,
|
|
|
|
+ project_name,
|
|
|
|
+ media_code,
|
|
|
|
+ ks_id,
|
|
|
|
+ ks_name,
|
|
|
|
+ operator_id,
|
|
|
|
+ operator_leader,
|
|
|
|
+ product_name,
|
|
|
|
+ industry,
|
|
|
|
+ second_industry,
|
|
|
|
+ corporation_name,
|
|
|
|
+ account_status,
|
|
|
|
+ create_time,
|
|
|
|
+ update_time
|
|
|
|
+ from kuaishou_account
|
|
|
|
+ </sql>
|
|
|
|
+
|
|
|
|
+ <select id="selectKuaishouAccountList" parameterType="com.ruixuan.jinniu.entity.KuaishouAccount"
|
|
|
|
+ resultMap="KuaishouAccountResult">
|
|
|
|
+ <include refid="selectKuaishouAccountVo"/>
|
|
|
|
+ <where>
|
|
|
|
+ <if test="accountId != null ">and account_id = #{accountId}</if>
|
|
|
|
+ <if test="accountName != null and accountName != ''">and account_name like concat('%', #{accountName},
|
|
|
|
+ '%')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="projectId != null ">and project_id = #{projectId}</if>
|
|
|
|
+ <if test="projectName != null and projectName != ''">and project_name like concat('%', #{projectName},
|
|
|
|
+ '%')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="mediaCode != null and mediaCode != ''">and media_code = #{mediaCode}</if>
|
|
|
|
+ <if test="ksId != null ">and ks_id = #{ksId}</if>
|
|
|
|
+ <if test="ksName != null and ksName != ''">and ks_name like concat('%', #{ksName}, '%')</if>
|
|
|
|
+ <if test="operatorId != null and operatorId != ''">and operator_id = #{operatorId}</if>
|
|
|
|
+ <if test="operatorLeader != null and operatorLeader != ''">and operator_leader = #{operatorLeader}</if>
|
|
|
|
+ <if test="productName != null and productName != ''">and product_name like concat('%', #{productName},
|
|
|
|
+ '%')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="industry != null and industry != ''">and industry = #{industry}</if>
|
|
|
|
+ <if test="secondIndustry != null and secondIndustry != ''">and second_industry = #{secondIndustry}</if>
|
|
|
|
+ <if test="corporationName != null and corporationName != ''">and corporation_name like concat('%',
|
|
|
|
+ #{corporationName}, '%')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="accountStatus != null and accountStatus != ''">and account_status = #{accountStatus}</if>
|
|
|
|
+ </where>
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="selectKuaishouAccountById" parameterType="Long" resultMap="KuaishouAccountResult">
|
|
|
|
+ <include refid="selectKuaishouAccountVo"/>
|
|
|
|
+ where id = #{id}
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <insert id="insertKuaishouAccount" parameterType="com.ruixuan.jinniu.entity.KuaishouAccount" useGeneratedKeys="true"
|
|
|
|
+ keyProperty="id">
|
|
|
|
+ insert into kuaishou_account
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="accountId != null">account_id,</if>
|
|
|
|
+ <if test="accountName != null">account_name,</if>
|
|
|
|
+ <if test="projectId != null">project_id,</if>
|
|
|
|
+ <if test="projectName != null">project_name,</if>
|
|
|
|
+ <if test="mediaCode != null">media_code,</if>
|
|
|
|
+ <if test="ksId != null">ks_id,</if>
|
|
|
|
+ <if test="ksName != null">ks_name,</if>
|
|
|
|
+ <if test="operatorId != null">operator_id,</if>
|
|
|
|
+ <if test="operatorLeader != null">operator_leader,</if>
|
|
|
|
+ <if test="productName != null">product_name,</if>
|
|
|
|
+ <if test="industry != null">industry,</if>
|
|
|
|
+ <if test="secondIndustry != null">second_industry,</if>
|
|
|
|
+ <if test="corporationName != null">corporation_name,</if>
|
|
|
|
+ <if test="accountStatus != null">account_status,</if>
|
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
|
+ </trim>
|
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="accountId != null">#{accountId},</if>
|
|
|
|
+ <if test="accountName != null">#{accountName},</if>
|
|
|
|
+ <if test="projectId != null">#{projectId},</if>
|
|
|
|
+ <if test="projectName != null">#{projectName},</if>
|
|
|
|
+ <if test="mediaCode != null">#{mediaCode},</if>
|
|
|
|
+ <if test="ksId != null">#{ksId},</if>
|
|
|
|
+ <if test="ksName != null">#{ksName},</if>
|
|
|
|
+ <if test="operatorId != null">#{operatorId},</if>
|
|
|
|
+ <if test="operatorLeader != null">#{operatorLeader},</if>
|
|
|
|
+ <if test="productName != null">#{productName},</if>
|
|
|
|
+ <if test="industry != null">#{industry},</if>
|
|
|
|
+ <if test="secondIndustry != null">#{secondIndustry},</if>
|
|
|
|
+ <if test="corporationName != null">#{corporationName},</if>
|
|
|
|
+ <if test="accountStatus != null">#{accountStatus},</if>
|
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
|
+ </trim>
|
|
|
|
+ </insert>
|
|
|
|
+
|
|
|
|
+ <update id="updateKuaishouAccount" parameterType="com.ruixuan.jinniu.entity.KuaishouAccount">
|
|
|
|
+ update kuaishou_account
|
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
|
+ <if test="accountId != null">account_id = #{accountId},</if>
|
|
|
|
+ <if test="accountName != null">account_name = #{accountName},</if>
|
|
|
|
+ <if test="projectId != null">project_id = #{projectId},</if>
|
|
|
|
+ <if test="projectName != null">project_name = #{projectName},</if>
|
|
|
|
+ <if test="mediaCode != null">media_code = #{mediaCode},</if>
|
|
|
|
+ <if test="ksId != null">ks_id = #{ksId},</if>
|
|
|
|
+ <if test="ksName != null">ks_name = #{ksName},</if>
|
|
|
|
+ <if test="operatorId != null">operator_id = #{operatorId},</if>
|
|
|
|
+ <if test="operatorLeader != null">operator_leader = #{operatorLeader},</if>
|
|
|
|
+ <if test="productName != null">product_name = #{productName},</if>
|
|
|
|
+ <if test="industry != null">industry = #{industry},</if>
|
|
|
|
+ <if test="secondIndustry != null">second_industry = #{secondIndustry},</if>
|
|
|
|
+ <if test="corporationName != null">corporation_name = #{corporationName},</if>
|
|
|
|
+ <if test="accountStatus != null">account_status = #{accountStatus},</if>
|
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
|
+ </trim>
|
|
|
|
+ where id = #{id}
|
|
|
|
+ </update>
|
|
|
|
+
|
|
|
|
+ <delete id="deleteKuaishouAccountById" parameterType="Long">
|
|
|
|
+ delete
|
|
|
|
+ from kuaishou_account
|
|
|
|
+ where id = #{id}
|
|
|
|
+ </delete>
|
|
|
|
+
|
|
|
|
+ <delete id="deleteKuaishouAccountByIds" parameterType="String">
|
|
|
|
+ delete from kuaishou_account where id in
|
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
+ #{id}
|
|
|
|
+ </foreach>
|
|
|
|
+ </delete>
|
|
|
|
+</mapper>
|