guoyujia 5 月之前
父節點
當前提交
18dbd89a09

+ 20 - 0
src/main/java/cn/ezhizao/project/system/domain/SysDept.java

@@ -110,6 +110,26 @@ public class SysDept extends BaseEntity {
     @TableField(exist = false)
     private String userName;
     private Integer isSortPackaging;
+    @TableField(exist = false)
+    private String name;
+    @TableField(exist = false)
+    private String mnemonicCode;
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getMnemonicCode() {
+        return mnemonicCode;
+    }
+
+    public void setMnemonicCode(String mnemonicCode) {
+        this.mnemonicCode = mnemonicCode;
+    }
 
     public Integer getIsSortPackaging() {
         return isSortPackaging;

+ 12 - 2
src/main/resources/mybatis/business/supplier/BizSupplierMapper.xml

@@ -37,8 +37,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     </select>
     <select id="getListByDept" resultMap="BizSupplierResult">
-        select * from biz_supplier where id not in (select supplier_id from sys_dept where del_flag = 0 and dept_id != #{deptId} )
-        and deleted = 0 and is_inner_outsource = 1
+        select * from biz_supplier
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            id not in (select supplier_id from sys_dept where del_flag = 0 and dept_id != #{deptId} ) and
+             deleted = 0 and is_inner_outsource = 1
+            <if test="tenantId != null and tenantId != 0"> AND tenant_id = #{tenantId}</if>
+            <if test="isInnerOutsource != null "> AND is_inner_outsource = #{isInnerOutsource}</if>
+            <if test="name != null and name != ''"> AND name LIKE CONCAT('%', #{name}, '%')</if>
+            <if test="mnemonicCode != null and mnemonicCode != ''"> AND mnemonic_code LIKE CONCAT('%', #{mnemonicCode}, '%')</if>
+            <if test="code != null and code != ''"> AND code LIKE CONCAT('%', #{code}, '%')</if>
+
+        </trim>
+
     </select>
     <select id="getOutsourceDept" resultMap="BizSupplierResult">
         select t2.*,t1.dept_id as outsourceDeptId,t1.dept_name as outsourceDeptName from sys_dept t1 left join biz_supplier t2 on t1.supplier_id = t2.id where