| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166 |
- <?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.zhongzheng.modules.top.financial.mapper.TopDivideLogMapper">
- <resultMap type="com.zhongzheng.modules.top.financial.domain.TopDivideLog" id="TopDivideLogResult">
- <result property="id" column="id"/>
- <result property="year" column="year"/>
- <result property="month" column="month"/>
- <result property="payMoney" column="pay_money"/>
- <result property="sellerId" column="seller_id"/>
- <result property="status" column="status"/>
- <result property="createTime" column="create_time"/>
- <result property="updateTime" column="update_time"/>
- <result property="divideType" column="divide_type"/>
- <result property="payStatus" column="pay_status"/>
- <result property="remark" column="remark"/>
- <result property="deductMoney" column="deduct_money"/>
- <result property="createUsername" column="create_username"/>
- <result property="createSysUserId" column="create_sys_user_id"/>
- <result property="createNo" column="create_no"/>
- </resultMap>
- <select id="getCompanyList" parameterType="com.zhongzheng.modules.top.financial.bo.TopDivideLogQueryBo" resultType="com.zhongzheng.modules.top.financial.vo.TopDivideLogVo">
- SELECT
- dl.*,
- st.tenant_name,
- st.bill_type,
- st.bill_day
- FROM
- top_divide_log dl
- LEFT JOIN sys_tenant st ON dl.tenant_id = st.tenant_id
- WHERE
- dl.divide_type = 1
- <if test="tenantId != null and tenantId != ''">
- AND dl.tenant_id = #{tenantId}
- </if>
- <if test="payStatus != null ">
- AND dl.pay_status = #{payStatus}
- </if>
- <if test="monthTime != null and monthTime != ''">
- AND dl.month_time in
- <foreach collection="monthTime" item="item" index="index" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- </select>
- <select id="getCheckList" parameterType="com.zhongzheng.modules.top.financial.bo.TopDivideLogQueryBo" resultType="com.zhongzheng.modules.top.financial.vo.TopDivideLogVo">
- SELECT
- dl.*,
- cl.check_status,
- cl.check_sign,
- r.role_name
- FROM
- top_divide_log dl LEFT JOIN
- top_old_order_check_log cl ON dl.id = cl.month_divide_id AND cl.check_sign = 1
- LEFT JOIN top_sys_role r ON cl.role_id = r.role_id
- WHERE
- 1 = 1
- <if test="tenantId != null and tenantId != ''">
- AND dl.tenant_id = #{tenantId}
- </if>
- <if test="divideType != null">
- AND dl.divide_type = #{divideType}
- </if>
- <if test="payStatus != null">
- AND dl.pay_status = #{payStatus}
- </if>
- <if test="roleId != null and roleId != ''">
- AND cl.role_id = #{roleId}
- </if>
- <if test="checkStatus != null and checkStatus != ''">
- AND cl.check_status in
- <foreach collection="checkStatus" item="item" index="index" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- <if test="monthTime != null and monthTime != ''">
- AND dl.month_time in
- <foreach collection="monthTime" item="item" index="index" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- order by dl.id
- </select>
- <select id="getSumMoney" parameterType="com.zhongzheng.modules.top.financial.bo.TopDivideLogQueryBo" resultType="com.zhongzheng.modules.top.financial.vo.TopDivideLogVo">
- SELECT
- sum(
- IF
- ( pay_status = 1, dl.pay_money, 0 )) AS pay_money_total,
- sum(
- IF
- ( pay_status = 1, dl.deduct_money, 0 )) AS deduct_money_total,
- sum(
- IF
- ( pay_status = 0, dl.pay_money, 0 )) AS un_pay_money_total,
- sum(
- IF
- ( pay_status = 0, dl.deduct_money, 0 )) AS un_deduct_money_total
- FROM
- top_divide_log dl
- WHERE
- 1=1
- <if test="divideType != null">
- AND dl.divide_type = #{divideType}
- </if>
- </select>
- <select id="getSellerList" parameterType="com.zhongzheng.modules.top.financial.bo.TopDivideLogQueryBo" resultType="com.zhongzheng.modules.top.financial.vo.TopDivideLogVo">
- SELECT
- dl.*,
- st.tenant_name,
- st.bill_day
- FROM
- top_divide_log dl
- LEFT JOIN sys_tenant st ON dl.tenant_id = st.tenant_id
- WHERE
- dl.divide_type = 2
- <if test="tenantId != null and tenantId != ''">
- AND dl.tenant_id = #{tenantId}
- </if>
- <if test="payStatus != null ">
- AND dl.pay_status = #{payStatus}
- </if>
- <if test="monthTime != null and monthTime != ''">
- AND dl.month_time in
- <foreach collection="monthTime" item="item" index="index" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- </select>
- <select id="getCommissionList" parameterType="com.zhongzheng.modules.top.financial.bo.TopDivideOrderQueryBo" resultType="com.zhongzheng.modules.top.financial.vo.TopDivideLogVo">
- SELECT
- dl.*,
- st.tenant_name,
- st.bill_day
- FROM
- top_divide_log dl
- LEFT JOIN sys_tenant st ON dl.tenant_id = st.tenant_id
- WHERE
- dl.divide_type = 3
- <if test="tenantId != null and tenantId != ''">
- AND dl.tenant_id = #{tenantId}
- </if>
- <if test="payStatus != null">
- AND dl.pay_status = #{payStatus}
- </if>
- <if test="monthTime != null and monthTime != ''">
- AND dl.month_time in
- <foreach collection="monthTime" item="item" index="index" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- </select>
- </mapper>
|