| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224 |
- <?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.dao.AppMapper">
- <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,
- revenue_display_rate,
- enabled
- )
- values
- (
- #{appId},
- #{appKey},
- #{appName},
- #{userId},
- #{appType},
- #{apkUrl},
- #{qrCode},
- #{versionCode},
- #{updateTips},
- #{storeOnSale},
- #{storeType},
- #{packageName},
- #{domain},
- #{category},
- #{subCategory},
- #{coppa},
- #{screenOrientation},
- #{ccpa},
- #{storeUrl},
- #{ditchId},
- #{ditchName},
- #{superiorId},
- #{revenueDisplayRate},
- #{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="revenueDisplayRate != null">
- revenue_display_rate = #{revenueDisplayRate},
- </if>
- <if test="superiorId != null">
- superior_id = #{superiorId}
- </if>
- </set>
- where app_id = #{appId}
- </update>
- <update id="deleteApp">
- update yt_app set enabled = 0 where app_id = #{appId}
- </update>
- <update id="deleteAppIds">
- update yt_app set enabled = 0
- where app_id in <foreach collection="ids" item="id" open="(" separator="," close=")" >#{id}</foreach>
- </update>
- <delete id="deleteRisks">
- delete from yt_risk_config where config_id in (
- select yt_risk_template_config.config_id
- from yt_risk_template_config
- left join yt_risk_template on yt_risk_template_config.template_id = yt_risk_template.template_id
- where yt_risk_template.app_id in <foreach collection="ids" item="appId" open="(" separator="," close=")">#{appId}</foreach>
- );
- delete from yt_risk_template_config where template_id in (
- select yt_risk_template.template_id
- from yt_risk_template
- where yt_risk_template.app_id in <foreach collection="ids" item="appId" open="(" separator="," close=")">#{appId}</foreach>
- );
- delete from yt_cofig_app
- where app_id in <foreach collection="ids" item="appId" open="(" separator="," close=")">#{appId}</foreach>;
- delete from yt_risk_template
- where app_id in <foreach collection="ids" item="appId" open="(" separator="," close=")">#{appId}</foreach>;
- </delete>
- <select id="selectPrimary" resultType="com.ytpm.agent.model.YtApp">
- select
- app_id,ditch_id, ditch_name, app_key, app_name,user_id, app_type, apk_url, qr_code, version_code, update_tips, enabled,superior_id
- from yt_app
- where app_id = #{appId}
- </select>
- <select id="queryAll" resultType="com.ytpm.agent.model.YtApp">
- select
- app_id, ditch_id, ditch_name, 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, superior_id
- from yt_app
- where user_id = #{userId}
- </select>
- <select id="selectByDitchId" resultType="com.ytpm.agent.model.YtApp">
- select
- app_id, ditch_id, ditch_name, app_key, app_name,user_id, app_type, apk_url, qr_code, version_code, update_tips, enabled,ditch_name,ditch_id
- from yt_app
- where ditch_id = #{ditchId} and enabled = 1
- </select>
- <select id="getAppList" resultType="com.ytpm.middle.view.AppListVO">
- select
- pua.app_id,
- pua.app_name,
- pua.user_id,
- pua.app_type,
- pua.detail_url,
- pua.package_name,
- pua.domain,
- pua.issued_time,
- pua.wx_app_id,
- pua.wx_secret,
- me.enterprise_name,
- me.legal,
- me.concat_phone,
- me.credit_code
- from yt_platform_user_app pua
- left join yt_middle_enterprise me on pua.user_id = me.user_id
- <where>
- pua.available = 1
- <if test="appType != null">
- and pua.app_type = #{appType}
- </if>
- <if test="appName != null and appName!=''">
- and pua.app_name like concat('%', #{appName} ,'%')
- </if>
- </where>
- order by
- pua.issued_time
- </select>
- <select id="getByDitchIdAndSuperiorId" resultType="com.ytpm.agent.model.YtApp">
- 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 superior_id = #{superiorId} and ditch_id = #{ditchId} and enabled = 1
- </select>
- <select id="getBySuperiorId" resultType="com.ytpm.agent.model.YtApp">
- 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 superior_id = #{superiorId} and enabled = 1
- </select>
- <select id="getByAppName" resultType="com.ytpm.agent.model.YtApp">
- 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 app_name = #{appName} and enabled = 1
- </select>
- </mapper>
|