Explorar el Código

数据字典导出复选框

wyyay hace 1 año
padre
commit
ac34b69abc

+ 14 - 0
base-common/src/main/java/com/ozs/common/core/domain/entity/SysDictData.java

@@ -2,6 +2,8 @@ package com.ozs.common.core.domain.entity;
 
 import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.Size;
+
+import com.baomidou.mybatisplus.annotation.TableField;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.ozs.common.annotation.Excel;
@@ -9,6 +11,8 @@ import com.ozs.common.annotation.Excel.ColumnType;
 import com.ozs.common.constant.UserConstants;
 import com.ozs.common.core.domain.BaseEntity;
 
+import java.util.List;
+
 /**
  * 字典数据表 sys_dict_data
  *
@@ -52,6 +56,16 @@ public class SysDictData extends BaseEntity
     @Excel(name = "状态", readConverterExp = "1=正常,2=停用")
     private Integer status;
 
+    @TableField(exist = false)
+    private List<Long> ids;
+
+    public List<Long> getIds() {
+        return ids;
+    }
+
+    public void setIds(List<Long> ids) {
+        this.ids = ids;
+    }
     public Long getDictCode()
     {
         return dictCode;

+ 14 - 0
base-common/src/main/java/com/ozs/common/core/domain/entity/SysDictType.java

@@ -3,12 +3,16 @@ package com.ozs.common.core.domain.entity;
 import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.Pattern;
 import javax.validation.constraints.Size;
+
+import com.baomidou.mybatisplus.annotation.TableField;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.ozs.common.annotation.Excel;
 import com.ozs.common.annotation.Excel.ColumnType;
 import com.ozs.common.core.domain.BaseEntity;
 
+import java.util.List;
+
 /**
  * 字典类型表 sys_dict_type
  *
@@ -41,6 +45,16 @@ public class SysDictType extends BaseEntity
     @Excel(name = "备注")
     private String remark;
 
+    @TableField(exist = false)
+    private List<Long> ids;
+
+    public List<Long> getIds() {
+        return ids;
+    }
+
+    public void setIds(List<Long> ids) {
+        this.ids = ids;
+    }
     @Override
     public String getRemark() {
         return remark;

+ 6 - 0
base-system/src/main/resources/mapper/system/SysDictDataMapper.xml

@@ -38,6 +38,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			<if test="status != null and status != ''">
 				AND status = #{status}
 			</if>
+			<if test="ids != null and ids.size()>0">
+				and dict_code in
+				<foreach item="items" collection="ids" separator="," open="(" close=")" index="index">
+					#{items}
+				</foreach>
+			</if>
 		</where>
 		order by dict_sort asc
 	</select>

+ 6 - 0
base-system/src/main/resources/mapper/system/SysDictTypeMapper.xml

@@ -43,6 +43,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
 				and date_format(create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
 			</if>
+			<if test="ids != null and ids.size()>0">
+				and dict_id in
+				<foreach item="items" collection="ids" separator="," open="(" close=")" index="index">
+					#{items}
+				</foreach>
+			</if>
 	    </where>
 	</select>