he2802 3 éve
szülő
commit
8b47d09d09

+ 1 - 1
zhongzheng-admin/src/main/java/com/zhongzheng/controller/base/CertificateTpController.java

@@ -50,7 +50,7 @@ public class CertificateTpController extends BaseController {
     @GetMapping("/list")
     public TableDataInfo<CertificateTpVo> list(CertificateTpQueryBo bo) {
         startPage();
-        List<CertificateTpVo> list = iCertificateTpService.queryList(bo);
+        List<CertificateTpVo> list = iCertificateTpService.selectList(bo);
         return getDataTable(list);
     }
 

+ 2 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/bo/CertificateTpQueryBo.java

@@ -6,6 +6,7 @@ import lombok.Data;
 import lombok.EqualsAndHashCode;
 
 import java.util.Date;
+import java.util.List;
 import java.util.Map;
 import java.util.HashMap;
 
@@ -50,7 +51,7 @@ public class CertificateTpQueryBo extends BaseEntity {
 	private Long typeId;
 	/**  状态 1正常 0关闭 */
 	@ApiModelProperty(" 状态 1正常 0关闭")
-	private Integer status;
+	private List<Integer> status;
 	/** 证书键值 */
 	@ApiModelProperty("证书键值")
 	private String key;

+ 7 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/mapper/CertificateTpMapper.java

@@ -1,7 +1,13 @@
 package com.zhongzheng.modules.base.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zhongzheng.modules.base.bo.CertificateTpQueryBo;
+import com.zhongzheng.modules.base.bo.UserProfileQueryBo;
 import com.zhongzheng.modules.base.domain.CertificateTp;
+import com.zhongzheng.modules.base.vo.CertificateTpVo;
+import com.zhongzheng.modules.base.vo.UserProfileVo;
+
+import java.util.List;
 
 /**
  * 证书模板Mapper接口
@@ -10,5 +16,5 @@ import com.zhongzheng.modules.base.domain.CertificateTp;
  * @date 2022-02-16
  */
 public interface CertificateTpMapper extends BaseMapper<CertificateTp> {
-
+    List<CertificateTpVo> selectList(CertificateTpQueryBo bo);
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/service/ICertificateTpService.java

@@ -42,6 +42,8 @@ public interface ICertificateTpService extends IService<CertificateTp> {
 	 */
 	Boolean updateByEditBo(CertificateTpEditBo bo);
 
+	List<CertificateTpVo> selectList(CertificateTpQueryBo bo);
+
 	/**
 	 * 校验并删除数据
 	 * @param ids 主键集合

+ 6 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/service/impl/CertificateTpServiceImpl.java

@@ -43,7 +43,7 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
         lqw.eq(StrUtil.isNotBlank(bo.getTitle()), CertificateTp::getTitle, bo.getTitle());
         lqw.eq(StrUtil.isNotBlank(bo.getIntroduce()), CertificateTp::getIntroduce, bo.getIntroduce());
         lqw.eq(bo.getTypeId() != null, CertificateTp::getTypeId, bo.getTypeId());
-        lqw.eq(bo.getStatus() != null, CertificateTp::getStatus, bo.getStatus());
+        lqw.in(bo.getStatus() != null, CertificateTp::getStatus, bo.getStatus());
         return entity2Vo(this.list(lqw));
     }
 
@@ -84,6 +84,11 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
         return this.updateById(update);
     }
 
+    @Override
+    public List<CertificateTpVo> selectList(CertificateTpQueryBo bo) {
+        return this.baseMapper.selectList(bo);
+    }
+
     /**
      * 保存前的数据校验
      *

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/vo/CertificateTpVo.java

@@ -52,4 +52,6 @@ public class CertificateTpVo {
 	@Excel(name = "证书键值")
 	@ApiModelProperty("证书键值")
 	private String key;
+	@ApiModelProperty("模板类型名称")
+	private String certificateName;
 }

+ 29 - 0
zhongzheng-system/src/main/resources/mapper/modules/base/CertificateTpMapper.xml

@@ -17,5 +17,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="key" column="key"/>
     </resultMap>
 
+    <resultMap type="com.zhongzheng.modules.base.vo.CertificateTpVo" id="CertificateTpVoResult">
+        <result property="tpId" column="tp_id"/>
+        <result property="code" column="code"/>
+        <result property="title" column="title"/>
+        <result property="introduce" column="introduce"/>
+        <result property="typeId" column="type_id"/>
+        <result property="status" column="status"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="remark" column="remark"/>
+        <result property="key" column="key"/>
+        <result property="certificateName" column="certificate_name"/>
+    </resultMap>
+
+    <select id="selectList" parameterType="com.zhongzheng.modules.base.bo.CertificateTpQueryBo" resultMap="CertificateTpVoResult">
+        SELECT
+            ct.*,
+            c.certificate_name
+        FROM
+            certificate_tp ct
+                LEFT JOIN certificate c ON ct.type_id = c.id
+        where 1=1
+      <if test="status != null and status.size()!=0 ">
+            AND ct.status in
+            <foreach collection="status" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+    </select>
 
 </mapper>