Browse Source

Merge branch 'master' of http://47.100.37.243:10080/ZHOU/yunsu

# Conflicts:
#	cloud-model/src/main/java/com/hssx/cloudmodel/service/impl/MouldFileServiceImpl.java
5 năm trước cách đây
mục cha
commit
81e102b5d2

+ 1 - 0
cloud-model/src/main/java/com/hssx/cloudmodel/controller/CompanyController.java

@@ -79,6 +79,7 @@ public class CompanyController {
     public HttpRespMsg deleteRole(@RequestParam(required = false)String keyName, HttpServletRequest request,
                                   HttpServletResponse response, PageUtil page,@RequestParam(required = false)Integer companyType) {
         HttpRespMsg msg = new HttpRespMsg();
+        System.out.println("====>"+companyType);
         msg = companyService.pageList(page,keyName,companyType);
         return msg;
     }

+ 1 - 1
cloud-model/src/main/java/com/hssx/cloudmodel/entity/vo/CompanyVO.java

@@ -31,6 +31,6 @@ public class CompanyVO extends Company{
 
         private List<Mould> list  = new ArrayList<>();
 
-        private List<CompanyVO> relateCompanyList = new ArrayList<>();
+        private List<Company> relateCompanyList = new ArrayList<>();
 
 }

+ 1 - 1
cloud-model/src/main/java/com/hssx/cloudmodel/mapper/CompanyMapper.java

@@ -18,7 +18,7 @@ import java.util.List;
  */
 public interface CompanyMapper extends BaseMapper<Company> {
 
-    List<CompanyVO> getListByKeyName(@Param("keyName") String keyName, @Param("companyType")Integer companyType);
+//    List<CompanyVO> getListByKeyName(@Param("keyName") String keyName, @Param("companyType")Integer companyType);
 
     List<CompanyVO> getCustomerListByKeyName(@Param("keyName") String keyName, @Param("companyType")Integer companyType);
 

+ 1 - 5
cloud-model/src/main/java/com/hssx/cloudmodel/service/impl/CompanyServiceImpl.java

@@ -180,11 +180,7 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
         HttpRespMsg msg = new HttpRespMsg();
         List<CompanyVO> list = new ArrayList<>();
         PageHelper.startPage(page.getPageNum(),page.getPageSize());
-        if (companyType == 0) {
-            list = companyMapper.getListByKeyName(keyName, companyType);
-        } else {
-            list = companyMapper.getCustomerListByKeyName(keyName, companyType);
-        }
+        list = companyMapper.getCustomerListByKeyName(keyName, companyType);
         PageInfo<CompanyVO> pageInfos = new PageInfo<>(list);
         msg.data = pageInfos;
         return msg;

+ 26 - 25
cloud-model/src/main/resources/mapper/CompanyMapper.xml

@@ -21,10 +21,11 @@
         <id column="id" property="id" />
         <result column="company_name" property="companyName" />
         <result column="company_address" property="companyAddress" />
-        <result column="company_type" property="companyType" />
+        <result column="companytype" property="companyType" />
         <result column="y_lng" property="yLng" />
         <result column="x_lat" property="xLat" />
-        <collection property="relateCompanyList" javaType="java.util.List" select="selectRelateCompanyList" column="{Id = id,companyType = company_type}"
+        <collection property="relateCompanyList" javaType="java.util.List" select="selectRelateCompanyList"
+                    column="{Id=id,companyType = companytype}"
                     ofType="com.hssx.cloudmodel.entity.Company"/>
     </resultMap>
     <resultMap id="BaseResultMapMouldVO" type="com.hssx.cloudmodel.entity.vo.CompanyVO">
@@ -39,23 +40,23 @@
     </resultMap>
 
 
-    <select id="getListByKeyName" resultMap="BaseResultMapVO">
-        select
-        <include refid="Base_Column_List"/>
-        from
-        tb_company
-        <where>
-            <if test="keyName != null and keyName != ''">
-                and company_name like concat('%',#{keyName},'%')
-            </if>
-            <if test="companyType != null">
-                and company_type = #{companyType}
-            </if>
-        </where>
-    </select>
+    <!--<select id="getListByKeyName" resultMap="BaseResultMapVO">-->
+        <!--select-->
+        <!--<include refid="Base_Column_List"/>-->
+        <!--from-->
+        <!--tb_company-->
+        <!--<where>-->
+            <!--<if test="keyName != null and keyName != ''">-->
+                <!--and company_name like concat('%',#{keyName},'%')-->
+            <!--</if>-->
+            <!--<if test="companyType != null">-->
+                <!--and company_type = #{companyType}-->
+            <!--</if>-->
+        <!--</where>-->
+    <!--</select>-->
     <select id="getCustomerListByKeyName" resultMap="BaseResultMapVO">
         select
-        t.id, t.company_name, t.company_address, t.company_type,tc.y_lng, tc.x_lat
+        t.id, t.company_name, t.company_address, t.company_type companytype,tc.y_lng, tc.x_lat
         from
         tb_company t
         left join
@@ -70,25 +71,25 @@
             </if>
         </where>
     </select>
-    <select id="selectRelateCompanyList" resultType="com.hssx.cloudmodel.entity.vo.CompanyVO" parameterType="java.util.Map">
+    <select id="selectRelateCompanyList" resultType="com.hssx.cloudmodel.entity.Company" parameterType="java.util.Map">
       SELECT
-        t.id, t.company_name
+        t.id, t.company_name,t.company_type
         from
         tb_company t
         left join
         tb_asset_custom_company tbcc
-        <if test="#{companyType}==0">
+        <if test="companyType == 0">
             on t.id = tbcc.custom_id
         </if>
-        <if test="#{companyType}==1">
+        <if test="companyType == 1">
             on t.id = tbcc.assert_id
         </if>
         <where>
-          <if test="#{companyType}==0">
-              tbcc.assert_id = #{id}
+          <if test="companyType == 0">
+              tbcc.assert_id = #{Id}
           </if>
-          <if test="#{companyType}==1">
-              tbcc.custom_id = #{id}
+          <if test="companyType == 1">
+              tbcc.custom_id = #{Id}
           </if>
         </where>