123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237 |
- <?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="auditSqlMapper">
-
- <sql id="base_column">
- t_advertiser.id as id,
- t_industry.id as industryId,
- t_advertiser.name as name,
- t_advertiser.reg_name as regName,
- t_advertiser.homepage as homePage,
- t_advertiser.contacts,
- t_advertiser.tel as tel,
- t_advertiser.email as email,
- t_advertiser.updated as updated,
- t_advertiser.cpi_path as cpiPath,
- t_advertiser.licence_path as licencePath,
- t_advertiser.id_path as idPath,
- t_advertiser.org_path as orgPath,
- t_advertiser.check_account as checkAccount,
- t_advertiser.check_status as checkStatus,
- t_advertiser.check_memo as checkMemo
- </sql>
-
-
-
-
-
- <select id="selectByParamsback" parameterType="map" resultType="com.cloudcross.ssp.model.Audit">
- select
- <include refid="base_column" />
- ,t_adv_agent.name as agentName,t_industry.name as industryName
- from t_adv_agent,t_industry,t_advertiser
- where t_adv_agent.id=t_advertiser.agent_id
-
- <if test="key!=null and value!=null">
- <choose>
- <when test="key=='name'">
- and t_advertiser.name like #{value}
- </when>
- </choose>
- </if>
- <if test="checkStatus!=null">
- and t_advertiser.check_status = #{checkStatus}
- </if>
- <if test="industryId!=null">
- and t_advertiser.industry_id = #{industryId}
- </if>
- and t_advertiser.status != -1
- and t_advertiser.industry_id = t_industry.id
-
- order by t_advertiser.id desc
- limit #{pager.offset}, #{pager.limit}
-
- </select>
-
- <select id="selectByParamsoperator" parameterType="map" resultType="com.cloudcross.ssp.model.Audit">
- select
- <include refid="base_column" />
- ,b.name as industryName, count(c.advertiser_id) as orderNum from t_industry b,t_advertiser left join t_order c
- on t_advertiser.id = c.advertiser_id
- where 1 = 1
- <if test="key!=null and value!=null">
- <choose>
- <when test="key=='name'">
- and t_advertiser.name like #{value}
- </when>
- </choose>
- </if>
- <if test="checkStatus!=null">
- and t_advertiser.check_status = #{checkStatus}
- </if>
- <if test="industryId!=null">
- and t_advertiser.industry_id = #{industryId}
- </if>
- and t_advertiser.status != -1
- and t_advertiser.industry_id = b.id
- group by t_advertiser.id
- order by t_advertiser.id desc
- limit #{pager.offset}, #{pager.limit}
- </select>
-
-
-
- <select id="countByParamsback" parameterType="map" resultType="int">
- select count(a.id)
- from t_advertiser a,t_adv_agent b
- where b.id=a.agent_id
- and a.status != -1
- <if test="key!=null and value!=null">
- <choose>
- <when test="key=='name'">
- and a.name like #{value}
- </when>
- </choose>
- </if>
- <if test="checkStatus!=null">
- and a.check_status = #{checkStatus}
- </if>
- <if test="industryId!=null">
- and a.industry_id = #{industryId}
- </if>
-
-
- </select>
-
- <select id="countByParamsoperator" parameterType="map" resultType="int">
- select count(a.id)
- from t_advertiser a where status != -1
- <if test="key!=null and value!=null">
- <choose>
- <when test="key=='name'">
- and a.name like #{value}
- </when>
- </choose>
- </if>
- <if test="checkStatus!=null">
- and a.check_status = #{checkStatus}
- </if>
- <if test="industryId!=null">
- and a.industry_id = #{industryId}
- </if>
- </select>
- <!--
- from t_advertiser a,t_adv_agent b
- where b.id=a.agent_id
- and a.status != -1
- <select id="selectByStatus" parameterType="map" resultType="audit">
- select
- <include refid="base_column" />
- ,b.name as industryName, count(c.advertiser_id) as orderNum from t_industry b,t_advertiser left join t_order c
- on t_advertiser.id = c.advertiser_id
- where 1 = 1
- and t_advertiser.check_status = #{checkStatus}
- and t_advertiser.industry_id = b.id
- group by t_advertiser.id
- order by t_advertiser.id desc
- limit #{pager.offset}, #{pager.limit}
- </select>
- -->
- <select id="selectByIdback" parameterType="int" resultType="com.cloudcross.ssp.model.Audit">
- select
- <include refid="base_column" />
-
- ,t_industry.name as industryName
- from t_advertiser,t_industry
- where t_industry.id = t_advertiser.industry_id and t_advertiser.id = #{id}
-
- <!-- from t_advertiser
- <where>
- id = #{id}
- </where> -->
- </select>
-
- <select id="selectByIdoperator" parameterType="int" resultType="com.cloudcross.ssp.model.Audit">
- select
- <include refid="base_column" />
- from t_advertiser
- <where>
- id = #{id}
- </where>
- </select>
-
- <select id="selectByStatus" parameterType="map" resultType="com.cloudcross.ssp.model.Audit">
- select
- <include refid="base_column" />
- ,b.name as industryName, count(c.advertiser_id) as orderNum from t_industry b,t_advertiser left join t_order c
- on t_advertiser.id = c.advertiser_id
- where 1 = 1
- and t_advertiser.check_status = #{checkStatus}
- and t_advertiser.industry_id = b.id
- group by t_advertiser.id
- order by t_advertiser.id desc
- limit #{pager.offset}, #{pager.limit}
- </select>
-
- <select id="countByStatus" parameterType="map" resultType="int">
- select count(a.id)
- from t_advertiser a where check_status = #{checkStatus}
-
- </select>
- <!-- <update id="updateStatus" parameterType="HashMap">
- update t_advertiser
- set check_status = #{checkStatus},updated = #{modifyDate}
- where t_advertiser.id in
- <foreach item="advertiserId" collection="advertiserIdList"
- open="(" separator="," close=")">
- #{auditId}
- </foreach>
- </update>
- -->
- <update id="updateCheckStatus" parameterType="HashMap">
- update t_advertiser
- set check_status = #{checkStatus},updated = NOW(),check_memo = #{checkMemo}
- where t_advertiser.id =#{auditId}
- </update>
-
- <update id="updateStatus" parameterType="HashMap">
- update t_advertiser
- set check_status = #{checkStatus},updated = #{modifyDate}
- where t_advertiser.id in
- <foreach item="advertiserId" collection="advertiserIdList"
- open="(" separator="," close=")">
- #{advertiserId}
- </foreach>
- </update>
-
- <!-- 导出Excel用 -->
- <select id="findDeliverEffectAnalysis" parameterType="map" resultType="com.cloudcross.ssp.model.Audit">
-
- select
- <include refid="base_column" />
- ,t_adv_agent.name as agentName,t_industry.name as industryName
- from t_adv_agent,t_industry,t_advertiser
- where t_adv_agent.id=t_advertiser.agent_id
-
- <if test="key!=null and value!=null">
- <choose>
- <when test="key=='name'">
- and t_advertiser.name like #{value}
- </when>
- </choose>
- </if>
- <if test="checkStatus!=null">
- and t_advertiser.check_status = #{checkStatus}
- </if>
- <if test="industryId!=null">
- and t_advertiser.industry_id = #{industryId}
- </if>
- and t_advertiser.status != -1
- and t_advertiser.industry_id = t_industry.id
-
- order by t_advertiser.id desc
-
- </select>
-
- </mapper>
|