Explorar o código

1、租户导出问题的处理
2、租户条件查询处理

yys hai 4 días
pai
achega
a10aa4e154

+ 1 - 0
fs-admin/src/main/java/com/fs/admin/controller/CompanyAdminController.java

@@ -69,6 +69,7 @@ public class CompanyAdminController extends BaseController {
     public void export(HttpServletResponse response, TenantInfo tenantInfo) throws IOException {
         List<TenantInfo> list = tenantInfoService.selectTenantInfoList(tenantInfo);
         ExcelUtil<TenantInfo> util = new ExcelUtil<>(TenantInfo.class);
+        response.setHeader("Content-Disposition", "attachment;filename=租户列表数据.xlsx");
         util.exportExcel(response, list, "租户列表数据");
     }
 

+ 3 - 3
fs-service/src/main/resources/mapper/tenant/TenantInfoMapper.xml

@@ -42,8 +42,8 @@
     <select id="selectTenantInfoList" resultMap="TenantInfoResult">
         <include refid="selectTenantInfoVo"/>
         <where>
-            <if test="tenantCode != null  and tenantCode != ''"> and t.tenant_code = #{tenantCode}</if>
-            <if test="tenantName != null  and tenantName != ''"> and t.tenant_name like concat('%', #{tenantName}, '%')</if>
+            <if test="tenantCode != null  and tenantCode != ''"> and t.tenant_code like concat('%', #{tenantCode}, '%')</if>
+            <if test="tenantName != null  and tenantName != ''"> and (t.tenant_name like concat('%', #{tenantName}, '%') or t.tenant_code like concat('%', #{tenantName}, '%'))</if>
             <if test="status != null "> and t.status = #{status}</if>
             <if test="expireTime != null "> and t.expire_time = #{expireTime}</if>
             <if test="proxyId != null "> and t.proxy_id = #{proxyId}</if>
@@ -67,7 +67,7 @@
     <select id="tenantList" resultType="com.fs.tenant.vo.TenantInfoShowVo">
         select id, tenant_code, tenant_name from tenant_info
         <where>
-            <if test="tenantCode != null  and tenantCode != ''"> and tenant_code = #{tenantCode}</if>
+            <if test="tenantCode != null  and tenantCode != ''"> and tenant_code like concat('%', #{tenantCode}, '%')</if>
             <if test="tenantName != null  and tenantName != ''"> and tenant_name like concat('%', #{tenantName}, '%')</if>
             <if test="status != null "> and status = #{status}</if>
             <if test="expireTime != null "> and expire_time = #{expireTime}</if>