|
@@ -2,7 +2,7 @@
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="org.jeecg.ctop.finance.settlement.mapper.SettlementFileInfoMapper">
|
|
|
|
|
|
- <!-- 查询 财务结算-结算单列表-->
|
|
|
+ <!-- 查询 财务结算-结算单列表
|
|
|
<select id="getSettlementSheetList" resultType="java.util.LinkedHashMap">
|
|
|
SELECT
|
|
|
t.*,
|
|
@@ -53,9 +53,6 @@
|
|
|
<if test="accountName !=null and accountName != ''">
|
|
|
AND accountName like concat ('%',#{accountName},'%')
|
|
|
</if>
|
|
|
- <if test="createUserId !=null and createUserId != ''">
|
|
|
- AND saleUserId = #{createUserId}
|
|
|
- </if>
|
|
|
<if test="mediaId !=null and mediaId != ''">
|
|
|
AND media_id = #{mediaId}
|
|
|
</if>
|
|
@@ -89,6 +86,78 @@
|
|
|
ORDER BY imageCreateTIme DESC
|
|
|
|
|
|
</select>
|
|
|
+-->
|
|
|
+
|
|
|
+ <!-- 查询 财务结算-结算单列表-->
|
|
|
+ <select id="getSettlementSheetList" resultType="java.util.LinkedHashMap">
|
|
|
+ SELECT * FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ f.id,
|
|
|
+ f.upload_years as uploadYears,
|
|
|
+ f.media_id as mediaId,
|
|
|
+ f.advertiser_id as advertiserId,
|
|
|
+ ( SELECT ad.NAME FROM ctop_advertiser ad WHERE ad.id = cwjs.advertiser_id LIMIT 1 ) advertiserName,
|
|
|
+ f.product_id as productId,
|
|
|
+ ( SELECT cp.product_name FROM ctop_product cp WHERE cp.id = cwjs.product_id LIMIT 1 ) productName,
|
|
|
+ cwjs.project_id as projectId,
|
|
|
+ ( SELECT project.project_name FROM ctop_project project WHERE project.id = cwjs.project_id LIMIT 1 ) projectName,
|
|
|
+ cwjs.account_id as accountId,
|
|
|
+ cwjs.account_name as accountName,
|
|
|
+ f.del_flag,
|
|
|
+ cwjs.create_user_id as saleUserId,
|
|
|
+ ( SELECT su.realname FROM sys_user su WHERE su.id = cwjs.create_user_id LIMIT 1 ) saleUserName,
|
|
|
+ f.create_user_id as operateUserId,
|
|
|
+ ( SELECT su.realname FROM sys_user su WHERE su.id = f.create_user_id LIMIT 1 ) operateUserName
|
|
|
+ FROM ctop_cwjs_settlement_file_info f
|
|
|
+ LEFT JOIN ctop_cwjs_settlement_info cwjs on f.account_id = cwjs.account_id
|
|
|
+ where f.del_flag = 0
|
|
|
+ GROUP BY f.account_id,f.upload_years,f.create_user_id
|
|
|
+ ORDER BY f.upload_years DESC
|
|
|
+ ) t
|
|
|
+ <where>
|
|
|
+ <if test="advertiserName !=null and advertiserName != ''">
|
|
|
+ AND advertiserName like concat ('%',#{advertiserName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="productName !=null and productName != ''">
|
|
|
+ AND productName like concat ('%',#{productName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="projectName !=null and projectName != ''">
|
|
|
+ AND projectName like concat ('%',#{projectName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="accountName !=null and accountName != ''">
|
|
|
+ AND accountName like concat ('%',#{accountName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="mediaId !=null and mediaId != ''">
|
|
|
+ AND mediaId = #{mediaId}
|
|
|
+ </if>
|
|
|
+ <if test="startTime !=null and startTime != ''">
|
|
|
+ AND uploadYears >= #{startTime}
|
|
|
+ </if>
|
|
|
+ <if test="endTime !=null and endTime != ''">
|
|
|
+ AND uploadYears <= #{endTime}
|
|
|
+ </if>
|
|
|
+ <if test="createUserName !=null and createUserName != ''">
|
|
|
+ AND operateUserId like concat ('%',#{createUserName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="operatorUserIds !=null and operatorUserIds != ''">
|
|
|
+ AND operateUserId in
|
|
|
+ <foreach collection="operatorUserIds" item="item" separator=","
|
|
|
+ open="(" close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="saleUserIds !=null and saleUserIds != ''">
|
|
|
+ AND saleUserId in
|
|
|
+ <foreach collection="saleUserIds" item="item" separator=","
|
|
|
+ open="(" close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
|
|
|
|
|
|
|
|
@@ -98,6 +167,7 @@
|
|
|
SET del_flag = 1
|
|
|
WHERE advertiser_id = #{advertiserId}
|
|
|
and product_id = #{productId}
|
|
|
+ and account_id = #{accountId}
|
|
|
and media_id = #{mediaId}
|
|
|
and upload_years = #{uploadYears}
|
|
|
and create_user_id = #{createUserId}
|
|
@@ -138,12 +208,26 @@
|
|
|
AND media_id = #{mediaId}
|
|
|
</if>
|
|
|
) t2
|
|
|
+ </select>
|
|
|
|
|
|
|
|
|
|
|
|
- </select>
|
|
|
|
|
|
+ <!-- 查询该账户是否已绑定 或开户-->
|
|
|
+ <select id="getSettlementAccount" resultType="java.util.Map">
|
|
|
+ SELECT
|
|
|
+ u.account_id AS accountId,
|
|
|
+ u.auth_name AS accountName
|
|
|
+ FROM
|
|
|
+ ctop_cwjs_settlement_info f,
|
|
|
+ ctop_user_allocation u
|
|
|
+ WHERE
|
|
|
+ f.account_id = u.account_id
|
|
|
+ AND u.account_status = 0
|
|
|
+ AND u.account_id = #{accountId}
|
|
|
+ LIMIT 1
|
|
|
|
|
|
+ </select>
|
|
|
|
|
|
|
|
|
|