Bladeren bron

机构入驻二维码

zouxuan 3 jaren geleden
bovenliggende
commit
ec371b80a0

+ 4 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/TenantPreJoinDao.java

@@ -1,10 +1,13 @@
 package com.ym.mec.biz.dal.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ym.mec.biz.dal.entity.TenantPreJoin;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 机构入驻表(预加入)(TenantPreJoin)表数据库访问层
@@ -16,5 +19,6 @@ public interface TenantPreJoinDao extends BaseMapper<TenantPreJoin> {
 
     int insertBatch(@Param("entities") List<TenantPreJoin> entities);
 
+    <T> IPage<T> queryPage(Page<T> page, @Param("param") Map<String, Object> param);
 }
 

+ 18 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/vo/TenantPreJoinVo.java

@@ -0,0 +1,18 @@
+package com.ym.mec.biz.dal.vo;
+
+import com.ym.mec.biz.dal.entity.TenantPreJoin;
+import io.swagger.annotations.ApiModelProperty;
+
+public class TenantPreJoinVo extends TenantPreJoin {
+
+    @ApiModelProperty(value = "推荐人姓名")
+    private String recommenderName;
+
+    public String getRecommenderName() {
+        return recommenderName;
+    }
+
+    public void setRecommenderName(String recommenderName) {
+        this.recommenderName = recommenderName;
+    }
+}

+ 2 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/TenantPreJoinService.java

@@ -3,6 +3,7 @@ package com.ym.mec.biz.service;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.ym.mec.biz.dal.dto.TenantPreJoinDto;
 import com.ym.mec.biz.dal.entity.TenantPreJoin;
+import com.ym.mec.biz.dal.vo.TenantPreJoinVo;
 import com.ym.mec.common.page.PageInfo;
 
 import java.util.Map;
@@ -15,7 +16,7 @@ import java.util.Map;
  */
 public interface TenantPreJoinService extends IService<TenantPreJoin> {
 
-    PageInfo<TenantPreJoin> queryPage(Map<String, Object> param);
+    PageInfo<TenantPreJoinVo> queryPage(Map<String, Object> param);
 
     int insert(TenantPreJoinDto obj);
 

+ 5 - 17
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TenantPreJoinServiceImpl.java

@@ -8,6 +8,7 @@ import com.ym.mec.biz.dal.dto.TenantPreJoinDto;
 import com.ym.mec.biz.dal.entity.SysArea;
 import com.ym.mec.biz.dal.entity.SysUserTsign;
 import com.ym.mec.biz.dal.entity.TenantPreJoin;
+import com.ym.mec.biz.dal.vo.TenantPreJoinVo;
 import com.ym.mec.biz.service.SysUserTsignService;
 import com.ym.mec.biz.service.TenantPreJoinService;
 import com.ym.mec.common.exception.BizException;
@@ -50,23 +51,10 @@ public class TenantPreJoinServiceImpl extends ServiceImpl<TenantPreJoinDao, Tena
      * @param param 条件
      */
     @Override
-    public PageInfo<TenantPreJoin> queryPage(Map<String, Object> param) {
-        Page<TenantPreJoin> pageInfo = PageUtil.getPageInfo(param);
-        //模糊搜索的字段
-        Object search = param.get("search");
-        //分页查询
-        IPage<TenantPreJoin> page = this.page(pageInfo,
-                new WrapperUtil<TenantPreJoin>()
-                        .hasEq("state_", param.get("state"))
-                        .hasGe("created_time_", param.get("startTime"))
-                        .hasLe("created_time_", param.get("endTime"))
-                        .queryWrapper()
-                        .and(Objects.nonNull(search),
-                                o -> o.eq("tsign_name_", search)
-                                        .or().eq("enterprise_liable_name_", search)
-                                        .or().eq("contacts_", search)
-                        ));
-        return PageUtil.pageInfo(page);
+    public PageInfo<TenantPreJoinVo> queryPage(Map<String, Object> param) {
+        Page<TenantPreJoinVo> pageInfo = PageUtil.getPageInfo(param);
+        pageInfo.setDesc("a.created_time_");
+        return PageUtil.pageInfo(baseMapper.queryPage(pageInfo, param));
     }
 
     @Override

+ 52 - 0
mec-biz/src/main/resources/config/mybatis/TenantPreJoinMapper.xml

@@ -55,4 +55,56 @@
             #{entity.provinceName})
         </foreach>
     </insert>
+
+    <resultMap id="TenantPreJoinVo" type="com.ym.mec.biz.dal.vo.TenantPreJoinVo" extends="BaseResultMap">
+        <result property="recommenderName" column="real_name_"/>
+    </resultMap>
+    <select id="queryPage" parameterType="map" resultMap="TenantPreJoinVo">
+        SELECT a.id_,
+        a.tsign_name_,
+        a.name_,
+        a.area_id_,
+        a.area_name_,
+        a.email_,
+        a.customer_service_phone_,
+        a.tsign_code_,
+        a.address_,
+        a.remark_,
+        a.enterprise_liable_name_,
+        a.enterprise_liable_phone_,
+        a.legal_person_id_front_pic_,
+        a.legal_person_id_reverse_pic_,
+        a.contacts_,
+        a.phone_,
+        a.tsign_pic_,
+        a.tax_register_pic_,
+        a.company_account_info_pic_,
+        a.logo_,
+        a.corporate_chops_,
+        a.corporate_finance_chops_,
+        a.state_,
+        a.created_time_,
+        a.province_id_,
+        a.province_name_,
+        a.recommender_,
+        b.real_name_
+        FROM tenant_pre_join as a
+        left join sys_user as b on a.recommender_ = b.id_
+        <where>
+            <if test="param.state != null">
+                and state_ = #{param.state}
+            </if>
+            <if test="param.startTime != null">
+                AND created_time_ <![CDATA[ >= ]]> #{param.startTime}
+            </if>
+            <if test="param.endTime != null">
+                AND created_time_ <![CDATA[ <= ]]> #{param.endTime}
+            </if>
+            <if test="param.search != null ">
+                AND (tsign_name_ LIKE CONCAT('%', #{param.search},'%')
+                OR enterprise_liable_name_ LIKE CONCAT('%', #{param.search},'%')
+                OR contacts_ LIKE CONCAT('%', #{param.search},'%'))
+            </if>
+        </where>
+    </select>
 </mapper>

+ 2 - 1
mec-web/src/main/java/com/ym/mec/web/controller/TenantPreJoinController.java

@@ -3,6 +3,7 @@ package com.ym.mec.web.controller;
 
 import com.ym.mec.biz.dal.dto.TenantPreJoinDto;
 import com.ym.mec.biz.dal.entity.TenantPreJoin;
+import com.ym.mec.biz.dal.vo.TenantPreJoinVo;
 import com.ym.mec.biz.service.TenantPreJoinService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
@@ -38,7 +39,7 @@ public class TenantPreJoinController extends BaseController {
     @ApiOperation("分页查询")
     @PostMapping("/queryPage")
     @PreAuthorize("@pcs.hasPermissions('tenantPreJoin/queryPage')")
-    public HttpResponseResult<PageInfo<TenantPreJoin>> queryPage(@RequestBody Map<String, Object> param) {
+    public HttpResponseResult<PageInfo<TenantPreJoinVo>> queryPage(@RequestBody Map<String, Object> param) {
         return succeed(tenantPreJoinService.queryPage(param));
     }