guoyujia 5 months ago
parent
commit
b542f8b117

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

@@ -195,6 +195,16 @@ public class SysDept extends BaseEntity {
     private Long supplierId;
     @TableField(exist =false)
     private String supplierName;
+    @TableField(exist = false)
+    private Integer isInnerOutsource;
+
+    public Integer getIsInnerOutsource() {
+        return isInnerOutsource;
+    }
+
+    public void setIsInnerOutsource(Integer isInnerOutsource) {
+        this.isInnerOutsource = isInnerOutsource;
+    }
 
     public String getSupplierName() {
         return supplierName;

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

@@ -28,6 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
             t1.deleted = 0
             <if test="tenantId != null and tenantId != 0"> AND t1.tenant_id = #{tenantId}</if>
+            <if test="isInnerOutsource != null "> AND t1.is_inner_outsource = #{isInnerOutsource}</if>
             <if test="name != null and name != ''"> AND t1.name LIKE CONCAT('%', #{name}, '%')</if>
             <if test="mnemonicCode != null and mnemonicCode != ''"> AND t1.mnemonic_code LIKE CONCAT('%', #{mnemonicCode}, '%')</if>
             <if test="code != null and code != ''"> AND t1.code LIKE CONCAT('%', #{code}, '%')</if>
@@ -37,7 +38,7 @@ 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 deleted = 0 and is_inner_outsource = 1
     </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