|
|
@@ -0,0 +1,111 @@
|
|
|
+<?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.fs.qw.mapper.QwAppMiniProgramRelationMapper">
|
|
|
+
|
|
|
+ <resultMap type="QwAppMiniProgramRelation" id="QwAppMiniProgramRelationResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="miniAppId" column="mini_app_id" />
|
|
|
+ <result property="miniAppName" column="mini_app_name" />
|
|
|
+ <result property="agentId" column="agent_id" />
|
|
|
+ <result property="corpId" column="corp_id" />
|
|
|
+ <result property="openSecret" column="open_secret" />
|
|
|
+ <result property="corpName" column="corp_name" />
|
|
|
+ <result property="status" column="status" />
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ <result property="remark" column="remark" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectQwAppMiniProgramRelationVo">
|
|
|
+ select id, mini_app_id, mini_app_name, agent_id, corp_id, open_secret, corp_name, status, create_by, update_by, create_time, update_time, remark from qw_app_mini_program_relation
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectQwAppMiniProgramRelationList" parameterType="QwAppMiniProgramRelation" resultMap="QwAppMiniProgramRelationResult">
|
|
|
+ <include refid="selectQwAppMiniProgramRelationVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="miniAppId != null and miniAppId != ''"> and mini_app_id = #{miniAppId}</if>
|
|
|
+ <if test="miniAppName != null and miniAppName != ''"> and mini_app_name like concat('%', #{miniAppName}, '%')</if>
|
|
|
+ <if test="agentId != null and agentId != ''"> and agent_id = #{agentId}</if>
|
|
|
+ <if test="corpId != null and corpId != ''"> and corp_id = #{corpId}</if>
|
|
|
+ <if test="openSecret != null and openSecret != ''"> and open_secret = #{openSecret}</if>
|
|
|
+ <if test="corpName != null and corpName != ''"> and corp_name like concat('%', #{corpName}, '%')</if>
|
|
|
+ <if test="status != null "> and status = #{status}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectQwAppMiniProgramRelationById" parameterType="Long" resultMap="QwAppMiniProgramRelationResult">
|
|
|
+ <include refid="selectQwAppMiniProgramRelationVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectQwAppMiniProgramRelationByAgentIdAndCorpId" resultMap="QwAppMiniProgramRelationResult">
|
|
|
+ <include refid="selectQwAppMiniProgramRelationVo"/>
|
|
|
+ WHERE agent_id=#{agentId} and corp_id=#{corpId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertQwAppMiniProgramRelation" parameterType="QwAppMiniProgramRelation" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into qw_app_mini_program_relation
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="miniAppId != null and miniAppId != ''">mini_app_id,</if>
|
|
|
+ <if test="miniAppName != null">mini_app_name,</if>
|
|
|
+ <if test="agentId != null and agentId != ''">agent_id,</if>
|
|
|
+ <if test="corpId != null">corp_id,</if>
|
|
|
+ <if test="openSecret != null">open_secret,</if>
|
|
|
+ <if test="corpName != null and corpName != ''">corp_name,</if>
|
|
|
+ <if test="status != null">status,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="remark != null">remark,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="miniAppId != null and miniAppId != ''">#{miniAppId},</if>
|
|
|
+ <if test="miniAppName != null">#{miniAppName},</if>
|
|
|
+ <if test="agentId != null and agentId != ''">#{agentId},</if>
|
|
|
+ <if test="corpId != null">#{corpId},</if>
|
|
|
+ <if test="openSecret != null">#{openSecret},</if>
|
|
|
+ <if test="corpName != null and corpName != ''">#{corpName},</if>
|
|
|
+ <if test="status != null">#{status},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateQwAppMiniProgramRelation" parameterType="QwAppMiniProgramRelation">
|
|
|
+ update qw_app_mini_program_relation
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="miniAppId != null and miniAppId != ''">mini_app_id = #{miniAppId},</if>
|
|
|
+ <if test="miniAppName != null">mini_app_name = #{miniAppName},</if>
|
|
|
+ <if test="agentId != null and agentId != ''">agent_id = #{agentId},</if>
|
|
|
+ <if test="corpId != null">corp_id = #{corpId},</if>
|
|
|
+ <if test="openSecret != null">open_secret = #{openSecret},</if>
|
|
|
+ <if test="corpName != null and corpName != ''">corp_name = #{corpName},</if>
|
|
|
+ <if test="status != null">status = #{status},</if>
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="remark != null">remark = #{remark},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteQwAppMiniProgramRelationById" parameterType="Long">
|
|
|
+ delete from qw_app_mini_program_relation where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteQwAppMiniProgramRelationByIds" parameterType="String">
|
|
|
+ delete from qw_app_mini_program_relation where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|