You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
113 lines
5.0 KiB
113 lines
5.0 KiB
<?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.cjy.douyin.mapper.DouyingConfigMapper">
|
|
|
|
<resultMap type="DouyingConfig" id="DouyingConfigResult">
|
|
<result property="id" column="id" />
|
|
<result property="clientId" column="client_id" />
|
|
<result property="clientSecret" column="client_secret" />
|
|
<result property="redirectUri" column="redirect_uri" />
|
|
<result property="organCode" column="organ_code" />
|
|
<result property="mediaId" column="media_id" />
|
|
<result property="state" column="state" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="delFlag" column="del_flag" />
|
|
</resultMap>
|
|
|
|
<sql id="selectDouyingConfigVo">
|
|
select id, client_id, client_secret, redirect_uri, organ_code, media_id, state, create_time, del_flag from douying_config
|
|
</sql>
|
|
|
|
<select id="selectDouyingConfigList" parameterType="DouyingConfig" resultMap="DouyingConfigResult">
|
|
|
|
|
|
|
|
SELECT
|
|
t1.id,
|
|
t1.client_id,
|
|
t1.client_secret,
|
|
t1.redirect_uri,
|
|
t1.organ_code,
|
|
t1.media_id,
|
|
t1.state,
|
|
t1.create_time,
|
|
t1.del_flag,
|
|
t2.organ_name AS organName,
|
|
t3.`name` AS mediaName
|
|
FROM
|
|
douying_config t1
|
|
LEFT JOIN ti_enterprise_info t2 ON t1.organ_code = t2.organ_code
|
|
LEFT JOIN md_marketing_media_config t3 ON t1.media_id = t3.id
|
|
<where>
|
|
<if test="clientId != null "> and t1.client_id = #{clientId}</if>
|
|
<if test="clientSecret != null and clientSecret != ''"> and t1.client_secret = #{clientSecret}</if>
|
|
<if test="redirectUri != null and redirectUri != ''"> and t1.redirect_uri = #{redirectUri}</if>
|
|
<if test="organCode != null "> and t1.organ_code = #{organCode}</if>
|
|
<if test="mediaId != null "> and t1.media_id = #{mediaId}</if>
|
|
<if test="state != null "> and t1.state = #{state}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectDouyingConfigById" parameterType="Long" resultMap="DouyingConfigResult">
|
|
<include refid="selectDouyingConfigVo"/>
|
|
where id = #{id}
|
|
</select>
|
|
<select id="selectDouyinAuthorizedInfoByOpenId" resultType="java.lang.String">
|
|
SELECT
|
|
access_token as accessToken
|
|
FROM
|
|
douyin_authorized_info WHERE open_id=#{openid}
|
|
</select>
|
|
|
|
<insert id="insertDouyingConfig" parameterType="DouyingConfig" useGeneratedKeys="true" keyProperty="id">
|
|
insert into douying_config
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="clientId != null">client_id,</if>
|
|
<if test="clientSecret != null and clientSecret != ''">client_secret,</if>
|
|
<if test="redirectUri != null and redirectUri != ''">redirect_uri,</if>
|
|
<if test="organCode != null">organ_code,</if>
|
|
<if test="mediaId != null">media_id,</if>
|
|
<if test="state != null">state,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="delFlag != null">del_flag,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="clientId != null">#{clientId},</if>
|
|
<if test="clientSecret != null and clientSecret != ''">#{clientSecret},</if>
|
|
<if test="redirectUri != null and redirectUri != ''">#{redirectUri},</if>
|
|
<if test="organCode != null">#{organCode},</if>
|
|
<if test="mediaId != null">#{mediaId},</if>
|
|
<if test="state != null">#{state},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="delFlag != null">#{delFlag},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateDouyingConfig" parameterType="DouyingConfig">
|
|
update douying_config
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="clientId != null">client_id = #{clientId},</if>
|
|
<if test="clientSecret != null and clientSecret != ''">client_secret = #{clientSecret},</if>
|
|
<if test="redirectUri != null and redirectUri != ''">redirect_uri = #{redirectUri},</if>
|
|
<if test="organCode != null">organ_code = #{organCode},</if>
|
|
<if test="mediaId != null">media_id = #{mediaId},</if>
|
|
<if test="state != null">state = #{state},</if>
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteDouyingConfigById" parameterType="Long">
|
|
delete from douying_config where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteDouyingConfigByIds" parameterType="String">
|
|
delete from douying_config where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
</mapper> |