123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- <?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.fs.ad.mapper.AdUploadLogMapper">
-
- <resultMap type="AdUploadLog" id="AdUploadLogResult">
- <result property="id" column="id" />
- <result property="siteId" column="site_id" />
- <result property="type" column="type" />
- <result property="templateId" column="template_id" />
- <result property="accountId" column="account_id" />
- <result property="domainId" column="domain_id" />
- <result property="url" column="url" />
- <result property="uploadType" column="upload_type" />
- <result property="vid" column="vid" />
- </resultMap>
- <sql id="selectAdUploadLogVo">
- select * from ad_upload_log
- </sql>
- <select id="selectAdUploadLogList" parameterType="AdUploadLog" resultType="AdUploadLog">
- select a.*,b.name siteName,b.url siteUrl,c.name accountName from ad_upload_log a
- inner join ad_site b on a.site_id = b.id
- inner join ad_account c on a.account_id = c.id
- <where>
- <if test="siteId != null "> and a.site_id = #{siteId}</if>
- <if test="type != null "> and a.type = #{type}</if>
- <if test="templateId != null "> and a.template_id = #{templateId}</if>
- <if test="accountId != null "> and a.account_id = #{accountId}</if>
- <if test="domainId != null "> and a.domain_id = #{domainId}</if>
- <if test="url != null and url != ''"> and a.url = #{url}</if>
- <if test="uploadType != null and uploadType != ''"> and a.upload_type = #{uploadType}</if>
- <if test="vid != null and vid != ''"> and a.vid = #{vid}</if>
- <if test="startDate != null and endDate != null">
- AND date_format(a.create_time,'%Y-%m-%d') >= #{startDate}
- AND date_format(a.create_time,'%Y-%m-%d') <= #{endDate}
- </if>
- </where>
- order by a.create_time desc
- </select>
-
- <select id="selectAdUploadLogById" parameterType="Long" resultMap="AdUploadLogResult">
- <include refid="selectAdUploadLogVo"/>
- where id = #{id}
- </select>
-
- <insert id="insertAdUploadLog" parameterType="AdUploadLog" useGeneratedKeys="true" keyProperty="id">
- insert into ad_upload_log
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="siteId != null">site_id,</if>
- <if test="type != null">type,</if>
- <if test="templateId != null">template_id,</if>
- <if test="accountId != null">account_id,</if>
- <if test="domainId != null">domain_id,</if>
- <if test="url != null">url,</if>
- <if test="uploadType != null">upload_type,</if>
- <if test="vid != null">vid,</if>
- <if test="createTime != null">create_time,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="siteId != null">#{siteId},</if>
- <if test="type != null">#{type},</if>
- <if test="templateId != null">#{templateId},</if>
- <if test="accountId != null">#{accountId},</if>
- <if test="domainId != null">#{domainId},</if>
- <if test="url != null">#{url},</if>
- <if test="uploadType != null">#{uploadType},</if>
- <if test="vid != null">#{vid},</if>
- <if test="createTime != null">#{createTime},</if>
- </trim>
- </insert>
- <update id="updateAdUploadLog" parameterType="AdUploadLog">
- update ad_upload_log
- <trim prefix="SET" suffixOverrides=",">
- <if test="siteId != null">site_id = #{siteId},</if>
- <if test="type != null">type = #{type},</if>
- <if test="templateId != null">template_id = #{templateId},</if>
- <if test="accountId != null">account_id = #{accountId},</if>
- <if test="domainId != null">domain_id = #{domainId},</if>
- <if test="url != null">url = #{url},</if>
- <if test="uploadType != null">upload_type = #{uploadType},</if>
- <if test="vid != null">vid = #{vid},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteAdUploadLogById" parameterType="Long">
- delete from ad_upload_log where id = #{id}
- </delete>
- <delete id="deleteAdUploadLogByIds" parameterType="String">
- delete from ad_upload_log where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|