| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191 |
- <?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.AppMapper">
- <insert id="insertOne">
- insert into yt_platform_user_app
- (
- app_id,
- app_name,
- user_id,
- app_type,
- detail_url,
- package_name,
- domain,
- issued_time,
- wx_app_id,
- wx_secret,
- sale_price,
- create_user_id,
- create_time,
- available
- )
- values
- (
- #{appId},
- #{appName},
- #{userId},
- #{appType},
- #{detailUrl},
- #{packageName},
- #{domain},
- #{issuedTime},
- #{wxAppId},
- #{wxSecret},
- #{salePrice},
- #{createUserId},
- #{createTime},
- #{available}
- )
- </insert>
- <insert id="addGrantRecord">
- insert into yt_app_grant_record
- (
- record_id,
- app_id,
- user_id,
- sale_price,
- grant_type,
- ratio,
- data_charge,
- grant_time,
- operator_id,
- operator_time
- )
- values
- (
- #{recordId},
- #{appId},
- #{userId},
- #{salePrice},
- #{grantType},
- #{ratio},
- #{dataCharge},
- #{grantTime},
- #{operatorId},
- #{operateTime}
- );
- </insert>
- <update id="updateById">
- update yt_platform_user_app
- <set>
- <if test="appName != null">
- app_name = #{appName},
- </if>
- <if test="userId != null">
- user_id = #{userId},
- </if>
- <if test="appType != null">
- app_type = #{appType},
- </if>
- <if test="detailUrl != null">
- detail_url = #{detailUrl},
- </if>
- <if test="packageName != null">
- package_name = #{packageName},
- </if>
- <if test="domain != null">
- domain = #{domain},
- </if>
- <if test="issuedTime != null">
- issued_time = #{issuedTime},
- </if>
- <if test="wxAppId != null">
- wx_app_id = #{wxAppId},
- </if>
- <if test="wxSecret != null">
- wx_secret = #{wxSecret},
- </if>
- <if test="updateUserId != null">
- update_user_id = #{updateUserId},
- </if>
- <if test="updateTime != null">
- update_time = #{updateTime},
- </if>
- <if test="salePrice != null">
- sale_price = #{salePrice},
- </if>
- <if test="chargeStatus != null">
- charge_status = #{chargeStatus},
- </if>
- <if test="grantType != null">
- grant_type = #{grantType},
- </if>
- <if test="available != null">
- available = #{available}
- </if>
- </set>
- where app_id = #{appId}
- </update>
- <delete id="delApp">
- update yt_platform_user_app set available = 0, update_time = now(), update_user_id = #{userId} where app_id = #{appId}
- </delete>
- <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.sale_price,
- pua.grant_type,
- pua.issued_time,
- pua.wx_app_id,
- pua.wx_secret,
- me.enterprise_name,
- me.legal,
- me.concat_phone,
- me.credit_code,
- me.taku_public_key
- 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="getByPackName" resultType="com.ytpm.agent.model.YtPlatformUserApp">
- select
- app_id, app_name, user_id,sale_price,grant_type, app_type, detail_url, package_name, domain, issued_time, wx_app_id, wx_secret
- from yt_platform_user_app
- where package_name = #{packageName}
- </select>
- <select id="getByPrimary" resultType="com.ytpm.agent.model.YtPlatformUserApp">
- select
- app_id, app_name, user_id,sale_price,grant_type, app_type, detail_url, package_name, domain, issued_time, wx_app_id,wx_secret
- from yt_platform_user_app
- where app_id = #{appId}
- </select>
- <select id="getIssuedAppList" resultType="com.ytpm.middle.view.DropDownVO">
- select
- app_id optionVal,
- app_name optionName
- from yt_platform_user_app
- where available = 1
- </select>
- <select id="getApkList" resultType="com.ytpm.middle.view.DropDownVO">
- select
- app_id optionVal,
- app_name optionName
- from yt_app
- where superior_id = #{appId}
- </select>
- <select id="getAppListByUserIds" resultType="com.ytpm.agent.model.YtPlatformUserApp">
- select
- app_id, app_name, user_id, app_type, detail_url, package_name, domain, issued_time, wx_app_id, wx_secret, sale_price, grant_type, charge_status, create_time, create_user_id, update_time, update_user_id, available
- from yt_platform_user_app
- where user_id in
- <foreach collection="userIds.split(',')" separator="," item="item" open="(" close=")">
- #{item}
- </foreach>
- </select>
- </mapper>
|