liujie
2025-07-09 34c7d903efa4dc06a0f7b38bc5d2d721f80b220d
ruoyi-system/src/main/resources/mapper/system/TbCompanyMapper.xml
@@ -50,10 +50,13 @@
    <select id="getMyPushCompanyList" resultType="com.ruoyi.system.vo.MyPushCompanyListVo">
        select * from (
                          select t1.id,t1.company_name,t1.create_time,t1.sale_money ,t2.id orderId,
                                 COALESCE(t2.status, 1) AS status
                                 case
                                     when t1.status=2 then 6
                                     else
                                 COALESCE(t2.status, 1) END AS status
                          from tb_company t1
                                   left join tb_order t2 on t1.id = t2.company_id
                          where t1.user_id = #{userId} and t2.status >0
                          where t1.user_id = #{userId} and t1.is_delete =0
                      ) as t3 where 1= 1
            <if test="query.status!=null">
                and t3.status = #{query.status}
@@ -62,5 +65,18 @@
    </select>
    <select id="getMyPushCompanyListNum" resultType="com.ruoyi.system.vo.MyPushCompanyListVo"
            parameterType="java.lang.Long">
        select * from (
        select t1.id,t1.company_name,t1.create_time,t1.sale_money ,t2.id orderId,
        case when t1.status=2 then 6
        else
        COALESCE(t2.status, 1) END AS status
        from tb_company t1
        left join tb_order t2 on t1.id = t2.company_id
        where t1.user_id = #{userId}  and t1.is_delete =0
                      ) as t3 where 1= 1
        order by t3.create_time desc
    </select>
</mapper>