| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201 |
- <?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.ytpm.middle.dao.ApkMapper">
- <select id="searchAppList" resultType="com.ytpm.agent.view.AgentAppView">
- SELECT
- ya.app_id,
- ya.app_key,
- ya.app_name,
- ya.superior_id,
- pua.app_name superiorName,
- ya.user_id,
- ya.app_type,
- ya.apk_url,
- ya.qr_code,
- ya.version_code,
- ya.update_tips,
- ya.enabled,
- ya.store_on_sale,
- ya.store_type,
- ya.store_url,
- ya.package_name,
- ya.domain,
- ya.category,
- ya.sub_category,
- ya.coppa,
- ya.ccpa,
- ya.screen_orientation,
- ya.ditch_name,
- ya.ditch_id,
- u.nick_name
- FROM
- yt_app ya
- JOIN yt_platform_user_app pua on ya.superior_id = pua.app_id
- LEFT JOIN yt_app_channel_relative acr ON ya.app_id = acr.app_id
- LEFT JOIN yt_platform_user u ON ya.user_id = u.user_id
- <where>
- <if test="channelName !=null and channelName != ''">
- and ya.ditch_name like concat('%', #{channelName} ,'%')
- </if>
- <if test="appName !=null and appName != ''">
- and ya.app_name like concat('%', #{appName} ,'%')
- </if>
- <if test="appType !=null">
- and ya.app_type = #{appType}
- </if>
- <if test="superiorId !=null and superiorId != ''">
- and ya.superior_id = #{superiorId}
- </if>
- </where>
- GROUP BY
- ya.app_id
- </select>
- <select id="countApk" resultType="java.lang.Integer">
- select
- count(app_id)
- from yt_app
- where apk_url is not null
- </select>
- <select id="getAppIds" resultType="java.lang.String">
- select
- group_concat(app_id)
- from yt_app
- where apk_url is not null
- </select>
- <select id="queryAll" resultType="com.ytpm.agent.view.AgentAppView">
- select
- app_id, app_key, app_name, user_id, app_type, apk_url, qr_code, version_code, update_tips, enabled, store_on_sale, store_type, store_url, package_name, domain, category, sub_category, coppa, screen_orientation, ccpa, feign_path, ditch_id, ditch_name, superior_id
- from yt_app
- where enabled = 1
- </select>
- <select id="queryBySuperiorId" resultType="com.ytpm.agent.view.AgentAppView">
- select
- app_id, app_key, app_name, user_id, app_type, apk_url, qr_code, version_code, update_tips, enabled, store_on_sale, store_type, store_url, package_name, domain, category, sub_category, coppa, screen_orientation, ccpa, feign_path, ditch_id, ditch_name, superior_id
- from yt_app
- where enabled = 1 and superior_id = #{superiorId}
- </select>
- <insert id="insertOne">
- insert into yt_app
- (
- app_id,
- app_key,
- app_name,
- user_id,
- app_type,
- apk_url,
- qr_code,
- version_code,
- update_tips,
- store_on_sale,
- store_type,
- package_name,
- domain,
- category,
- sub_category,
- coppa,
- screen_orientation,
- ccpa,
- store_url,
- ditch_id,
- ditch_name,
- superior_id,
- enabled
- )
- values
- (
- #{appId},
- #{appKey},
- #{appName},
- #{userId},
- #{appType},
- #{apkUrl},
- #{qrCode},
- #{versionCode},
- #{updateTips},
- #{storeOnSale},
- #{storeType},
- #{packageName},
- #{domain},
- #{category},
- #{subCategory},
- #{coppa},
- #{screenOrientation},
- #{ccpa},
- #{storeUrl},
- #{ditchId},
- #{ditchName},
- #{superiorId},
- #{enabled}
- )
- </insert>
- <update id="updateOne">
- update yt_app
- <set>
- <if test="appKey != null">
- app_key = #{appKey},
- </if>
- <if test="appName != null">
- app_name = #{appName},
- </if>
- <if test="appType != null">
- app_type = #{appType},
- </if>
- <if test="versionCode != null">
- version_code = #{versionCode},
- </if>
- <if test="updateTips != null">
- update_tips = #{updateTips},
- </if>
- <if test="enabled != null">
- enabled = #{enabled},
- </if>
- <if test="storeOnSale != null">
- store_on_sale = #{storeOnSale},
- </if>
- <if test="storeType != null">
- store_type = #{storeType},
- </if>
- <if test="storeUrl != null">
- store_url = #{storeUrl},
- </if>
- <if test="packageName != null">
- package_name = #{packageName},
- </if>
- <if test="domain != null">
- domain = #{domain},
- </if>
- <if test="category != null">
- category = #{category},
- </if>
- <if test="subCategory != null">
- sub_category = #{subCategory},
- </if>
- <if test="coppa != null">
- coppa = #{coppa},
- </if>
- <if test="screenOrientation != null">
- screen_orientation = #{screenOrientation},
- </if>
- <if test="ccpa != null">
- ccpa = #{ccpa},
- </if>
- <if test=" apkUrl != null">
- apk_url = #{apkUrl},
- </if>
- <if test="qrCode != null">
- qr_code = #{qrCode},
- </if>
- <if test="ditchId != null">
- ditch_id = #{ditchId},
- </if>
- <if test="ditchName != null">
- ditch_name = #{ditchName},
- </if>
- <if test="superiorId != null">
- superior_id = #{superiorId}
- </if>
- </set>
- where app_id = #{appId}
- </update>
- </mapper>
|