|
@@ -1,29 +1,35 @@
|
|
|
<?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">
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="cn.ezhizao.project.business.receiveTicket.mapper.BizFinancialReceiveTicketFeedbackMapper">
|
|
|
|
|
|
- <resultMap type="cn.ezhizao.project.business.receiveTicket.domain.BizFinancialReceiveTicketFeedback" id="BizFinancialReceiveTicketFeedbackResult">
|
|
|
+ <resultMap type="cn.ezhizao.project.business.receiveTicket.domain.BizFinancialReceiveTicketFeedback"
|
|
|
+ id="BizFinancialReceiveTicketFeedbackResult">
|
|
|
<id column="id" property="id"/>
|
|
|
<result column="company_id" jdbcType="BIGINT" property="companyId"/>
|
|
|
<association property="serviceName" select="getServiceName" column="company_id"></association>
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
- <select id="getList" parameterType="BizFinancialReceiveTicketFeedback" resultMap="BizFinancialReceiveTicketFeedbackResult">
|
|
|
- SELECT t1.*, t2.name as company_name, t2.tax_type, t3.year, t3.month,
|
|
|
+ <select id="getList" parameterType="BizFinancialReceiveTicketFeedback"
|
|
|
+ resultMap="BizFinancialReceiveTicketFeedbackResult">
|
|
|
+ SELECT t1.*, t2.name as company_name, t2.tax_type, t3.year, t3.month,t8.account_name as toTenantName,
|
|
|
t4.account_name as from_company_name FROM biz_financial_receive_ticket_feedback t1 left join
|
|
|
biz_company t2 on t2.id = t1.company_id
|
|
|
left join biz_financial_receive_ticket_detail t3 on t3.id = t1.financial_receive_ticket_detail_id
|
|
|
left join biz_tenant t4 on t4.id = t2.tenant_id
|
|
|
+ left join biz_entrust t7 on
|
|
|
+ t7.company_id = t3.company_id and t7.task_type_id = 1
|
|
|
+ and t7.deleted = 0 and date_format(t7.current_month, '%Y%m') = concat(t3.year, t3.month)
|
|
|
+ left join biz_tenant t8 on t8.id = t7.to_tenant_id
|
|
|
<trim prefix=" WHERE" suffix="" suffixOverrides="AND">
|
|
|
t1.deleted = 0 AND
|
|
|
<if test="id != null ">
|
|
|
t1.id = #{id} AND
|
|
|
</if>
|
|
|
<if test="principal != null and principal != ''">
|
|
|
- (t2.leader_id=#{principal} OR t2.adviser_id=#{principal}) AND
|
|
|
+ (t2.leader_id=#{principal} OR t2.adviser_id=#{principal}) AND
|
|
|
</if>
|
|
|
<if test="year != null ">
|
|
|
t3.year = #{year} AND
|
|
@@ -54,12 +60,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
and eb.company_id = t3.company_id and eb.task_type_id = 1
|
|
|
) AND
|
|
|
</if>
|
|
|
-<!-- <if test="tenantId != null ">-->
|
|
|
-<!-- (t1.tenant_id = #{tenantId}-->
|
|
|
-<!-- or exists (select 1 from entrust where entrust.deleted = 0 and entrust.is_stop = 0 and entrust.company_id = t1.company_id and entrust.task_type_id = 1 and entrust.from_tenant_id = #{tenantId})-->
|
|
|
-<!-- ) AND-->
|
|
|
-<!-- </if>-->
|
|
|
-<!-- exists (select 1 from entrust where entrust.deleted = 0 and entrust.is_stop = 0 and entrust.company_id = t1.company_id and entrust.task_type_id = 1) AND-->
|
|
|
+ <!-- <if test="tenantId != null ">-->
|
|
|
+ <!-- (t1.tenant_id = #{tenantId}-->
|
|
|
+ <!-- or exists (select 1 from entrust where entrust.deleted = 0 and entrust.is_stop = 0 and entrust.company_id = t1.company_id and entrust.task_type_id = 1 and entrust.from_tenant_id = #{tenantId})-->
|
|
|
+ <!-- ) AND-->
|
|
|
+ <!-- </if>-->
|
|
|
+ <!-- exists (select 1 from entrust where entrust.deleted = 0 and entrust.is_stop = 0 and entrust.company_id = t1.company_id and entrust.task_type_id = 1) AND-->
|
|
|
|
|
|
<if test="companyName != null and companyName != ''">
|
|
|
t2.name like concat('%', #{companyName}, '%') AND
|
|
@@ -101,8 +107,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</select>
|
|
|
|
|
|
<select id="getServiceName" resultType="String">
|
|
|
- SELECT s.nick_name FROM sys_user s
|
|
|
- WHERE s.user_id =(SELECT leader_id FROM biz_company WHERE id=#{company_id})
|
|
|
+ SELECT s.nick_name
|
|
|
+ FROM sys_user s
|
|
|
+ WHERE s.user_id = (SELECT leader_id FROM biz_company WHERE id = #{company_id})
|
|
|
</select>
|
|
|
|
|
|
<delete id="physicalDelete">
|
|
@@ -111,7 +118,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="id != null">
|
|
|
id = #{id} AND
|
|
|
</if>
|
|
|
- <!-- 删除条件为其他外键可以在这里加 -->
|
|
|
+ <!-- 删除条件为其他外键可以在这里加 -->
|
|
|
</trim>
|
|
|
</delete>
|
|
|
</mapper>
|