123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- <?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="auditBannerSqlMapper">
- <sql id="base_column">
- id,
- banner_template_id as bannerTemplateId,
- order_id as orderId,
- campaign_id as campaignId,
- adgroup_id as adGroupId,
- visit_address as visitAddress,
- click_address as clickAddress,
- impression_address as impressionAddress
- checked,
- updated,
- memo
- </sql>
-
- <select id="countByParams" parameterType="map" resultType="int">
- select count(a.id) from t_banner a ,t_banner_template b
- <where>
- b.status != -1
- and a.banner_template_id = b.id
- <if test="key!=null and value!=null">
- <choose>
- <when test="key=='name'">
- and b.name like #{value}
- </when>
- </choose>
- </if>
- <if test="checked !=null">
- and a.checked like #{checked}
- </if>
- </where>
- </select>
-
- <select id="findByParams" parameterType="map" resultMap="AuditBanner">
-
- select a.id as id,a.banner_template_id as bannerTemplateId,a.order_id as orderId,a.campaign_id as campaignId,a.adgroup_id as adGroupId,a.visit_address as visitAddress,a.click_address as clickAddress,a.impression_address as impressionAddress,
- a.checked as checked,a.updated as updated,a.memo as memo,
- b.id as bannerTemplateId,b.advertiser_id as advertiserId,b.name as name,b.path as path,b.path_small as pathSmall,b.type as type,b.width as width,b.height as height,b.status as status,b.updated as updated ,
- (select name from t_advertiser where id=b.advertiser_id) as advertiserName,(select name from t_industry where id = (select industry_id from t_advertiser where id=b.advertiser_id)) as industryName from t_banner a
- left join t_banner_template b on a.banner_template_id=b.id
- left join t_order c on a.order_id= c.id
- left JOIN t_advertiser d on c.advertiser_id = d.id
- left join t_industry e on d.industry_id = e.id
- <where>
- b.status != -1
- <if test="key!=null and value!=null">
- <choose>
- <when test="key=='name'">
- and b.name like #{value}
- </when>
- </choose>
- </if>
- <if test="checked !=null">
- and a.checked like #{checked}
- </if>
- </where>
- order by a.id desc
- limit #{pager.offset}, #{pager.limit}
- </select>
-
- <select id="findAudit" parameterType="map" resultMap="AuditBanner">
-
- select a.id as id,a.banner_template_id as bannerTemplateId,a.order_id as orderId,a.campaign_id as campaignId,a.adgroup_id as adGroupId,a.visit_address as visitAddress,a.click_address as clickAddress,a.impression_address as impressionAddress,
- a.checked as checked,a.updated as updated,a.memo as memo,
- b.id as bannerTemplateId,b.advertiser_id as advertiserId,b.name as name,b.path as path,b.path_small as pathSmall,b.type as type,b.width as width,b.height as height,b.status as status,b.updated as updated ,
- (select name from t_advertiser where id=b.advertiser_id) as advertiserName,(select name from t_industry where id = (select industry_id from t_advertiser where id=b.advertiser_id)) as industryName from t_banner a
- left join t_banner_template b on a.banner_template_id=b.id
- left join t_order c on a.order_id= c.id
- left JOIN t_advertiser d on c.advertiser_id = d.id
- left join t_industry e on d.industry_id = e.id
- <where>
- b.status != -1
- <if test="key!=null and value!=null">
- <choose>
- <when test="key=='name'">
- and b.name like #{value}
- </when>
- </choose>
- </if>
- <if test="checked !=null">
- and a.checked like #{checked}
- </if>
- </where>
- order by a.id desc
- </select>
-
- <resultMap type="com.cloudcross.ssp.model.AuditBanner" id="AuditBanner">
- <id property="id" column="id"/>
- <result property="bannerTemplateId" column="bannerTemplateId"/>
- <result property="orderId" column="orderId"/>
- <result property="campaignId" column="campaignId"/>
- <result property="adGroupId" column="adGroupId"/>
- <result property="visitAddress" column="visitAddress"/>
- <result property="clickAddress" column="clickAddress"/>
- <result property="impressionAddress" column="impressionAddress"/>
- <result property="checked" column="checked"/>
- <result property="updated" column="updated"/>
- <result property="memo" column="memo"/>
- <result property="industryName" column="industryName"/>
- <result property="advertiserName" column="advertiserName"/>
- <association property="bannerTemplate" javaType="com.cloudcross.ssp.model.BannerTemplate" resultMap="bannerTemplate"/>
- </resultMap>
- <resultMap type="com.cloudcross.ssp.back.model.BannerTemplate" id="bannerTemplate">
- <id property="id" column="bannerTemplateId"/>
- <result property="advertiserId" column="advertiserId"/>
- <result property="name" column="name"/>
- <result property="path" column="path"/>
- <result property="pathSmall" column="pathSmall"/>
- <result property="type" column="type"/>
- <result property="width" column="width"/>
- <result property="height" column="height"/>
- <result property="status" column="status"/>
- <result property="updated" column="updated"/>
- </resultMap>
-
- <update id="updateBannerStatus" parameterType="HashMap">
- update t_banner a,t_banner_template b
- set a.checked=#{checked},b.updated = #{updated},a.updated = #{updated}
- <if test="memo != null">
- ,a.memo = #{memo}
- </if>
- where
- a.banner_template_id = b.id and
- a.id in
- <foreach item="id" collection="auditBannerIdList" open="(" separator=","
- close=")">
- #{id}
- </foreach>
- </update>
-
- <update id="updateOperatorBannerTime" parameterType="HashMap">
- update t_banner_operator
- set supdated = #{supdated}
- where banner_id in
- <foreach item="id" collection="auditBannerIdList" open="(" separator=","
- close=")">
- #{id}
- </foreach>
- </update>
-
- </mapper>
|