Commit 504d7e2e authored by 赵啸非's avatar 赵啸非

修改新闻相关

parent 01ce88ac
...@@ -294,8 +294,16 @@ CREATE TABLE mortals_xhx_news( ...@@ -294,8 +294,16 @@ CREATE TABLE mortals_xhx_news(
`createTime` datetime NOT NULL COMMENT '创建时间', `createTime` datetime NOT NULL COMMENT '创建时间',
`updateUserId` bigint(20) COMMENT '更新用户', `updateUserId` bigint(20) COMMENT '更新用户',
`updateTime` datetime COMMENT '更新时间', `updateTime` datetime COMMENT '更新时间',
`editor` varchar(64) NOT NULL COMMENT '责任编辑',
`shareNums` tinyint(4) NOT NULL DEFAULT '0' COMMENT '分享次数',
`deptId` bigint(20) COMMENT '发布部门',
`deptName` varchar(128) COMMENT '所属部门名称',
`statement` varchar(255) COMMENT '声明',
`source` varchar(255) COMMENT '文章来源',
`remark` varchar(255) COMMENT '备注',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='新闻'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='新闻';
-- ---------------------------- -- ----------------------------
-- 新闻访问记录信息表 -- 新闻访问记录信息表
-- ---------------------------- -- ----------------------------
......
No preview for this file type
...@@ -57,7 +57,7 @@ const router = new Router({ ...@@ -57,7 +57,7 @@ const router = new Router({
...restBuilder('news/category', 'news/category'),//新闻频道分类 ...restBuilder('news/category', 'news/category'),//新闻频道分类
...restBuilder("dept", "dept"), //部门
//以下为基础路由配置 //以下为基础路由配置
builder('/', 'Home'), builder('/', 'Home'),
builder('/home', 'Home'), builder('/home', 'Home'),
......
<template>
<!-- 弹出框表单 -->
<el-dialog :title="title" :visible.sync="open" width="90%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<el-col :span="22" v-if="form.parentId !== 0">
<el-form-item label="上级节点" prop="parentId">
<treeselect
v-model="form.parentId"
:options="deptOptions"
:normalizer="normalizer"
placeholder="选择上级部门信息"
/>
</el-form-item>
</el-col>
<Field :span="22" label="部门名称" prop="deptName" v-model="form.deptName" type="textarea" placeholder="请输入部门名称"/>
<Field :span="22" label="部门状态" prop="deptStatus" v-model="form.deptStatus" type="select" :enumData="dict.deptStatus" placeholder="请选择部门状态"/>
<Field :span="22" label="顺序" prop="orderNum" v-model="form.orderNum" placeholder="请输入顺序"/>
<Field :span="22" label="备注" prop="remark" v-model="form.remark" type="textarea" placeholder="请输入备注"/>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</template>
<script>
import form from "@/assets/mixins/formdialog";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
mixins: [form],
components: {
Treeselect,
},
data() {
return {
deptOptions: [],
// 遮罩层
loading: true,
// 弹出层标题
title: "部门信息",
// 是否显示弹出层
open: false,
toString:[
"deptStatus",
],
// 表单校验
rules: {
deptName: [
{required: true,message: "请输入部门名称", trigger: "blur" },
{max: 256,message: "最多只能录入256个字符",trigger: "blur",},
],
deptStatus: [
{required: true,message: "请输入部门状态", trigger: "blur" },
],
orderNum: [
{required: true,message: "请输入顺序", trigger: "blur" },
],
}
};
},
methods: {
/** 编辑 */
edit(row, deptOptions) {
this.reset()
this.query = { id: row.id };
this.urls.currUrl =this.pageInfo.editUrl;;
this.getData();
this.deptOptions = deptOptions;
this.title = "修改部门信息";
},
/** 新增 */
add(row, deptOptions) {
this.reset()
this.query = { id: row.id };
this.urls.currUrl = this.pageInfo.addUrl;
this.getData();
if(row.id){
this.form.parentId=row.id
}
this.deptOptions = deptOptions;
this.title = "新增部门信息";
},
/** 查看*/
view(row, deptOptions) {
this.query = { id: row.id };
this.urls.currUrl =this.pageInfo.viewUrl;;
this.getData();
this.deptOptions = deptOptions;
this.title = "部门信息详细";
},
/**取消按钮 */
cancel() {
this.open = false;
},
/**获取数据后弹框 */
afterRender(data) {
this.open = true;
},
afterSubmit(data) {
this.open = false;
this.$emit("ok");
},
/** 转换部门信息数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children;
}
return {
id: node.id,
label: node.deptName,
children: node.children,
};
},
// 表单重置
reset() {
this.form = {
parentId : null,
ancestors : "",
deptName : "",
deptStatus : 1,
orderNum : 0,
remark : "",
};
this.resetForm("form");
},
resetForm(refName) {
if (this.$refs[refName]) {
this.$refs[refName].resetFields();
}
},
},
};
</script>
<template>
<!-- 弹出框表单 -->
<el-drawer
:title="title"
:visible.sync="open"
:direction="direction"
size="50%">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<Field label="部门名称" prop="deptName" v-model="form.deptName" type="textarea" placeholder="请输入部门名称" :maxLength="15"/>
<Field label="上级部门" prop="parentId" v-model="form.parentId" type="select" :enumData="dict.deptName" placeholder="请选择上级部门"/>
<Field label="负责人" prop="workId" v-model="form.workId" type="select" :enumData="dict.workName" placeholder="请选择员工"/>
</el-row>
<form-buttons @submit='submitForm' noCancelBtn />
</el-form>
</el-drawer>
</template>
<script>
import form from "@/assets/mixins/formdialog";
export default {
name: "DeptDetail",
mixins: [form],
components: {
},
created() {
this.changePath("dept")
},
data() {
return {
// 遮罩层
loading: true,
// 弹出层标题
title: "部门信息",
// 是否显示弹出层
open: false,
direction:"rtl",
toString:[
"deptStatus",
],
toDate:[
],
// 表单校验
rules: {
deptName: [
{required: true,message: "请输入部门名称", trigger: "blur" },
{max: 15,message: "最多只能录入15个字符",trigger: "blur",},
],
parentId: [
{required: true,message: "请输入部门", trigger: "change" },
]
}
};
},
methods: {
/** 编辑 */
edit(row) {
this.reset()
this.query = { id: row.id };
this.urls.currUrl ="dept/edit";
this.getData();
this.pageInfo.type="edit"
this.title = "修改部门信息";
},
/** 新增 */
add(row) {
this.reset()
this.urls.currUrl = "dept/add";
this.getData();
this.pageInfo.type="add"
this.title = "新增部门信息";
},
/** 查看*/
view(row) {
this.reset()
this.query = { id: row.id };
this.urls.currUrl ="dept/view";
this.getData();
this.pageInfo.type="view"
this.title = "部门信息详细";
},
/**取消按钮 */
cancel() {
this.open = false;
},
/**获取数据后弹框 */
afterRender(data) {
this.form.parentId = this.form.parentId.toString()
this.open = true;
},
afterSubmit(data) {
this.open = false;
this.$emit("ok");
},
// 表单重置
reset() {
this.form = {
parentId : null,
ancestors : "",
deptName : "",
deptStatus : 1,
orderNum : 0,
remark : "",
};
this.resetForm("form");
},
resetForm(refName) {
if (this.$refs[refName]) {
this.$refs[refName].resetFields();
}
},
},
};
</script>
<template>
<div className="page">
<el-card style="height:80vh;overflow:scroll-y">
<LayoutTable notPagination :data="tableData" ref="layoutTable" :config="tableConfig" notSearch></LayoutTable>
</el-card>
<drawer-show ref="drawerform" @ok="getData" />
</div>
</template>
<script>
/** 表单弹出框模式需引入 */
import {handleTree} from "@/assets/utils/table";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import drawerShow from "./drawershow";
import table from "@/assets/mixins/table";
export default {
name: "DeptList",
components: {
drawerShow,
Treeselect
},
mixins: [table],
created() {
this.query={"page":1,"size":-1}
},
methods: {
/** 重写新增方法 */
toAdd(row) {
this.$refs.drawerform.add(row,this.menuOptions);
},
/** 重写编辑方法 */
toEdit(row) {
this.$refs.drawerform.edit(row,this.menuOptions);
},
/** 重写查看方法 */
toView(row) {
this.$refs.drawerform.view(row, this.menuOptions);
},
afterRender(data) {
data.data = handleTree(data.data, "id", "parentId");
console.log("tree data:",data.data)
this.menuOptions = data.data;
this.$refs.layoutTable.showType = "treetable"
},
},
data() {
return {
config: {
showType:'treetable',
isshowTabPane:true,
/** 树表是否默认展开 */
expand: false,
columns: [
{type: "selection", width: 60},
{label: "部门名称", prop: "deptName"},
{label: "成员数量", prop: "personNum"},
{label: "负责人", prop: "workName"},
// {label: "部门状态", prop: "deptStatus",formatter: this.formatter},
// {label: "顺序", prop: "orderNum",formatter: this.formatter},
// {label: "创建用户", prop: "createUserId", formatter: this.formatter},
{
label: "操作",
width: 240,
formatter: row => {
return (
<table-buttons noAdd noView row={row} onEdit={this.toEdit} onView={this.toView} onDel={this.toDel} />
)
}
}
]
}
};
}
};
</script>
\ No newline at end of file
<template>
<layout-view>
<el-descriptions :title="title" :column="column" :size="size" :colon="false" border>
<template slot="title">
<i class="el-icon-tickets"></i>
基本详细信息
</template>
<template slot="extra">
<el-button type="primary" @click="$router.go(-1)" size="small">返回</el-button>
</template>
<el-descriptions-item label="父id" label-class-name="labelClass" content-class-name="contentClass">
{{form.parentId}}
</el-descriptions-item>
<el-descriptions-item label="祖级列表" label-class-name="labelClass" content-class-name="contentClass">
{{form.ancestors}}
</el-descriptions-item>
<el-descriptions-item label="部门名称" label-class-name="labelClass" content-class-name="contentClass">
{{form.deptName}}
</el-descriptions-item>
<el-descriptions-item label="部门状态" label-class-name="labelClass" content-class-name="contentClass">
{{ util_formatters("deptStatus", form.deptStatus) }}
</el-descriptions-item>
<el-descriptions-item label="顺序" label-class-name="labelClass" content-class-name="contentClass">
{{form.orderNum}}
</el-descriptions-item>
<el-descriptions-item label="备注" label-class-name="labelClass" content-class-name="contentClass">
{{form.remark}}
</el-descriptions-item>
</el-descriptions>
</layout-view>
</template>
<script>
import view from "@/assets/mixins/view";
export default {
mixins: [view],
components: {
},
methods: {
},
data() {
return {
size:"small",
column:2,
toString:[
"deptStatus",
],
toArrays: [
],
toDate: [
]
}
}
}
</script>
<style lang="less">
.labelClass{
width: 200px;
}
.el-descriptions__body{
margin-left: 5px;
margin-right: 5px;
color: #606266;
background-color: #FFF;
}
.contentClass{
width: 600px;
}
</style>
\ No newline at end of file
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
size="50%"> size="50%">
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> <el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row> <el-row>
<Field label="频道名称" prop="name" v-model="form.name" placeholder="请输入频道名称"/> <Field :span="20" label="频道名称" prop="name" v-model="form.name" placeholder="请输入频道名称"/>
<Field label="备注" prop="remark" v-model="form.remark" placeholder="请输入备注"/> <Field :span="20" label="备注" prop="remark" type="textarea" v-model="form.remark" placeholder="请输入备注"/>
</el-row> </el-row>
......
...@@ -8,14 +8,18 @@ ...@@ -8,14 +8,18 @@
size="50%"> size="50%">
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> <el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row> <el-row>
<Field label="分类id" prop="categoryId" v-model="form.categoryId" placeholder="请输入分类id"/> <Field label="类型" :span="20" prop="categoryId" v-model="form.categoryId" type="radio" :enum-data="dict.categoryId" placeholder="请输入分类id"/>
<Field label="分类名称" prop="categoryName" v-model="form.categoryName" placeholder="请输入分类名称"/> <Field :span="20" label="封面"><imageUpload v-model="form.titleLogoPath" prePath="/file/preview"/></Field>
<Field label="标题" prop="title" v-model="form.title" type="textarea" placeholder="请输入标题"/> <Field label="标题" :span="20" prop="title" v-model="form.title" placeholder="请输入标题"/>
<Field label="标题logo"><imageUpload v-model="form.titleLogoPath" prePath="/file/preview"/></Field> <Field :span="20" label="内容"><editor v-model="form.content" :min-height="256"/></Field>
<Field label="内容"><editor v-model="form.content" :min-height="256"/></Field>
<Field label="置顶 " prop="top" v-model="form.top" type="select" :enumData="dict.top" placeholder="请选择置顶 "/> <Field :span="20" label="责任编辑" prop="editor" v-model="form.editor" placeholder="请输入责任编辑"/>
<Field label="浏览次数" prop="viewNums" v-model="form.viewNums" type="select" :enumData="dict.viewNums" placeholder="请选择浏览次数"/>
<Field label="发布时间" prop="publishTime" v-model="form.publishTime" type="date" /> <Field :span="20" label="发布部门" prop="deptId" v-model="form.deptId" placeholder="请输入发布部门"/>
<Field :span="20" label="文章来源" prop="source" v-model="form.source" type="textarea" placeholder="请输入文章来源"/>
<Field :span="20" label="声明" prop="statement" v-model="form.statement" type="textarea" placeholder="请输入声明"/>
</el-row> </el-row>
......
...@@ -34,6 +34,20 @@ ...@@ -34,6 +34,20 @@
this.$refs.drawerform.view(row); this.$refs.drawerform.view(row);
}, },
handTop(row,top) {
this.$post("/news/save",{id:row.id,top:top}).then((res) => {
if (res.code == 1) {
this.$message.success("置顶成功!");
this.getData();
}
})
.catch((error) => {
this.$message.error(error.message);
});
},
}, },
data() { data() {
return { return {
...@@ -44,17 +58,18 @@ ...@@ -44,17 +58,18 @@
{type: "selection", width: 60}, {type: "selection", width: 60},
{type: "index",label: "序号",width: 50}, {type: "index",label: "序号",width: 50},
{label: "分类名称", prop: "categoryName"},
{label: "标题", prop: "title"}, {label: "标题", prop: "title"},
{label: "标题logo", prop: "titleLogoPath"}, {label: "新闻类型", prop: "categoryId",formatter: this.formatter},
{label: "内容", prop: "content"}, {label: "创建时间", prop: "createDateTime", formatter: this.formatterDate},
{label: "置顶 ", prop: "top",formatter: this.formatter}, {label: "数据",formatter: row => {
let bool=false;
return (
<div><el-link underline={bool} type="primary">浏览({row.viewNums})</el-link></div>
);}},
{label: "浏览次数", prop: "viewNums",formatter: this.formatter},
{label: "创建用户", prop: "createUserId", formatter: this.formatter}, {label: "创建用户", prop: "createUserId", formatter: this.formatter},
{ {
...@@ -62,7 +77,41 @@ ...@@ -62,7 +77,41 @@
width: 240, width: 240,
formatter: row => { formatter: row => {
return ( return (
<table-buttons noAdd row={row} onEdit={this.toEdit} onView={this.toView} onDel={this.toDel} /> <div>
{row.top === 0 ? (
<el-button
size="mini"
type="text"
icon="el-icon-open"
onClick={() => {
this.handTop(row,1);
}}
>
置顶
</el-button>
) : (
<el-button
size="mini"
type="text"
icon="el-icon-open"
onClick={() => {
this.handTop(row,0);
}}
>
取消置顶
</el-button>
)}
<span> </span>
<table-buttons
noAdd
row={row}
onEdit={this.toEdit}
onView={this.toView}
onDel={this.toDel}
/>
</div>
); );
} }
} }
......
...@@ -4,12 +4,12 @@ import java.util.LinkedHashMap; ...@@ -4,12 +4,12 @@ import java.util.LinkedHashMap;
import java.util.Map; import java.util.Map;
/** /**
* 启用状态 (0.停止,1.启用)枚举类 * 启用状态 (0.停止,1.启用)枚举类
* *
* @author zxfei * @author zxfei
*/ */
public enum EnabledEnum { public enum EnabledEnum {
(0, "停止"), (0, "停用"),
启用(1, "启用"); 启用(1, "启用");
private Integer value; private Integer value;
private String desc; private String desc;
......
package com.mortals.xhx.module.dept.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.dept.model.DeptEntity;
import java.util.List;
/**
* 部门信息Dao
* 部门信息 DAO接口
*
* @author zxfei
* @date 2023-03-06
*/
public interface DeptDao extends ICRUDDao<DeptEntity,Long>{
/**
* 查询子节点
*
* @param
* @return
*/
List<DeptEntity> selectChildrenDeptById(String deptId);
/**
* 查询所有数据
* */
List<DeptEntity> queryAllList();
/**
* 查询部门信息
* */
DeptEntity queryDept(String deptCode);
/**
* 查询是否作为上级本门
* */
DeptEntity queryDeptParient(String parentCode);
/**
* 查询包含本部门所有下级部门
* */
List<DeptEntity> getAllChildrenDept(Long deptId);
}
package com.mortals.xhx.module.dept.dao.ibatis;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import com.mortals.xhx.module.dept.dao.DeptDao;
import com.mortals.xhx.module.dept.model.DeptEntity;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* 部门信息DaoImpl DAO接口
*
* @author zxfei
* @date 2023-03-06
*/
@Repository("deptDao")
public class DeptDaoImpl extends BaseCRUDDaoMybatis<DeptEntity,Long> implements DeptDao {
@Override
public List<DeptEntity> selectChildrenDeptById(String deptId) {
return getSqlSession().selectList(getSqlId("selectChildrenDeptById"), deptId);
}
@Override
public List<DeptEntity> queryAllList() {
return this.getList(new DeptEntity());
}
@Override
public DeptEntity queryDept(String deptCode) {
return getSqlSession().selectOne(getSqlId("queryDept"),deptCode);
}
@Override
public DeptEntity queryDeptParient(String parentCode) {
return getSqlSession().selectOne(getSqlId("queryDeptParient"),parentCode);
}
@Override
public List<DeptEntity> getAllChildrenDept(Long deptId) {
return getSqlSession().selectList(getSqlId("getAllChildrenDept"), deptId);
}
}
package com.mortals.xhx.module.dept.model;
import com.mortals.xhx.module.dept.model.vo.DeptVo;
import lombok.Data;
import java.math.BigDecimal;
/**
* 部门信息实体对象
*
* @author zxfei
* @date 2023-05-16
*/
@Data
public class DeptEntity extends DeptVo {
private static final long serialVersionUID = 1L;
/**
* 父id
*/
private Long parentId;
/**
* 祖级列表
*/
private String ancestors;
/**
* 部门名称
*/
private String deptName;
/**
* 部门编码
*/
private String deptCode;
/**
* 部门状态(0.停用,1.启用)
*/
private Integer deptStatus;
/**
* 顺序
*/
private Integer orderNum;
/**
* 部门人数
*/
private Integer personNum;
/**
* 负责人id
*/
private Long workId;
/**
* 负责人名称
*/
private String workName;
/**
* 备注
*/
private String remark;
/**
* 绩效分数
*/
private BigDecimal score;
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof DeptEntity) {
DeptEntity tmp = (DeptEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public void initAttrValue(){
this.parentId = -1L;
this.ancestors = "";
this.deptName = "";
this.deptCode = "";
this.deptStatus = 1;
this.orderNum = 0;
this.personNum = 0;
this.workId = -1L;
this.workName = "";
this.remark = "";
this.score = new BigDecimal(0);
}
}
\ No newline at end of file
package com.mortals.xhx.module.dept.model;
import java.math.BigDecimal;
import java.util.List;
/**
* 部门信息查询对象
*
* @author zxfei
* @date 2023-05-16
*/
public class DeptQuery extends DeptEntity {
/** 开始 主键ID,主键,自增长 */
private Long idStart;
/** 结束 主键ID,主键,自增长 */
private Long idEnd;
/** 增加 主键ID,主键,自增长 */
private Long idIncrement;
/** 主键ID,主键,自增长列表 */
private List <Long> idList;
/** 主键ID,主键,自增长排除列表 */
private List <Long> idNotList;
/** 开始 父id */
private Long parentIdStart;
/** 结束 父id */
private Long parentIdEnd;
/** 增加 父id */
private Long parentIdIncrement;
/** 父id列表 */
private List <Long> parentIdList;
/** 父id排除列表 */
private List <Long> parentIdNotList;
/** 祖级列表 */
private List<String> ancestorsList;
/** 祖级列表排除列表 */
private List <String> ancestorsNotList;
/** 部门名称 */
private List<String> deptNameList;
/** 部门名称排除列表 */
private List <String> deptNameNotList;
/** 部门编码 */
private List<String> deptCodeList;
/** 部门编码排除列表 */
private List <String> deptCodeNotList;
/** 开始 部门状态(0.停用,1.启用) */
private Integer deptStatusStart;
/** 结束 部门状态(0.停用,1.启用) */
private Integer deptStatusEnd;
/** 增加 部门状态(0.停用,1.启用) */
private Integer deptStatusIncrement;
/** 部门状态(0.停用,1.启用)列表 */
private List <Integer> deptStatusList;
/** 部门状态(0.停用,1.启用)排除列表 */
private List <Integer> deptStatusNotList;
/** 开始 顺序 */
private Integer orderNumStart;
/** 结束 顺序 */
private Integer orderNumEnd;
/** 增加 顺序 */
private Integer orderNumIncrement;
/** 顺序列表 */
private List <Integer> orderNumList;
/** 顺序排除列表 */
private List <Integer> orderNumNotList;
/** 开始 部门人数 */
private Integer personNumStart;
/** 结束 部门人数 */
private Integer personNumEnd;
/** 增加 部门人数 */
private Integer personNumIncrement;
/** 部门人数列表 */
private List <Integer> personNumList;
/** 部门人数排除列表 */
private List <Integer> personNumNotList;
/** 开始 负责人id */
private Long workIdStart;
/** 结束 负责人id */
private Long workIdEnd;
/** 增加 负责人id */
private Long workIdIncrement;
/** 负责人id列表 */
private List <Long> workIdList;
/** 负责人id排除列表 */
private List <Long> workIdNotList;
/** 负责人名称 */
private List<String> workNameList;
/** 负责人名称排除列表 */
private List <String> workNameNotList;
/** 备注 */
private List<String> remarkList;
/** 备注排除列表 */
private List <String> remarkNotList;
/** 开始 创建用户 */
private Long createUserIdStart;
/** 结束 创建用户 */
private Long createUserIdEnd;
/** 增加 创建用户 */
private Long createUserIdIncrement;
/** 创建用户列表 */
private List <Long> createUserIdList;
/** 创建用户排除列表 */
private List <Long> createUserIdNotList;
/** 开始 创建时间 */
private String createTimeStart;
/** 结束 创建时间 */
private String createTimeEnd;
/** 开始 更新用户 */
private Long updateUserIdStart;
/** 结束 更新用户 */
private Long updateUserIdEnd;
/** 增加 更新用户 */
private Long updateUserIdIncrement;
/** 更新用户列表 */
private List <Long> updateUserIdList;
/** 更新用户排除列表 */
private List <Long> updateUserIdNotList;
/** 开始 更新时间 */
private String updateTimeStart;
/** 结束 更新时间 */
private String updateTimeEnd;
/** 开始 绩效分数 */
private BigDecimal scoreStart;
/** 结束 绩效分数 */
private BigDecimal scoreEnd;
/** 增加 绩效分数 */
private BigDecimal scoreIncrement;
/** 绩效分数列表 */
private List <BigDecimal> scoreList;
/** 绩效分数排除列表 */
private List <BigDecimal> scoreNotList;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
private List<DeptQuery> orConditionList;
/** AND条件集合,列表项之间是AND,项内容之间是OR,如:(list[0].1 or list[0].2) and (list[1].3 or list[1].4) */
private List<DeptQuery> andConditionList;
public DeptQuery(){}
/**
* 获取 开始 主键ID,主键,自增长
* @return idStart
*/
public Long getIdStart(){
return this.idStart;
}
/**
* 设置 开始 主键ID,主键,自增长
* @param idStart
*/
public void setIdStart(Long idStart){
this.idStart = idStart;
}
/**
* 获取 结束 主键ID,主键,自增长
* @return $idEnd
*/
public Long getIdEnd(){
return this.idEnd;
}
/**
* 设置 结束 主键ID,主键,自增长
* @param idEnd
*/
public void setIdEnd(Long idEnd){
this.idEnd = idEnd;
}
/**
* 获取 增加 主键ID,主键,自增长
* @return idIncrement
*/
public Long getIdIncrement(){
return this.idIncrement;
}
/**
* 设置 增加 主键ID,主键,自增长
* @param idIncrement
*/
public void setIdIncrement(Long idIncrement){
this.idIncrement = idIncrement;
}
/**
* 获取 主键ID,主键,自增长
* @return idList
*/
public List<Long> getIdList(){
return this.idList;
}
/**
* 设置 主键ID,主键,自增长
* @param idList
*/
public void setIdList(List<Long> idList){
this.idList = idList;
}
/**
* 获取 主键ID,主键,自增长
* @return idNotList
*/
public List<Long> getIdNotList(){
return this.idNotList;
}
/**
* 设置 主键ID,主键,自增长
* @param idNotList
*/
public void setIdNotList(List<Long> idNotList){
this.idNotList = idNotList;
}
/**
* 获取 开始 父id
* @return parentIdStart
*/
public Long getParentIdStart(){
return this.parentIdStart;
}
/**
* 设置 开始 父id
* @param parentIdStart
*/
public void setParentIdStart(Long parentIdStart){
this.parentIdStart = parentIdStart;
}
/**
* 获取 结束 父id
* @return $parentIdEnd
*/
public Long getParentIdEnd(){
return this.parentIdEnd;
}
/**
* 设置 结束 父id
* @param parentIdEnd
*/
public void setParentIdEnd(Long parentIdEnd){
this.parentIdEnd = parentIdEnd;
}
/**
* 获取 增加 父id
* @return parentIdIncrement
*/
public Long getParentIdIncrement(){
return this.parentIdIncrement;
}
/**
* 设置 增加 父id
* @param parentIdIncrement
*/
public void setParentIdIncrement(Long parentIdIncrement){
this.parentIdIncrement = parentIdIncrement;
}
/**
* 获取 父id
* @return parentIdList
*/
public List<Long> getParentIdList(){
return this.parentIdList;
}
/**
* 设置 父id
* @param parentIdList
*/
public void setParentIdList(List<Long> parentIdList){
this.parentIdList = parentIdList;
}
/**
* 获取 父id
* @return parentIdNotList
*/
public List<Long> getParentIdNotList(){
return this.parentIdNotList;
}
/**
* 设置 父id
* @param parentIdNotList
*/
public void setParentIdNotList(List<Long> parentIdNotList){
this.parentIdNotList = parentIdNotList;
}
/**
* 获取 祖级列表
* @return ancestorsList
*/
public List<String> getAncestorsList(){
return this.ancestorsList;
}
/**
* 设置 祖级列表
* @param ancestorsList
*/
public void setAncestorsList(List<String> ancestorsList){
this.ancestorsList = ancestorsList;
}
/**
* 获取 祖级列表
* @return ancestorsNotList
*/
public List<String> getAncestorsNotList(){
return this.ancestorsNotList;
}
/**
* 设置 祖级列表
* @param ancestorsNotList
*/
public void setAncestorsNotList(List<String> ancestorsNotList){
this.ancestorsNotList = ancestorsNotList;
}
/**
* 获取 部门名称
* @return deptNameList
*/
public List<String> getDeptNameList(){
return this.deptNameList;
}
/**
* 设置 部门名称
* @param deptNameList
*/
public void setDeptNameList(List<String> deptNameList){
this.deptNameList = deptNameList;
}
/**
* 获取 部门名称
* @return deptNameNotList
*/
public List<String> getDeptNameNotList(){
return this.deptNameNotList;
}
/**
* 设置 部门名称
* @param deptNameNotList
*/
public void setDeptNameNotList(List<String> deptNameNotList){
this.deptNameNotList = deptNameNotList;
}
/**
* 获取 部门编码
* @return deptCodeList
*/
public List<String> getDeptCodeList(){
return this.deptCodeList;
}
/**
* 设置 部门编码
* @param deptCodeList
*/
public void setDeptCodeList(List<String> deptCodeList){
this.deptCodeList = deptCodeList;
}
/**
* 获取 部门编码
* @return deptCodeNotList
*/
public List<String> getDeptCodeNotList(){
return this.deptCodeNotList;
}
/**
* 设置 部门编码
* @param deptCodeNotList
*/
public void setDeptCodeNotList(List<String> deptCodeNotList){
this.deptCodeNotList = deptCodeNotList;
}
/**
* 获取 开始 部门状态(0.停用,1.启用)
* @return deptStatusStart
*/
public Integer getDeptStatusStart(){
return this.deptStatusStart;
}
/**
* 设置 开始 部门状态(0.停用,1.启用)
* @param deptStatusStart
*/
public void setDeptStatusStart(Integer deptStatusStart){
this.deptStatusStart = deptStatusStart;
}
/**
* 获取 结束 部门状态(0.停用,1.启用)
* @return $deptStatusEnd
*/
public Integer getDeptStatusEnd(){
return this.deptStatusEnd;
}
/**
* 设置 结束 部门状态(0.停用,1.启用)
* @param deptStatusEnd
*/
public void setDeptStatusEnd(Integer deptStatusEnd){
this.deptStatusEnd = deptStatusEnd;
}
/**
* 获取 增加 部门状态(0.停用,1.启用)
* @return deptStatusIncrement
*/
public Integer getDeptStatusIncrement(){
return this.deptStatusIncrement;
}
/**
* 设置 增加 部门状态(0.停用,1.启用)
* @param deptStatusIncrement
*/
public void setDeptStatusIncrement(Integer deptStatusIncrement){
this.deptStatusIncrement = deptStatusIncrement;
}
/**
* 获取 部门状态(0.停用,1.启用)
* @return deptStatusList
*/
public List<Integer> getDeptStatusList(){
return this.deptStatusList;
}
/**
* 设置 部门状态(0.停用,1.启用)
* @param deptStatusList
*/
public void setDeptStatusList(List<Integer> deptStatusList){
this.deptStatusList = deptStatusList;
}
/**
* 获取 部门状态(0.停用,1.启用)
* @return deptStatusNotList
*/
public List<Integer> getDeptStatusNotList(){
return this.deptStatusNotList;
}
/**
* 设置 部门状态(0.停用,1.启用)
* @param deptStatusNotList
*/
public void setDeptStatusNotList(List<Integer> deptStatusNotList){
this.deptStatusNotList = deptStatusNotList;
}
/**
* 获取 开始 顺序
* @return orderNumStart
*/
public Integer getOrderNumStart(){
return this.orderNumStart;
}
/**
* 设置 开始 顺序
* @param orderNumStart
*/
public void setOrderNumStart(Integer orderNumStart){
this.orderNumStart = orderNumStart;
}
/**
* 获取 结束 顺序
* @return $orderNumEnd
*/
public Integer getOrderNumEnd(){
return this.orderNumEnd;
}
/**
* 设置 结束 顺序
* @param orderNumEnd
*/
public void setOrderNumEnd(Integer orderNumEnd){
this.orderNumEnd = orderNumEnd;
}
/**
* 获取 增加 顺序
* @return orderNumIncrement
*/
public Integer getOrderNumIncrement(){
return this.orderNumIncrement;
}
/**
* 设置 增加 顺序
* @param orderNumIncrement
*/
public void setOrderNumIncrement(Integer orderNumIncrement){
this.orderNumIncrement = orderNumIncrement;
}
/**
* 获取 顺序
* @return orderNumList
*/
public List<Integer> getOrderNumList(){
return this.orderNumList;
}
/**
* 设置 顺序
* @param orderNumList
*/
public void setOrderNumList(List<Integer> orderNumList){
this.orderNumList = orderNumList;
}
/**
* 获取 顺序
* @return orderNumNotList
*/
public List<Integer> getOrderNumNotList(){
return this.orderNumNotList;
}
/**
* 设置 顺序
* @param orderNumNotList
*/
public void setOrderNumNotList(List<Integer> orderNumNotList){
this.orderNumNotList = orderNumNotList;
}
/**
* 获取 开始 部门人数
* @return personNumStart
*/
public Integer getPersonNumStart(){
return this.personNumStart;
}
/**
* 设置 开始 部门人数
* @param personNumStart
*/
public void setPersonNumStart(Integer personNumStart){
this.personNumStart = personNumStart;
}
/**
* 获取 结束 部门人数
* @return $personNumEnd
*/
public Integer getPersonNumEnd(){
return this.personNumEnd;
}
/**
* 设置 结束 部门人数
* @param personNumEnd
*/
public void setPersonNumEnd(Integer personNumEnd){
this.personNumEnd = personNumEnd;
}
/**
* 获取 增加 部门人数
* @return personNumIncrement
*/
public Integer getPersonNumIncrement(){
return this.personNumIncrement;
}
/**
* 设置 增加 部门人数
* @param personNumIncrement
*/
public void setPersonNumIncrement(Integer personNumIncrement){
this.personNumIncrement = personNumIncrement;
}
/**
* 获取 部门人数
* @return personNumList
*/
public List<Integer> getPersonNumList(){
return this.personNumList;
}
/**
* 设置 部门人数
* @param personNumList
*/
public void setPersonNumList(List<Integer> personNumList){
this.personNumList = personNumList;
}
/**
* 获取 部门人数
* @return personNumNotList
*/
public List<Integer> getPersonNumNotList(){
return this.personNumNotList;
}
/**
* 设置 部门人数
* @param personNumNotList
*/
public void setPersonNumNotList(List<Integer> personNumNotList){
this.personNumNotList = personNumNotList;
}
/**
* 获取 开始 负责人id
* @return workIdStart
*/
public Long getWorkIdStart(){
return this.workIdStart;
}
/**
* 设置 开始 负责人id
* @param workIdStart
*/
public void setWorkIdStart(Long workIdStart){
this.workIdStart = workIdStart;
}
/**
* 获取 结束 负责人id
* @return $workIdEnd
*/
public Long getWorkIdEnd(){
return this.workIdEnd;
}
/**
* 设置 结束 负责人id
* @param workIdEnd
*/
public void setWorkIdEnd(Long workIdEnd){
this.workIdEnd = workIdEnd;
}
/**
* 获取 增加 负责人id
* @return workIdIncrement
*/
public Long getWorkIdIncrement(){
return this.workIdIncrement;
}
/**
* 设置 增加 负责人id
* @param workIdIncrement
*/
public void setWorkIdIncrement(Long workIdIncrement){
this.workIdIncrement = workIdIncrement;
}
/**
* 获取 负责人id
* @return workIdList
*/
public List<Long> getWorkIdList(){
return this.workIdList;
}
/**
* 设置 负责人id
* @param workIdList
*/
public void setWorkIdList(List<Long> workIdList){
this.workIdList = workIdList;
}
/**
* 获取 负责人id
* @return workIdNotList
*/
public List<Long> getWorkIdNotList(){
return this.workIdNotList;
}
/**
* 设置 负责人id
* @param workIdNotList
*/
public void setWorkIdNotList(List<Long> workIdNotList){
this.workIdNotList = workIdNotList;
}
/**
* 获取 负责人名称
* @return workNameList
*/
public List<String> getWorkNameList(){
return this.workNameList;
}
/**
* 设置 负责人名称
* @param workNameList
*/
public void setWorkNameList(List<String> workNameList){
this.workNameList = workNameList;
}
/**
* 获取 负责人名称
* @return workNameNotList
*/
public List<String> getWorkNameNotList(){
return this.workNameNotList;
}
/**
* 设置 负责人名称
* @param workNameNotList
*/
public void setWorkNameNotList(List<String> workNameNotList){
this.workNameNotList = workNameNotList;
}
/**
* 获取 备注
* @return remarkList
*/
public List<String> getRemarkList(){
return this.remarkList;
}
/**
* 设置 备注
* @param remarkList
*/
public void setRemarkList(List<String> remarkList){
this.remarkList = remarkList;
}
/**
* 获取 备注
* @return remarkNotList
*/
public List<String> getRemarkNotList(){
return this.remarkNotList;
}
/**
* 设置 备注
* @param remarkNotList
*/
public void setRemarkNotList(List<String> remarkNotList){
this.remarkNotList = remarkNotList;
}
/**
* 获取 开始 创建用户
* @return createUserIdStart
*/
public Long getCreateUserIdStart(){
return this.createUserIdStart;
}
/**
* 设置 开始 创建用户
* @param createUserIdStart
*/
public void setCreateUserIdStart(Long createUserIdStart){
this.createUserIdStart = createUserIdStart;
}
/**
* 获取 结束 创建用户
* @return $createUserIdEnd
*/
public Long getCreateUserIdEnd(){
return this.createUserIdEnd;
}
/**
* 设置 结束 创建用户
* @param createUserIdEnd
*/
public void setCreateUserIdEnd(Long createUserIdEnd){
this.createUserIdEnd = createUserIdEnd;
}
/**
* 获取 增加 创建用户
* @return createUserIdIncrement
*/
public Long getCreateUserIdIncrement(){
return this.createUserIdIncrement;
}
/**
* 设置 增加 创建用户
* @param createUserIdIncrement
*/
public void setCreateUserIdIncrement(Long createUserIdIncrement){
this.createUserIdIncrement = createUserIdIncrement;
}
/**
* 获取 创建用户
* @return createUserIdList
*/
public List<Long> getCreateUserIdList(){
return this.createUserIdList;
}
/**
* 设置 创建用户
* @param createUserIdList
*/
public void setCreateUserIdList(List<Long> createUserIdList){
this.createUserIdList = createUserIdList;
}
/**
* 获取 创建用户
* @return createUserIdNotList
*/
public List<Long> getCreateUserIdNotList(){
return this.createUserIdNotList;
}
/**
* 设置 创建用户
* @param createUserIdNotList
*/
public void setCreateUserIdNotList(List<Long> createUserIdNotList){
this.createUserIdNotList = createUserIdNotList;
}
/**
* 获取 开始 创建时间
* @return createTimeStart
*/
public String getCreateTimeStart(){
return this.createTimeStart;
}
/**
* 设置 开始 创建时间
* @param createTimeStart
*/
public void setCreateTimeStart(String createTimeStart){
this.createTimeStart = createTimeStart;
}
/**
* 获取 结束 创建时间
* @return createTimeEnd
*/
public String getCreateTimeEnd(){
return this.createTimeEnd;
}
/**
* 设置 结束 创建时间
* @param createTimeEnd
*/
public void setCreateTimeEnd(String createTimeEnd){
this.createTimeEnd = createTimeEnd;
}
/**
* 获取 开始 更新用户
* @return updateUserIdStart
*/
public Long getUpdateUserIdStart(){
return this.updateUserIdStart;
}
/**
* 设置 开始 更新用户
* @param updateUserIdStart
*/
public void setUpdateUserIdStart(Long updateUserIdStart){
this.updateUserIdStart = updateUserIdStart;
}
/**
* 获取 结束 更新用户
* @return $updateUserIdEnd
*/
public Long getUpdateUserIdEnd(){
return this.updateUserIdEnd;
}
/**
* 设置 结束 更新用户
* @param updateUserIdEnd
*/
public void setUpdateUserIdEnd(Long updateUserIdEnd){
this.updateUserIdEnd = updateUserIdEnd;
}
/**
* 获取 增加 更新用户
* @return updateUserIdIncrement
*/
public Long getUpdateUserIdIncrement(){
return this.updateUserIdIncrement;
}
/**
* 设置 增加 更新用户
* @param updateUserIdIncrement
*/
public void setUpdateUserIdIncrement(Long updateUserIdIncrement){
this.updateUserIdIncrement = updateUserIdIncrement;
}
/**
* 获取 更新用户
* @return updateUserIdList
*/
public List<Long> getUpdateUserIdList(){
return this.updateUserIdList;
}
/**
* 设置 更新用户
* @param updateUserIdList
*/
public void setUpdateUserIdList(List<Long> updateUserIdList){
this.updateUserIdList = updateUserIdList;
}
/**
* 获取 更新用户
* @return updateUserIdNotList
*/
public List<Long> getUpdateUserIdNotList(){
return this.updateUserIdNotList;
}
/**
* 设置 更新用户
* @param updateUserIdNotList
*/
public void setUpdateUserIdNotList(List<Long> updateUserIdNotList){
this.updateUserIdNotList = updateUserIdNotList;
}
/**
* 获取 开始 更新时间
* @return updateTimeStart
*/
public String getUpdateTimeStart(){
return this.updateTimeStart;
}
/**
* 设置 开始 更新时间
* @param updateTimeStart
*/
public void setUpdateTimeStart(String updateTimeStart){
this.updateTimeStart = updateTimeStart;
}
/**
* 获取 结束 更新时间
* @return updateTimeEnd
*/
public String getUpdateTimeEnd(){
return this.updateTimeEnd;
}
/**
* 设置 结束 更新时间
* @param updateTimeEnd
*/
public void setUpdateTimeEnd(String updateTimeEnd){
this.updateTimeEnd = updateTimeEnd;
}
/**
* 获取 开始 绩效分数
* @return scoreStart
*/
public BigDecimal getScoreStart(){
return this.scoreStart;
}
/**
* 设置 开始 绩效分数
* @param scoreStart
*/
public void setScoreStart(BigDecimal scoreStart){
this.scoreStart = scoreStart;
}
/**
* 获取 结束 绩效分数
* @return $scoreEnd
*/
public BigDecimal getScoreEnd(){
return this.scoreEnd;
}
/**
* 设置 结束 绩效分数
* @param scoreEnd
*/
public void setScoreEnd(BigDecimal scoreEnd){
this.scoreEnd = scoreEnd;
}
/**
* 获取 增加 绩效分数
* @return scoreIncrement
*/
public BigDecimal getScoreIncrement(){
return this.scoreIncrement;
}
/**
* 设置 增加 绩效分数
* @param scoreIncrement
*/
public void setScoreIncrement(BigDecimal scoreIncrement){
this.scoreIncrement = scoreIncrement;
}
/**
* 获取 绩效分数
* @return scoreList
*/
public List<BigDecimal> getScoreList(){
return this.scoreList;
}
/**
* 设置 绩效分数
* @param scoreList
*/
public void setScoreList(List<BigDecimal> scoreList){
this.scoreList = scoreList;
}
/**
* 获取 绩效分数
* @return scoreNotList
*/
public List<BigDecimal> getScoreNotList(){
return this.scoreNotList;
}
/**
* 设置 绩效分数
* @param scoreNotList
*/
public void setScoreNotList(List<BigDecimal> scoreNotList){
this.scoreNotList = scoreNotList;
}
/**
* 设置 主键ID,主键,自增长
* @param id
*/
public DeptQuery id(Long id){
setId(id);
return this;
}
/**
* 设置 开始 主键ID,主键,自增长
* @param idStart
*/
public DeptQuery idStart(Long idStart){
this.idStart = idStart;
return this;
}
/**
* 设置 结束 主键ID,主键,自增长
* @param idEnd
*/
public DeptQuery idEnd(Long idEnd){
this.idEnd = idEnd;
return this;
}
/**
* 设置 增加 主键ID,主键,自增长
* @param idIncrement
*/
public DeptQuery idIncrement(Long idIncrement){
this.idIncrement = idIncrement;
return this;
}
/**
* 设置 主键ID,主键,自增长
* @param idList
*/
public DeptQuery idList(List<Long> idList){
this.idList = idList;
return this;
}
/**
* 设置 主键ID,主键,自增长
* @param idNotList
*/
public DeptQuery idNotList(List<Long> idNotList){
this.idNotList = idNotList;
return this;
}
/**
* 设置 父id
* @param parentId
*/
public DeptQuery parentId(Long parentId){
setParentId(parentId);
return this;
}
/**
* 设置 开始 父id
* @param parentIdStart
*/
public DeptQuery parentIdStart(Long parentIdStart){
this.parentIdStart = parentIdStart;
return this;
}
/**
* 设置 结束 父id
* @param parentIdEnd
*/
public DeptQuery parentIdEnd(Long parentIdEnd){
this.parentIdEnd = parentIdEnd;
return this;
}
/**
* 设置 增加 父id
* @param parentIdIncrement
*/
public DeptQuery parentIdIncrement(Long parentIdIncrement){
this.parentIdIncrement = parentIdIncrement;
return this;
}
/**
* 设置 父id
* @param parentIdList
*/
public DeptQuery parentIdList(List<Long> parentIdList){
this.parentIdList = parentIdList;
return this;
}
/**
* 设置 父id
* @param parentIdNotList
*/
public DeptQuery parentIdNotList(List<Long> parentIdNotList){
this.parentIdNotList = parentIdNotList;
return this;
}
/**
* 设置 祖级列表
* @param ancestors
*/
public DeptQuery ancestors(String ancestors){
setAncestors(ancestors);
return this;
}
/**
* 设置 祖级列表
* @param ancestorsList
*/
public DeptQuery ancestorsList(List<String> ancestorsList){
this.ancestorsList = ancestorsList;
return this;
}
/**
* 设置 部门名称
* @param deptName
*/
public DeptQuery deptName(String deptName){
setDeptName(deptName);
return this;
}
/**
* 设置 部门名称
* @param deptNameList
*/
public DeptQuery deptNameList(List<String> deptNameList){
this.deptNameList = deptNameList;
return this;
}
/**
* 设置 部门编码
* @param deptCode
*/
public DeptQuery deptCode(String deptCode){
setDeptCode(deptCode);
return this;
}
/**
* 设置 部门编码
* @param deptCodeList
*/
public DeptQuery deptCodeList(List<String> deptCodeList){
this.deptCodeList = deptCodeList;
return this;
}
/**
* 设置 部门状态(0.停用,1.启用)
* @param deptStatus
*/
public DeptQuery deptStatus(Integer deptStatus){
setDeptStatus(deptStatus);
return this;
}
/**
* 设置 开始 部门状态(0.停用,1.启用)
* @param deptStatusStart
*/
public DeptQuery deptStatusStart(Integer deptStatusStart){
this.deptStatusStart = deptStatusStart;
return this;
}
/**
* 设置 结束 部门状态(0.停用,1.启用)
* @param deptStatusEnd
*/
public DeptQuery deptStatusEnd(Integer deptStatusEnd){
this.deptStatusEnd = deptStatusEnd;
return this;
}
/**
* 设置 增加 部门状态(0.停用,1.启用)
* @param deptStatusIncrement
*/
public DeptQuery deptStatusIncrement(Integer deptStatusIncrement){
this.deptStatusIncrement = deptStatusIncrement;
return this;
}
/**
* 设置 部门状态(0.停用,1.启用)
* @param deptStatusList
*/
public DeptQuery deptStatusList(List<Integer> deptStatusList){
this.deptStatusList = deptStatusList;
return this;
}
/**
* 设置 部门状态(0.停用,1.启用)
* @param deptStatusNotList
*/
public DeptQuery deptStatusNotList(List<Integer> deptStatusNotList){
this.deptStatusNotList = deptStatusNotList;
return this;
}
/**
* 设置 顺序
* @param orderNum
*/
public DeptQuery orderNum(Integer orderNum){
setOrderNum(orderNum);
return this;
}
/**
* 设置 开始 顺序
* @param orderNumStart
*/
public DeptQuery orderNumStart(Integer orderNumStart){
this.orderNumStart = orderNumStart;
return this;
}
/**
* 设置 结束 顺序
* @param orderNumEnd
*/
public DeptQuery orderNumEnd(Integer orderNumEnd){
this.orderNumEnd = orderNumEnd;
return this;
}
/**
* 设置 增加 顺序
* @param orderNumIncrement
*/
public DeptQuery orderNumIncrement(Integer orderNumIncrement){
this.orderNumIncrement = orderNumIncrement;
return this;
}
/**
* 设置 顺序
* @param orderNumList
*/
public DeptQuery orderNumList(List<Integer> orderNumList){
this.orderNumList = orderNumList;
return this;
}
/**
* 设置 顺序
* @param orderNumNotList
*/
public DeptQuery orderNumNotList(List<Integer> orderNumNotList){
this.orderNumNotList = orderNumNotList;
return this;
}
/**
* 设置 部门人数
* @param personNum
*/
public DeptQuery personNum(Integer personNum){
setPersonNum(personNum);
return this;
}
/**
* 设置 开始 部门人数
* @param personNumStart
*/
public DeptQuery personNumStart(Integer personNumStart){
this.personNumStart = personNumStart;
return this;
}
/**
* 设置 结束 部门人数
* @param personNumEnd
*/
public DeptQuery personNumEnd(Integer personNumEnd){
this.personNumEnd = personNumEnd;
return this;
}
/**
* 设置 增加 部门人数
* @param personNumIncrement
*/
public DeptQuery personNumIncrement(Integer personNumIncrement){
this.personNumIncrement = personNumIncrement;
return this;
}
/**
* 设置 部门人数
* @param personNumList
*/
public DeptQuery personNumList(List<Integer> personNumList){
this.personNumList = personNumList;
return this;
}
/**
* 设置 部门人数
* @param personNumNotList
*/
public DeptQuery personNumNotList(List<Integer> personNumNotList){
this.personNumNotList = personNumNotList;
return this;
}
/**
* 设置 负责人id
* @param workId
*/
public DeptQuery workId(Long workId){
setWorkId(workId);
return this;
}
/**
* 设置 开始 负责人id
* @param workIdStart
*/
public DeptQuery workIdStart(Long workIdStart){
this.workIdStart = workIdStart;
return this;
}
/**
* 设置 结束 负责人id
* @param workIdEnd
*/
public DeptQuery workIdEnd(Long workIdEnd){
this.workIdEnd = workIdEnd;
return this;
}
/**
* 设置 增加 负责人id
* @param workIdIncrement
*/
public DeptQuery workIdIncrement(Long workIdIncrement){
this.workIdIncrement = workIdIncrement;
return this;
}
/**
* 设置 负责人id
* @param workIdList
*/
public DeptQuery workIdList(List<Long> workIdList){
this.workIdList = workIdList;
return this;
}
/**
* 设置 负责人id
* @param workIdNotList
*/
public DeptQuery workIdNotList(List<Long> workIdNotList){
this.workIdNotList = workIdNotList;
return this;
}
/**
* 设置 负责人名称
* @param workName
*/
public DeptQuery workName(String workName){
setWorkName(workName);
return this;
}
/**
* 设置 负责人名称
* @param workNameList
*/
public DeptQuery workNameList(List<String> workNameList){
this.workNameList = workNameList;
return this;
}
/**
* 设置 备注
* @param remark
*/
public DeptQuery remark(String remark){
setRemark(remark);
return this;
}
/**
* 设置 备注
* @param remarkList
*/
public DeptQuery remarkList(List<String> remarkList){
this.remarkList = remarkList;
return this;
}
/**
* 设置 创建用户
* @param createUserId
*/
public DeptQuery createUserId(Long createUserId){
setCreateUserId(createUserId);
return this;
}
/**
* 设置 开始 创建用户
* @param createUserIdStart
*/
public DeptQuery createUserIdStart(Long createUserIdStart){
this.createUserIdStart = createUserIdStart;
return this;
}
/**
* 设置 结束 创建用户
* @param createUserIdEnd
*/
public DeptQuery createUserIdEnd(Long createUserIdEnd){
this.createUserIdEnd = createUserIdEnd;
return this;
}
/**
* 设置 增加 创建用户
* @param createUserIdIncrement
*/
public DeptQuery createUserIdIncrement(Long createUserIdIncrement){
this.createUserIdIncrement = createUserIdIncrement;
return this;
}
/**
* 设置 创建用户
* @param createUserIdList
*/
public DeptQuery createUserIdList(List<Long> createUserIdList){
this.createUserIdList = createUserIdList;
return this;
}
/**
* 设置 创建用户
* @param createUserIdNotList
*/
public DeptQuery createUserIdNotList(List<Long> createUserIdNotList){
this.createUserIdNotList = createUserIdNotList;
return this;
}
/**
* 设置 更新用户
* @param updateUserId
*/
public DeptQuery updateUserId(Long updateUserId){
setUpdateUserId(updateUserId);
return this;
}
/**
* 设置 开始 更新用户
* @param updateUserIdStart
*/
public DeptQuery updateUserIdStart(Long updateUserIdStart){
this.updateUserIdStart = updateUserIdStart;
return this;
}
/**
* 设置 结束 更新用户
* @param updateUserIdEnd
*/
public DeptQuery updateUserIdEnd(Long updateUserIdEnd){
this.updateUserIdEnd = updateUserIdEnd;
return this;
}
/**
* 设置 增加 更新用户
* @param updateUserIdIncrement
*/
public DeptQuery updateUserIdIncrement(Long updateUserIdIncrement){
this.updateUserIdIncrement = updateUserIdIncrement;
return this;
}
/**
* 设置 更新用户
* @param updateUserIdList
*/
public DeptQuery updateUserIdList(List<Long> updateUserIdList){
this.updateUserIdList = updateUserIdList;
return this;
}
/**
* 设置 更新用户
* @param updateUserIdNotList
*/
public DeptQuery updateUserIdNotList(List<Long> updateUserIdNotList){
this.updateUserIdNotList = updateUserIdNotList;
return this;
}
/**
* 设置 绩效分数
* @param score
*/
public DeptQuery score(BigDecimal score){
setScore(score);
return this;
}
/**
* 设置 开始 绩效分数
* @param scoreStart
*/
public DeptQuery scoreStart(BigDecimal scoreStart){
this.scoreStart = scoreStart;
return this;
}
/**
* 设置 结束 绩效分数
* @param scoreEnd
*/
public DeptQuery scoreEnd(BigDecimal scoreEnd){
this.scoreEnd = scoreEnd;
return this;
}
/**
* 设置 增加 绩效分数
* @param scoreIncrement
*/
public DeptQuery scoreIncrement(BigDecimal scoreIncrement){
this.scoreIncrement = scoreIncrement;
return this;
}
/**
* 设置 绩效分数
* @param scoreList
*/
public DeptQuery scoreList(List<BigDecimal> scoreList){
this.scoreList = scoreList;
return this;
}
/**
* 设置 绩效分数
* @param scoreNotList
*/
public DeptQuery scoreNotList(List<BigDecimal> scoreNotList){
this.scoreNotList = scoreNotList;
return this;
}
/**
* 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @return orConditionList
*/
public List<DeptQuery> getOrConditionList(){
return this.orConditionList;
}
/**
* 设置 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @param orConditionList
*/
public void setOrConditionList(List<DeptQuery> orConditionList){
this.orConditionList = orConditionList;
}
/**
* 获取 AND条件集合,列表项之间是AND,项内容之间是OR,如:(list[0].1 or list[0].2) and (list[1].3 or list[1].4)
* @return andConditionList
*/
public List<DeptQuery> getAndConditionList(){
return this.andConditionList;
}
/**
* 设置 AND条件集合,列表项之间是AND,项内容之间是OR,如:(list[0].1 or list[0].2) and (list[1].3 or list[1].4)
* @param andConditionList
*/
public void setAndConditionList(List<DeptQuery> andConditionList){
this.andConditionList = andConditionList;
}
}
\ No newline at end of file
package com.mortals.xhx.module.dept.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import org.springframework.util.ObjectUtils;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 部门信息前端映射树结构实体类
*
* @author zxfei
* @date 2023-03-06
*/
@Data
public class DeptTreeSelect implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 节点ID
*/
private Long id;
/**
* 节点名称
*/
private String label;
private Integer personNum;
/**
* 子节点
*/
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private List<DeptTreeSelect> children;
/**
* 子节点
*/
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private List<Map<String, Object>> personList;
public DeptTreeSelect(DeptEntity entity) {
this.id = entity.getId();
this.label = entity.getDeptName();
this.personNum = entity.getPersonNum();
if (!ObjectUtils.isEmpty(entity.getChildren())) {
this.children = entity.getChildren().stream().map(DeptTreeSelect::new).collect(Collectors.toList());
}
this.personList = entity.getPersonList();
}
}
package com.mortals.xhx.module.dept.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.dept.model.DeptEntity;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* 部门信息视图对象
*
* @author zxfei
* @date 2023-03-06
*/
@Data
public class DeptVo extends BaseEntityLong {
/** 子部门信息 */
private List<DeptEntity> children = new ArrayList<>();
/** 子节点人员信息 */
private List<Map<String,Object>> personList = new ArrayList<>();
//成员数量
}
package com.mortals.xhx.module.dept.service;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.dept.dao.DeptDao;
import com.mortals.xhx.module.dept.model.DeptEntity;
import com.mortals.xhx.module.dept.model.DeptTreeSelect;
import java.util.List;
/**
* DeptService
* <p>
* 部门信息 service接口
*
* @author zxfei
* @date 2023-03-06
*/
public interface DeptService extends ICRUDService<DeptEntity, Long> {
DeptDao getDao();
/**
* 是否存在部门信息节点
*
* @param deptId 部门信息ID
* @return 结果
*/
boolean hasChildByDeptId(Long deptId);
/**
* 查询部门信息数据
*
* @param dept 部门信息
* @return 部门信息集合
*/
List<DeptEntity> selectDeptList(DeptEntity dept);
/**
* 构建前端所需要下拉树结构
*
* @param deptList 部门信息列表
* @return 下拉树结构列表
*/
List<DeptTreeSelect> buildDeptTreeSelect(List<DeptEntity> deptList);
/**
* 根据父id查询子节点
*
* @param parentId
* @param context
* @return
*/
List<DeptTreeSelect> getListByParentId(Long parentId, Context context);
/**
* 更新部门人员数量
*
* @param context
*/
Rest<Void> updateDeptNum(Context context);
/**
* 查询包含本部门所有下级部门
* */
List<DeptEntity> getAllChildrenDept(Long deptId) throws AppException;
}
\ No newline at end of file
package com.mortals.xhx.module.dept.service.impl;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.xhx.common.code.EnabledEnum;
import com.mortals.xhx.module.dept.dao.DeptDao;
import com.mortals.xhx.module.dept.model.DeptEntity;
import com.mortals.xhx.module.dept.model.DeptQuery;
import com.mortals.xhx.module.dept.model.DeptTreeSelect;
import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.model.StaffQuery;
import com.mortals.xhx.module.staff.service.StaffService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.util.*;
import java.util.stream.Collectors;
/**
* DeptService
* 部门信息 service实现
*
* @author zxfei
* @date 2023-03-06
*/
@Service("deptService")
@Slf4j
public class DeptServiceImpl extends AbstractCRUDServiceImpl<DeptDao, DeptEntity, Long> implements DeptService {
@Autowired
private StaffService staffService;
@Override
protected void saveBefore(DeptEntity entity, Context context) throws AppException {
if (ObjectUtils.isEmpty(entity.getParentId())) {
//如果父节点为空,默认挂载到根目录
entity.setParentId(0L);
}
DeptEntity parentDeptEntity = this.get(entity.getParentId());
if (!ObjectUtils.isEmpty(parentDeptEntity) && EnabledEnum.停用.getValue() == parentDeptEntity.getDeptStatus()) {
throw new AppException("部门信息停用,不允许新增");
}
if (!ObjectUtils.isEmpty(parentDeptEntity)) {
entity.setAncestors(parentDeptEntity.getAncestors() + "," + entity.getParentId());
}
super.saveBefore(entity, context);
}
@Override
protected void updateBefore(DeptEntity entity, Context context) throws AppException {
DeptEntity newParentEntity = this.get(entity.getParentId());
DeptEntity oldEntity = this.get(entity.getId());
if (!ObjectUtils.isEmpty(newParentEntity) && !ObjectUtils.isEmpty(oldEntity)) {
String newAncestors = newParentEntity.getAncestors() + "," + entity.getId();
String oldAncestors = oldEntity.getAncestors();
entity.setAncestors(newAncestors);
updateDeptChildren(entity.getId(), newAncestors, oldAncestors, context);
}
super.updateBefore(entity, context);
}
@Override
protected void updateAfter(DeptEntity entity, Context context) throws AppException {
if (EnabledEnum.启用.getValue() == entity.getDeptStatus()) {
updateParentDeptStatus(entity, context);
}
super.updateAfter(entity, context);
}
/**
* 修改该部门信息的父级部门信息状态
*
* @param dept 当前部门信息
*/
private void updateParentDeptStatus(DeptEntity dept, Context context) {
DeptEntity deptEntity = this.get(dept.getParentId());
if (!ObjectUtils.isEmpty(deptEntity)) {
deptEntity.setDeptStatus(EnabledEnum.启用.getValue());
deptEntity.setUpdateTime(new Date());
deptEntity.setUpdateUser(context == null ? "admin" : context.getUser().getLoginName());
DeptEntity condition = new DeptEntity();
condition.setId(deptEntity.getId());
this.updateBatch(deptEntity, condition, context);
}
}
/**
* 修改子元素关系
*
* @param deptId 被修改的部门信息ID
* @param newAncestors 新的父ID集合
* @param oldAncestors 旧的父ID集合
*/
public void updateDeptChildren(Long deptId, String newAncestors, String oldAncestors, Context context) {
List<DeptEntity> children = getDao().selectChildrenDeptById(deptId.toString());
for (DeptEntity child : children) {
child.setAncestors(child.getAncestors().replace(oldAncestors, newAncestors));
}
if (children.size() > 0) {
this.updateAfter(children, context);
}
}
@Override
protected void removeBefore(Long[] ids, Context context) throws AppException {
//有子节点 禁止删除
if (hasChildByDeptId(ids[0])) {
throw new AppException("存在下级部门信息,不允许删除");
}
super.removeBefore(ids, context);
}
@Override
public boolean hasChildByDeptId(Long deptId) {
List<DeptEntity> list = this.find(new DeptQuery().parentId(deptId));
return list.size() > 0 ? true : false;
}
@Override
public List<DeptEntity> selectDeptList(DeptEntity dept) {
return this.find(new DeptQuery());
}
@Override
public List<DeptTreeSelect> buildDeptTreeSelect(List<DeptEntity> list) {
for (Iterator<DeptEntity> iterator = list.iterator(); iterator.hasNext(); ) {
DeptEntity deptEntity = iterator.next();
StaffQuery staffQuery = new StaffQuery();
List<StaffEntity> staffEntities = staffService.find(staffQuery);
List<Map<String, Object>> personList = new ArrayList<>();
staffEntities.forEach(item -> {
Map<String, Object> map = new HashMap<>();
map.put("staffId", item.getId());
map.put("staffName", item.getName());
// map.put("deptId", item.getDeptId());
personList.add(map);
});
deptEntity.setPersonList(personList);
}
//获取父节点
List<DeptEntity> returnList = list.stream().filter(t -> t.getParentId() == 0).map(
m -> {
m.setChildren(getChildren(m, list));
StaffEntity query = new StaffQuery();
// query.setDeptIdList(getChildrenId(m, list));
int count = staffService.count(query,null);
m.setPersonNum(count);
return m;
}
).collect(Collectors.toList());
return returnList.stream().map(DeptTreeSelect::new).collect(Collectors.toList());
}
/**
* 递归查询子节点
* @param root 根节点
* @param all 所有节点
* @return 根节点信息
*/
private List<DeptEntity> getChildren(DeptEntity root, List<DeptEntity> all) {
List<DeptEntity> children = all.stream().filter(t -> {
return Objects.equals(t.getParentId(), root.getId());
}).map(
m -> {
m.setChildren(getChildren(m, all));
StaffQuery query = new StaffQuery();
// query.setDeptIdList(getChildrenId(m, all));
// query.setStatusNotList(Arrays.asList(StaffSatusEnum.离职.getValue()));
int count = staffService.count(query,null);
m.setPersonNum(count);
return m;
}
).collect(Collectors.toList());
return children;
}
private List<Long> getChildrenId(DeptEntity root, List<DeptEntity> all){
List<Long> idList = new ArrayList<>();
idList.add(root.getId());
all.forEach(item ->{
if(Objects.equals(item.getParentId(), root.getId())){
idList.addAll(getChildrenId(item,all));
}
});
return idList;
}
@Override
public List<DeptTreeSelect> getListByParentId(Long parentId, Context context) {
if (ObjectUtils.isEmpty(parentId)) {
parentId = 0L;
}
//只做一层
List<DeptTreeSelect> collect = this.find(new DeptQuery().parentId(parentId), context).stream().map(item -> new DeptTreeSelect(item)
).collect(Collectors.toList());
if ("0".equals(parentId)) {
return collect;
}
return collect;
}
@Override
public Rest<Void> updateDeptNum(Context context) {
log.info("更新部门用户数量");
return Rest.ok();
}
@Override
public List<DeptEntity> getAllChildrenDept(Long deptId) throws AppException {
return dao.getAllChildrenDept(deptId);
}
}
package com.mortals.xhx.module.dept.web;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.model.OrderCol;
import com.mortals.framework.util.StringUtils;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.dept.model.DeptEntity;
import com.mortals.xhx.module.dept.model.DeptQuery;
import com.mortals.xhx.module.dept.model.DeptTreeSelect;
import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.staff.service.StaffService;
import com.mortals.xhx.module.workman.model.WorkmanQuery;
import com.mortals.xhx.module.workman.service.WorkmanService;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import static com.mortals.framework.ap.SysConstains.RESULT_KEY;
/**
* 部门信息
*
* @author zxfei
* @date 2023-03-06
*/
@RestController
@RequestMapping("dept")
public class DeptController extends BaseCRUDJsonBodyMappingController<DeptService, DeptEntity, Long> {
@Autowired
private ParamService paramService;
@Autowired
private DeptService deptService;
@Autowired
private WorkmanService workmanService;
@Autowired
private StaffService staffService;
public DeptController() {
super.setModuleDesc("部门信息");
}
@Override
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "deptStatus", paramService.getParamBySecondOrganize("Dept", "deptStatus"));
this.addDict(model, "deptName", deptService.find(new DeptQuery()).stream().collect(Collectors.toMap(x->x.getId().toString(), y->y.getDeptName(),(o, n)->n)));
this.addDict(model, "workName", workmanService.find(new WorkmanQuery()).stream().collect(Collectors.toMap(x->x.getId().toString(), y->y.getName(),(o, n)->n)));
super.init(model, context);
}
@PostMapping("list/exclude")
public String excludeList(@RequestParam(name = "id") Long id) {
Map<String, Object> model = new HashMap<>();
JSONObject ret = new JSONObject();
String busiDesc = "查询" + this.getModuleDesc();
// Long id = form.getId()[0];
int code = VALUE_RESULT_SUCCESS;
try {
List<DeptEntity> collect = this.service.find(new DeptQuery()).stream().map(item -> {
if (item.getId().intValue() == id || ArrayUtils.contains(StringUtils.split(item.getAncestors(), ","), id + "")) {
return null;
}
return item;
}).filter(f -> f != null).collect(Collectors.toList());
model.put("result", collect);
recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) {
code = VALUE_RESULT_FAILURE;
this.doException(request, busiDesc, model, e);
}
ret.put(KEY_RESULT_DATA, model);
ret.put(KEY_RESULT_CODE, code);
return ret.toJSONString();
}
/**
* 获取站点下拉树列表
*/
@PostMapping("treeselect")
public String treeselect() {
Map<String, Object> model = new HashMap<>();
JSONObject ret = new JSONObject();
String busiDesc = "查询" + this.getModuleDesc();
int code = VALUE_RESULT_SUCCESS;
try {
DeptQuery deptQuery = new DeptQuery();
deptQuery.setOrderColList(Arrays.asList(new OrderCol("deptName")));
List<DeptEntity> list = this.service.find(deptQuery);
List<DeptTreeSelect> treeSelects = this.service.buildDeptTreeSelect(list);
model.put("result", treeSelects);
recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) {
code = VALUE_RESULT_FAILURE;
this.doException(request, busiDesc, model, e);
}
ret.put(KEY_RESULT_DATA, model);
ret.put(KEY_RESULT_CODE, code);
return ret.toJSONString();
}
/**
* 根据parentId查询子信息
*/
@GetMapping(value = "getListByParentId")
public String getListByParentId(Long parentId) {
JSONObject ret = new JSONObject();
Map<String, Object> model = new HashMap<>();
String busiDesc = "查询" + this.getModuleDesc() + "子节点";
try {
List<DeptTreeSelect> treeList = this.service.getListByParentId(parentId, getContext());
model.put(RESULT_KEY, treeList);
ret.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
ret.put(KEY_RESULT_DATA, model);
recordSysLog(request, busiDesc + "【成功】");
} catch (Exception e) {
log.error("根据parentId查询子信息错误", e);
this.doException(request, busiDesc, model, e);
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, e.getMessage());
}
return ret.toJSONString();
}
@Override
protected int doListAfter(DeptEntity query, Map<String, Object> model, Context context) throws AppException {
int allPerson =staffService.queryAllPerson();
model.put("allPerson",allPerson);
return super.doListAfter(query, model, context);
}
}
\ No newline at end of file
...@@ -11,11 +11,11 @@ import com.mortals.framework.model.BaseEntityLong; ...@@ -11,11 +11,11 @@ import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.news.model.vo.NewsVo; import com.mortals.xhx.module.news.model.vo.NewsVo;
import lombok.Data; import lombok.Data;
/** /**
* 新闻实体对象 * 新闻实体对象
* *
* @author zxfei * @author zxfei
* @date 2023-09-18 * @date 2023-09-28
*/ */
@Data @Data
public class NewsEntity extends NewsVo { public class NewsEntity extends NewsVo {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -52,6 +52,34 @@ public class NewsEntity extends NewsVo { ...@@ -52,6 +52,34 @@ public class NewsEntity extends NewsVo {
* 发布时间 * 发布时间
*/ */
private Date publishTime; private Date publishTime;
/**
* 责任编辑
*/
private String editor;
/**
* 分享次数
*/
private Integer shareNums;
/**
* 发布部门
*/
private Long deptId;
/**
* 所属部门名称
*/
private String deptName;
/**
* 声明
*/
private String statement;
/**
* 文章来源
*/
private String source;
/**
* 备注
*/
private String remark;
@Override @Override
public int hashCode() { public int hashCode() {
return this.getId().hashCode(); return this.getId().hashCode();
...@@ -69,13 +97,20 @@ public class NewsEntity extends NewsVo { ...@@ -69,13 +97,20 @@ public class NewsEntity extends NewsVo {
} }
public void initAttrValue(){ public void initAttrValue(){
this.categoryId = 0L; this.categoryId = null;
this.categoryName = ""; this.categoryName = "";
this.title = ""; this.title = "";
this.titleLogoPath = ""; this.titleLogoPath = "";
this.content = ""; this.content = "";
this.top = 0; this.top = 0;
this.viewNums = 0; this.viewNums = 0;
this.publishTime = new Date(); this.publishTime =null;
this.editor = "";
this.shareNums = 0;
this.deptId = null;
this.deptName = "";
this.statement = "";
this.source = "";
this.remark = "";
} }
} }
\ No newline at end of file
...@@ -4,11 +4,11 @@ import java.util.Date; ...@@ -4,11 +4,11 @@ import java.util.Date;
import java.util.List; import java.util.List;
import com.mortals.xhx.module.news.model.NewsEntity; import com.mortals.xhx.module.news.model.NewsEntity;
/** /**
* 新闻查询对象 * 新闻查询对象
* *
* @author zxfei * @author zxfei
* @date 2023-09-18 * @date 2023-09-28
*/ */
public class NewsQuery extends NewsEntity { public class NewsQuery extends NewsEntity {
/** 开始 主键ID,主键,自增长 */ /** 开始 主键ID,主键,自增长 */
private Long idStart; private Long idStart;
...@@ -138,6 +138,61 @@ public class NewsQuery extends NewsEntity { ...@@ -138,6 +138,61 @@ public class NewsQuery extends NewsEntity {
/** 结束 更新时间 */ /** 结束 更新时间 */
private String updateTimeEnd; private String updateTimeEnd;
/** 责任编辑 */
private List<String> editorList;
/** 责任编辑排除列表 */
private List <String> editorNotList;
/** 开始 分享次数 */
private Integer shareNumsStart;
/** 结束 分享次数 */
private Integer shareNumsEnd;
/** 增加 分享次数 */
private Integer shareNumsIncrement;
/** 分享次数列表 */
private List <Integer> shareNumsList;
/** 分享次数排除列表 */
private List <Integer> shareNumsNotList;
/** 开始 发布部门 */
private Long deptIdStart;
/** 结束 发布部门 */
private Long deptIdEnd;
/** 增加 发布部门 */
private Long deptIdIncrement;
/** 发布部门列表 */
private List <Long> deptIdList;
/** 发布部门排除列表 */
private List <Long> deptIdNotList;
/** 所属部门名称 */
private List<String> deptNameList;
/** 所属部门名称排除列表 */
private List <String> deptNameNotList;
/** 声明 */
private List<String> statementList;
/** 声明排除列表 */
private List <String> statementNotList;
/** 文章来源 */
private List<String> sourceList;
/** 文章来源排除列表 */
private List <String> sourceNotList;
/** 备注 */
private List<String> remarkList;
/** 备注排除列表 */
private List <String> remarkNotList;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */ /** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
private List<NewsQuery> orConditionList; private List<NewsQuery> orConditionList;
...@@ -856,6 +911,328 @@ public class NewsQuery extends NewsEntity { ...@@ -856,6 +911,328 @@ public class NewsQuery extends NewsEntity {
this.updateTimeEnd = updateTimeEnd; this.updateTimeEnd = updateTimeEnd;
} }
/**
* 获取 责任编辑
* @return editorList
*/
public List<String> getEditorList(){
return this.editorList;
}
/**
* 设置 责任编辑
* @param editorList
*/
public void setEditorList(List<String> editorList){
this.editorList = editorList;
}
/**
* 获取 责任编辑
* @return editorNotList
*/
public List<String> getEditorNotList(){
return this.editorNotList;
}
/**
* 设置 责任编辑
* @param editorNotList
*/
public void setEditorNotList(List<String> editorNotList){
this.editorNotList = editorNotList;
}
/**
* 获取 开始 分享次数
* @return shareNumsStart
*/
public Integer getShareNumsStart(){
return this.shareNumsStart;
}
/**
* 设置 开始 分享次数
* @param shareNumsStart
*/
public void setShareNumsStart(Integer shareNumsStart){
this.shareNumsStart = shareNumsStart;
}
/**
* 获取 结束 分享次数
* @return $shareNumsEnd
*/
public Integer getShareNumsEnd(){
return this.shareNumsEnd;
}
/**
* 设置 结束 分享次数
* @param shareNumsEnd
*/
public void setShareNumsEnd(Integer shareNumsEnd){
this.shareNumsEnd = shareNumsEnd;
}
/**
* 获取 增加 分享次数
* @return shareNumsIncrement
*/
public Integer getShareNumsIncrement(){
return this.shareNumsIncrement;
}
/**
* 设置 增加 分享次数
* @param shareNumsIncrement
*/
public void setShareNumsIncrement(Integer shareNumsIncrement){
this.shareNumsIncrement = shareNumsIncrement;
}
/**
* 获取 分享次数
* @return shareNumsList
*/
public List<Integer> getShareNumsList(){
return this.shareNumsList;
}
/**
* 设置 分享次数
* @param shareNumsList
*/
public void setShareNumsList(List<Integer> shareNumsList){
this.shareNumsList = shareNumsList;
}
/**
* 获取 分享次数
* @return shareNumsNotList
*/
public List<Integer> getShareNumsNotList(){
return this.shareNumsNotList;
}
/**
* 设置 分享次数
* @param shareNumsNotList
*/
public void setShareNumsNotList(List<Integer> shareNumsNotList){
this.shareNumsNotList = shareNumsNotList;
}
/**
* 获取 开始 发布部门
* @return deptIdStart
*/
public Long getDeptIdStart(){
return this.deptIdStart;
}
/**
* 设置 开始 发布部门
* @param deptIdStart
*/
public void setDeptIdStart(Long deptIdStart){
this.deptIdStart = deptIdStart;
}
/**
* 获取 结束 发布部门
* @return $deptIdEnd
*/
public Long getDeptIdEnd(){
return this.deptIdEnd;
}
/**
* 设置 结束 发布部门
* @param deptIdEnd
*/
public void setDeptIdEnd(Long deptIdEnd){
this.deptIdEnd = deptIdEnd;
}
/**
* 获取 增加 发布部门
* @return deptIdIncrement
*/
public Long getDeptIdIncrement(){
return this.deptIdIncrement;
}
/**
* 设置 增加 发布部门
* @param deptIdIncrement
*/
public void setDeptIdIncrement(Long deptIdIncrement){
this.deptIdIncrement = deptIdIncrement;
}
/**
* 获取 发布部门
* @return deptIdList
*/
public List<Long> getDeptIdList(){
return this.deptIdList;
}
/**
* 设置 发布部门
* @param deptIdList
*/
public void setDeptIdList(List<Long> deptIdList){
this.deptIdList = deptIdList;
}
/**
* 获取 发布部门
* @return deptIdNotList
*/
public List<Long> getDeptIdNotList(){
return this.deptIdNotList;
}
/**
* 设置 发布部门
* @param deptIdNotList
*/
public void setDeptIdNotList(List<Long> deptIdNotList){
this.deptIdNotList = deptIdNotList;
}
/**
* 获取 所属部门名称
* @return deptNameList
*/
public List<String> getDeptNameList(){
return this.deptNameList;
}
/**
* 设置 所属部门名称
* @param deptNameList
*/
public void setDeptNameList(List<String> deptNameList){
this.deptNameList = deptNameList;
}
/**
* 获取 所属部门名称
* @return deptNameNotList
*/
public List<String> getDeptNameNotList(){
return this.deptNameNotList;
}
/**
* 设置 所属部门名称
* @param deptNameNotList
*/
public void setDeptNameNotList(List<String> deptNameNotList){
this.deptNameNotList = deptNameNotList;
}
/**
* 获取 声明
* @return statementList
*/
public List<String> getStatementList(){
return this.statementList;
}
/**
* 设置 声明
* @param statementList
*/
public void setStatementList(List<String> statementList){
this.statementList = statementList;
}
/**
* 获取 声明
* @return statementNotList
*/
public List<String> getStatementNotList(){
return this.statementNotList;
}
/**
* 设置 声明
* @param statementNotList
*/
public void setStatementNotList(List<String> statementNotList){
this.statementNotList = statementNotList;
}
/**
* 获取 文章来源
* @return sourceList
*/
public List<String> getSourceList(){
return this.sourceList;
}
/**
* 设置 文章来源
* @param sourceList
*/
public void setSourceList(List<String> sourceList){
this.sourceList = sourceList;
}
/**
* 获取 文章来源
* @return sourceNotList
*/
public List<String> getSourceNotList(){
return this.sourceNotList;
}
/**
* 设置 文章来源
* @param sourceNotList
*/
public void setSourceNotList(List<String> sourceNotList){
this.sourceNotList = sourceNotList;
}
/**
* 获取 备注
* @return remarkList
*/
public List<String> getRemarkList(){
return this.remarkList;
}
/**
* 设置 备注
* @param remarkList
*/
public void setRemarkList(List<String> remarkList){
this.remarkList = remarkList;
}
/**
* 获取 备注
* @return remarkNotList
*/
public List<String> getRemarkNotList(){
return this.remarkNotList;
}
/**
* 设置 备注
* @param remarkNotList
*/
public void setRemarkNotList(List<String> remarkNotList){
this.remarkNotList = remarkNotList;
}
/** /**
* 设置 主键ID,主键,自增长 * 设置 主键ID,主键,自增长
* @param id * @param id
...@@ -1259,6 +1636,209 @@ public class NewsQuery extends NewsEntity { ...@@ -1259,6 +1636,209 @@ public class NewsQuery extends NewsEntity {
} }
/**
* 设置 责任编辑
* @param editor
*/
public NewsQuery editor(String editor){
setEditor(editor);
return this;
}
/**
* 设置 责任编辑
* @param editorList
*/
public NewsQuery editorList(List<String> editorList){
this.editorList = editorList;
return this;
}
/**
* 设置 分享次数
* @param shareNums
*/
public NewsQuery shareNums(Integer shareNums){
setShareNums(shareNums);
return this;
}
/**
* 设置 开始 分享次数
* @param shareNumsStart
*/
public NewsQuery shareNumsStart(Integer shareNumsStart){
this.shareNumsStart = shareNumsStart;
return this;
}
/**
* 设置 结束 分享次数
* @param shareNumsEnd
*/
public NewsQuery shareNumsEnd(Integer shareNumsEnd){
this.shareNumsEnd = shareNumsEnd;
return this;
}
/**
* 设置 增加 分享次数
* @param shareNumsIncrement
*/
public NewsQuery shareNumsIncrement(Integer shareNumsIncrement){
this.shareNumsIncrement = shareNumsIncrement;
return this;
}
/**
* 设置 分享次数
* @param shareNumsList
*/
public NewsQuery shareNumsList(List<Integer> shareNumsList){
this.shareNumsList = shareNumsList;
return this;
}
/**
* 设置 分享次数
* @param shareNumsNotList
*/
public NewsQuery shareNumsNotList(List<Integer> shareNumsNotList){
this.shareNumsNotList = shareNumsNotList;
return this;
}
/**
* 设置 发布部门
* @param deptId
*/
public NewsQuery deptId(Long deptId){
setDeptId(deptId);
return this;
}
/**
* 设置 开始 发布部门
* @param deptIdStart
*/
public NewsQuery deptIdStart(Long deptIdStart){
this.deptIdStart = deptIdStart;
return this;
}
/**
* 设置 结束 发布部门
* @param deptIdEnd
*/
public NewsQuery deptIdEnd(Long deptIdEnd){
this.deptIdEnd = deptIdEnd;
return this;
}
/**
* 设置 增加 发布部门
* @param deptIdIncrement
*/
public NewsQuery deptIdIncrement(Long deptIdIncrement){
this.deptIdIncrement = deptIdIncrement;
return this;
}
/**
* 设置 发布部门
* @param deptIdList
*/
public NewsQuery deptIdList(List<Long> deptIdList){
this.deptIdList = deptIdList;
return this;
}
/**
* 设置 发布部门
* @param deptIdNotList
*/
public NewsQuery deptIdNotList(List<Long> deptIdNotList){
this.deptIdNotList = deptIdNotList;
return this;
}
/**
* 设置 所属部门名称
* @param deptName
*/
public NewsQuery deptName(String deptName){
setDeptName(deptName);
return this;
}
/**
* 设置 所属部门名称
* @param deptNameList
*/
public NewsQuery deptNameList(List<String> deptNameList){
this.deptNameList = deptNameList;
return this;
}
/**
* 设置 声明
* @param statement
*/
public NewsQuery statement(String statement){
setStatement(statement);
return this;
}
/**
* 设置 声明
* @param statementList
*/
public NewsQuery statementList(List<String> statementList){
this.statementList = statementList;
return this;
}
/**
* 设置 文章来源
* @param source
*/
public NewsQuery source(String source){
setSource(source);
return this;
}
/**
* 设置 文章来源
* @param sourceList
*/
public NewsQuery sourceList(List<String> sourceList){
this.sourceList = sourceList;
return this;
}
/**
* 设置 备注
* @param remark
*/
public NewsQuery remark(String remark){
setRemark(remark);
return this;
}
/**
* 设置 备注
* @param remarkList
*/
public NewsQuery remarkList(List<String> remarkList){
this.remarkList = remarkList;
return this;
}
/** /**
* 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) * 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @return orConditionList * @return orConditionList
......
...@@ -19,5 +19,10 @@ public class NewsVo extends BaseEntityLong { ...@@ -19,5 +19,10 @@ public class NewsVo extends BaseEntityLong {
/** 主键ID,主键,自增长列表 */ /** 主键ID,主键,自增长列表 */
private List <Long> idList; private List <Long> idList;
/**
* 分享次数
*/
private Integer shareNums;
} }
\ No newline at end of file
package com.mortals.xhx.module.news.web; package com.mortals.xhx.module.news.web;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService; import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.dept.model.DeptEntity;
import com.mortals.xhx.module.dept.model.DeptQuery;
import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.news.model.NewsCategoryEntity;
import com.mortals.xhx.module.news.model.NewsCategoryQuery;
import com.mortals.xhx.module.news.service.NewsCategoryService;
import org.apache.commons.lang3.ObjectUtils;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.module.news.model.NewsEntity; import com.mortals.xhx.module.news.model.NewsEntity;
import com.mortals.xhx.module.news.service.NewsService; import com.mortals.xhx.module.news.service.NewsService;
import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils; import com.mortals.framework.util.StringUtils;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import java.util.Arrays; import java.util.Arrays;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*; import static com.mortals.framework.ap.SysConstains.*;
/** /**
* * 新闻
* 新闻 *
* * @author zxfei
* @author zxfei * @date 2023-09-18
* @date 2023-09-18 */
*/
@RestController @RestController
@RequestMapping("news") @RequestMapping("news")
public class NewsController extends BaseCRUDJsonBodyMappingController<NewsService,NewsEntity,Long> { public class NewsController extends BaseCRUDJsonBodyMappingController<NewsService, NewsEntity, Long> {
@Autowired @Autowired
private ParamService paramService; private ParamService paramService;
@Autowired
private NewsCategoryService newsCategoryService;
@Autowired
private DeptService deptService;
public NewsController(){ public NewsController() {
super.setModuleDesc( "新闻"); super.setModuleDesc("新闻");
} }
@Override @Override
protected void init(Map<String, Object> model, Context context) { protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "top", paramService.getParamBySecondOrganize("News","top")); this.addDict(model, "top", paramService.getParamBySecondOrganize("News", "top"));
this.addDict(model, "viewNums", paramService.getParamBySecondOrganize("News","viewNums")); this.addDict(model, "viewNums", paramService.getParamBySecondOrganize("News", "viewNums"));
this.addDict(model, "categoryId", newsCategoryService.find(new NewsCategoryQuery()).stream().collect(Collectors.toMap(x -> x.getId().toString(), y -> y.getName(), (o, n) -> n)));
this.addDict(model, "deptId", deptService.find(new DeptQuery()).stream().collect(Collectors.toMap(x -> x.getId().toString(), y -> y.getDeptName(), (o, n) -> n)));
super.init(model, context); super.init(model, context);
} }
@Override
protected void saveBefore(NewsEntity entity, Map<String, Object> model, Context context) throws AppException {
if (!ObjectUtils.isEmpty(entity.getCategoryId())) {
NewsCategoryEntity newsCategoryEntity = newsCategoryService.get(entity.getCategoryId(), context);
entity.setCategoryName(newsCategoryEntity.getName());
}
if (!ObjectUtils.isEmpty(entity.getDeptId())) {
DeptEntity deptEntity = deptService.get(entity.getDeptId(), context);
entity.setDeptName(deptEntity.getDeptName());
}
}
} }
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"mybatis-3-mapper.dtd">
<mapper namespace="com.mortals.xhx.module.dept.dao.ibatis.DeptDaoImpl">
<!-- 字段和属性映射 -->
<resultMap type="DeptEntity" id="DeptEntity-Map">
<id property="id" column="id" />
<result property="parentId" column="parentId" />
<result property="ancestors" column="ancestors" />
<result property="deptName" column="deptName" />
<result property="deptCode" column="deptCode" />
<result property="deptStatus" column="deptStatus" />
<result property="orderNum" column="orderNum" />
<result property="personNum" column="personNum" />
<result property="workId" column="workId" />
<result property="workName" column="workName" />
<result property="remark" column="remark" />
<result property="createUserId" column="createUserId" />
<result property="createTime" column="createTime" />
<result property="updateUserId" column="updateUserId" />
<result property="updateTime" column="updateTime" />
<result property="score" column="score" />
</resultMap>
<!-- 表所有列 -->
<sql id="_columns">
<trim suffixOverrides="," suffix="">
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('id') or colPickMode == 1 and data.containsKey('id')))">
a.id,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('parentId') or colPickMode == 1 and data.containsKey('parentId')))">
a.parentId,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('ancestors') or colPickMode == 1 and data.containsKey('ancestors')))">
a.ancestors,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deptName') or colPickMode == 1 and data.containsKey('deptName')))">
a.deptName,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deptCode') or colPickMode == 1 and data.containsKey('deptCode')))">
a.deptCode,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deptStatus') or colPickMode == 1 and data.containsKey('deptStatus')))">
a.deptStatus,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('orderNum') or colPickMode == 1 and data.containsKey('orderNum')))">
a.orderNum,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('personNum') or colPickMode == 1 and data.containsKey('personNum')))">
a.personNum,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('workId') or colPickMode == 1 and data.containsKey('workId')))">
a.workId,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('workName') or colPickMode == 1 and data.containsKey('workName')))">
a.workName,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('remark') or colPickMode == 1 and data.containsKey('remark')))">
a.remark,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('createUserId') or colPickMode == 1 and data.containsKey('createUserId')))">
a.createUserId,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('createTime') or colPickMode == 1 and data.containsKey('createTime')))">
a.createTime,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateUserId') or colPickMode == 1 and data.containsKey('updateUserId')))">
a.updateUserId,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateTime') or colPickMode == 1 and data.containsKey('updateTime')))">
a.updateTime,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('score') or colPickMode == 1 and data.containsKey('score')))">
a.score,
</if>
</trim>
</sql>
<!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="DeptEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_dept
(parentId,ancestors,deptName,deptCode,deptStatus,orderNum,personNum,workId,workName,remark,createUserId,createTime,updateUserId,updateTime,score)
VALUES
(#{parentId},#{ancestors},#{deptName},#{deptCode},#{deptStatus},#{orderNum},#{personNum},#{workId},#{workName},#{remark},#{createUserId},#{createTime},#{updateUserId},#{updateTime},#{score})
</insert>
<!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto">
insert into mortals_xhx_dept
(parentId,ancestors,deptName,deptCode,deptStatus,orderNum,personNum,workId,workName,remark,createUserId,createTime,updateUserId,updateTime,score)
VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.parentId},#{item.ancestors},#{item.deptName},#{item.deptCode},#{item.deptStatus},#{item.orderNum},#{item.personNum},#{item.workId},#{item.workName},#{item.remark},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime},#{item.score})
</foreach>
</insert>
<!-- 根据ParamDto更新 -->
<update id="update" parameterType="paramDto">
update mortals_xhx_dept as a
set
<trim suffixOverrides="," suffix="">
<if test="(colPickMode==0 and data.containsKey('parentId')) or (colPickMode==1 and !data.containsKey('parentId'))">
a.parentId=#{data.parentId},
</if>
<if test="(colPickMode==0 and data.containsKey('parentIdIncrement')) or (colPickMode==1 and !data.containsKey('parentIdIncrement'))">
a.parentId=ifnull(a.parentId,0) + #{data.parentIdIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('ancestors')) or (colPickMode==1 and !data.containsKey('ancestors'))">
a.ancestors=#{data.ancestors},
</if>
<if test="(colPickMode==0 and data.containsKey('deptName')) or (colPickMode==1 and !data.containsKey('deptName'))">
a.deptName=#{data.deptName},
</if>
<if test="(colPickMode==0 and data.containsKey('deptCode')) or (colPickMode==1 and !data.containsKey('deptCode'))">
a.deptCode=#{data.deptCode},
</if>
<if test="(colPickMode==0 and data.containsKey('deptStatus')) or (colPickMode==1 and !data.containsKey('deptStatus'))">
a.deptStatus=#{data.deptStatus},
</if>
<if test="(colPickMode==0 and data.containsKey('deptStatusIncrement')) or (colPickMode==1 and !data.containsKey('deptStatusIncrement'))">
a.deptStatus=ifnull(a.deptStatus,0) + #{data.deptStatusIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('orderNum')) or (colPickMode==1 and !data.containsKey('orderNum'))">
a.orderNum=#{data.orderNum},
</if>
<if test="(colPickMode==0 and data.containsKey('orderNumIncrement')) or (colPickMode==1 and !data.containsKey('orderNumIncrement'))">
a.orderNum=ifnull(a.orderNum,0) + #{data.orderNumIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('personNum')) or (colPickMode==1 and !data.containsKey('personNum'))">
a.personNum=#{data.personNum},
</if>
<if test="(colPickMode==0 and data.containsKey('personNumIncrement')) or (colPickMode==1 and !data.containsKey('personNumIncrement'))">
a.personNum=ifnull(a.personNum,0) + #{data.personNumIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('workId')) or (colPickMode==1 and !data.containsKey('workId'))">
a.workId=#{data.workId},
</if>
<if test="(colPickMode==0 and data.containsKey('workIdIncrement')) or (colPickMode==1 and !data.containsKey('workIdIncrement'))">
a.workId=ifnull(a.workId,0) + #{data.workIdIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('workName')) or (colPickMode==1 and !data.containsKey('workName'))">
a.workName=#{data.workName},
</if>
<if test="(colPickMode==0 and data.containsKey('remark')) or (colPickMode==1 and !data.containsKey('remark'))">
a.remark=#{data.remark},
</if>
<if test="(colPickMode==0 and data.containsKey('createUserId')) or (colPickMode==1 and !data.containsKey('createUserId'))">
a.createUserId=#{data.createUserId},
</if>
<if test="(colPickMode==0 and data.containsKey('createUserIdIncrement')) or (colPickMode==1 and !data.containsKey('createUserIdIncrement'))">
a.createUserId=ifnull(a.createUserId,0) + #{data.createUserIdIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('createTime')) or (colPickMode==1 and !data.containsKey('createTime'))">
a.createTime=#{data.createTime},
</if>
<if test="(colPickMode==0 and data.containsKey('updateUserId')) or (colPickMode==1 and !data.containsKey('updateUserId'))">
a.updateUserId=#{data.updateUserId},
</if>
<if test="(colPickMode==0 and data.containsKey('updateUserIdIncrement')) or (colPickMode==1 and !data.containsKey('updateUserIdIncrement'))">
a.updateUserId=ifnull(a.updateUserId,0) + #{data.updateUserIdIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('updateTime')) or (colPickMode==1 and !data.containsKey('updateTime'))">
a.updateTime=#{data.updateTime},
</if>
<if test="(colPickMode==0 and data.containsKey('score')) or (colPickMode==1 and !data.containsKey('score'))">
a.score=#{data.score},
</if>
<if test="(colPickMode==0 and data.containsKey('scoreIncrement')) or (colPickMode==1 and !data.containsKey('scoreIncrement'))">
a.score=ifnull(a.score,0) + #{data.scoreIncrement},
</if>
</trim>
<trim suffixOverrides="where" suffix="">
where
<trim prefixOverrides="and" prefix="">
<include refid="_condition_"/>
</trim>
</trim>
</update>
<!-- 批量更新 -->
<update id="updateBatch" parameterType="paramDto">
update mortals_xhx_dept as a
<trim prefix="set" suffixOverrides=",">
<trim prefix="parentId=(case" suffix="ELSE parentId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('parentId')) or (colPickMode==1 and !item.containsKey('parentId'))">
when a.id=#{item.id} then #{item.parentId}
</when>
<when test="(colPickMode==0 and item.containsKey('parentIdIncrement')) or (colPickMode==1 and !item.containsKey('parentIdIncrement'))">
when a.id=#{item.id} then ifnull(a.parentId,0) + #{item.parentIdIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="ancestors=(case" suffix="ELSE ancestors end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('ancestors')) or (colPickMode==1 and !item.containsKey('ancestors'))">
when a.id=#{item.id} then #{item.ancestors}
</if>
</foreach>
</trim>
<trim prefix="deptName=(case" suffix="ELSE deptName end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('deptName')) or (colPickMode==1 and !item.containsKey('deptName'))">
when a.id=#{item.id} then #{item.deptName}
</if>
</foreach>
</trim>
<trim prefix="deptCode=(case" suffix="ELSE deptCode end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('deptCode')) or (colPickMode==1 and !item.containsKey('deptCode'))">
when a.id=#{item.id} then #{item.deptCode}
</if>
</foreach>
</trim>
<trim prefix="deptStatus=(case" suffix="ELSE deptStatus end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('deptStatus')) or (colPickMode==1 and !item.containsKey('deptStatus'))">
when a.id=#{item.id} then #{item.deptStatus}
</when>
<when test="(colPickMode==0 and item.containsKey('deptStatusIncrement')) or (colPickMode==1 and !item.containsKey('deptStatusIncrement'))">
when a.id=#{item.id} then ifnull(a.deptStatus,0) + #{item.deptStatusIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="orderNum=(case" suffix="ELSE orderNum end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('orderNum')) or (colPickMode==1 and !item.containsKey('orderNum'))">
when a.id=#{item.id} then #{item.orderNum}
</when>
<when test="(colPickMode==0 and item.containsKey('orderNumIncrement')) or (colPickMode==1 and !item.containsKey('orderNumIncrement'))">
when a.id=#{item.id} then ifnull(a.orderNum,0) + #{item.orderNumIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="personNum=(case" suffix="ELSE personNum end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('personNum')) or (colPickMode==1 and !item.containsKey('personNum'))">
when a.id=#{item.id} then #{item.personNum}
</when>
<when test="(colPickMode==0 and item.containsKey('personNumIncrement')) or (colPickMode==1 and !item.containsKey('personNumIncrement'))">
when a.id=#{item.id} then ifnull(a.personNum,0) + #{item.personNumIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="workId=(case" suffix="ELSE workId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('workId')) or (colPickMode==1 and !item.containsKey('workId'))">
when a.id=#{item.id} then #{item.workId}
</when>
<when test="(colPickMode==0 and item.containsKey('workIdIncrement')) or (colPickMode==1 and !item.containsKey('workIdIncrement'))">
when a.id=#{item.id} then ifnull(a.workId,0) + #{item.workIdIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="workName=(case" suffix="ELSE workName end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('workName')) or (colPickMode==1 and !item.containsKey('workName'))">
when a.id=#{item.id} then #{item.workName}
</if>
</foreach>
</trim>
<trim prefix="remark=(case" suffix="ELSE remark end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('remark')) or (colPickMode==1 and !item.containsKey('remark'))">
when a.id=#{item.id} then #{item.remark}
</if>
</foreach>
</trim>
<trim prefix="createUserId=(case" suffix="ELSE createUserId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('createUserId')) or (colPickMode==1 and !item.containsKey('createUserId'))">
when a.id=#{item.id} then #{item.createUserId}
</when>
<when test="(colPickMode==0 and item.containsKey('createUserIdIncrement')) or (colPickMode==1 and !item.containsKey('createUserIdIncrement'))">
when a.id=#{item.id} then ifnull(a.createUserId,0) + #{item.createUserIdIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="createTime=(case" suffix="ELSE createTime end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('createTime')) or (colPickMode==1 and !item.containsKey('createTime'))">
when a.id=#{item.id} then #{item.createTime}
</if>
</foreach>
</trim>
<trim prefix="updateUserId=(case" suffix="ELSE updateUserId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('updateUserId')) or (colPickMode==1 and !item.containsKey('updateUserId'))">
when a.id=#{item.id} then #{item.updateUserId}
</when>
<when test="(colPickMode==0 and item.containsKey('updateUserIdIncrement')) or (colPickMode==1 and !item.containsKey('updateUserIdIncrement'))">
when a.id=#{item.id} then ifnull(a.updateUserId,0) + #{item.updateUserIdIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="updateTime=(case" suffix="ELSE updateTime end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('updateTime')) or (colPickMode==1 and !item.containsKey('updateTime'))">
when a.id=#{item.id} then #{item.updateTime}
</if>
</foreach>
</trim>
<trim prefix="score=(case" suffix="ELSE score end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('score')) or (colPickMode==1 and !item.containsKey('score'))">
when a.id=#{item.id} then #{item.score}
</when>
<when test="(colPickMode==0 and item.containsKey('scoreIncrement')) or (colPickMode==1 and !item.containsKey('scoreIncrement'))">
when a.id=#{item.id} then ifnull(a.score,0) + #{item.scoreIncrement}
</when>
</choose>
</foreach>
</trim>
</trim>
where id in
<foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")">
#{item.id}
</foreach>
</update>
<!-- 根据主健查询 -->
<select id="getByKey" parameterType="paramDto" resultMap="DeptEntity-Map">
select <include refid="_columns"/>
from mortals_xhx_dept as a
where a.id=#{condition.id}
</select>
<!-- 根据主健删除 -->
<delete id="deleteByKey" parameterType="paramDto">
delete a.* from mortals_xhx_dept as a where a.id=#{condition.id}
</delete>
<!-- 根据主健删除一批,针对单一主健有效 -->
<delete id="deleteByKeys">
delete from mortals_xhx_dept where id in
<foreach collection="array" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<!-- 根据主健列表删除一批,针对单一主健有效 -->
<delete id="deleteByKeyList">
delete from mortals_xhx_dept where id in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<!-- 根据对象列表删除一批,针对单一主健有效 -->
<delete id="deleteByEntityList">
delete from mortals_xhx_dept where id in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
#{item.id}
</foreach>
</delete>
<!-- 根据paramDto删除一批 -->
<delete id="deleteByMap" parameterType="paramDto">
delete a.* from mortals_xhx_dept as a
<trim suffixOverrides="where" suffix="">
where
<trim prefixOverrides="and" prefix="">
<include refid="_condition_"/>
</trim>
</trim>
</delete>
<!-- 获取列表 -->
<select id="getList" parameterType="paramDto" resultMap="DeptEntity-Map">
select <include refid="_columns"/>
from mortals_xhx_dept as a
<trim suffixOverrides="where" suffix="">
where
<trim prefixOverrides="and" prefix="">
<include refid="_condition_"/>
</trim>
</trim>
<include refid="_orderCols_"/>
</select>
<!-- 获取子节点 -->
<select id="selectChildrenDeptById" parameterType="String" resultMap="DeptEntity-Map">
select * from mortals_xhx_dept as a where find_in_set(#{deptId}, ancestors)
</select>
<!-- 获取 -->
<select id="getListCount" parameterType="paramDto" resultType="int">
select count(1)
from mortals_xhx_dept as a
<trim suffixOverrides="where" suffix="">
where
<trim prefixOverrides="and" prefix="">
<include refid="_condition_"/>
</trim>
</trim>
</select>
<!-- 条件映射 -->
<sql id="_condition_">
<if test="condition != null and !condition.isEmpty()">
<!-- 条件映射-普通条件 -->
<include refid="_condition_param_">
<property name="_conditionParam_" value="condition"/>
<property name="_conditionType_" value="and"/>
</include>
<!-- 条件映射-集合之间使用AND,集合中元素使用OR-(list[0].1 or list[0].2) and (list[1].3 or list[1].4) -->
<if test="condition.containsKey('andConditionList') and !condition.andConditionList.isEmpty()">
and
<foreach collection="condition.andConditionList" open="(" close=")" index="index" item="andCondition" separator=" and ">
<trim prefixOverrides="or" prefix="(" suffix=")">
<include refid="_condition_param_">
<property name="_conditionParam_" value="andCondition"/>
<property name="_conditionType_" value="or"/>
</include>
</trim>
</foreach>
</if>
<!-- 条件映射-集合之间使用OR,集合中元素使用AND-(list[0].1 and list[0].2) or (list[1].3 and list[1].4) -->
<if test="condition.containsKey('orConditionList') and !condition.orConditionList.isEmpty()">
and
<foreach collection="condition.orConditionList" open="(" close=")" index="index" item="orCondition" separator=" or ">
<trim prefixOverrides="and" prefix="(" suffix=")">
<include refid="_condition_param_">
<property name="_conditionParam_" value="orCondition"/>
<property name="_conditionType_" value="and"/>
</include>
</trim>
</foreach>
</if>
</if>
</sql>
<!-- 条件映射-代参数 -->
<sql id="_condition_param_">
<bind name="conditionParamRef" value="${_conditionParam_}"/>
<if test="conditionParamRef.containsKey('id')">
<if test="conditionParamRef.id != null">
${_conditionType_} a.id=#{${_conditionParam_}.id}
</if>
</if>
<if test="conditionParamRef.containsKey('id')">
<if test="conditionParamRef.id != null ">
${_conditionType_} a.id = #{${_conditionParam_}.id}
</if>
<if test="conditionParamRef.id == null">
${_conditionType_} a.id is null
</if>
</if>
<if test="conditionParamRef.containsKey('idList') and conditionParamRef.idList.size() > 0">
${_conditionType_} a.id in
<foreach collection="conditionParamRef.idList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('idNotList') and conditionParamRef.idNotList.size() > 0">
${_conditionType_} a.id not in
<foreach collection="conditionParamRef.idNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('idStart') and conditionParamRef.idStart != null">
${_conditionType_} a.id <![CDATA[ >= ]]> #{${_conditionParam_}.idStart}
</if>
<if test="conditionParamRef.containsKey('idEnd') and conditionParamRef.idEnd != null">
${_conditionType_} a.id <![CDATA[ <= ]]> #{${_conditionParam_}.idEnd}
</if>
<if test="conditionParamRef.containsKey('parentId')">
<if test="conditionParamRef.parentId != null ">
${_conditionType_} a.parentId = #{${_conditionParam_}.parentId}
</if>
<if test="conditionParamRef.parentId == null">
${_conditionType_} a.parentId is null
</if>
</if>
<if test="conditionParamRef.containsKey('parentIdList') and conditionParamRef.parentIdList.size() > 0">
${_conditionType_} a.parentId in
<foreach collection="conditionParamRef.parentIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('parentIdNotList') and conditionParamRef.parentIdNotList.size() > 0">
${_conditionType_} a.parentId not in
<foreach collection="conditionParamRef.parentIdNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('parentIdStart') and conditionParamRef.parentIdStart != null">
${_conditionType_} a.parentId <![CDATA[ >= ]]> #{${_conditionParam_}.parentIdStart}
</if>
<if test="conditionParamRef.containsKey('parentIdEnd') and conditionParamRef.parentIdEnd != null">
${_conditionType_} a.parentId <![CDATA[ <= ]]> #{${_conditionParam_}.parentIdEnd}
</if>
<if test="conditionParamRef.containsKey('ancestors')">
<if test="conditionParamRef.ancestors != null and conditionParamRef.ancestors != ''">
${_conditionType_} a.ancestors like #{${_conditionParam_}.ancestors}
</if>
<if test="conditionParamRef.ancestors == null">
${_conditionType_} a.ancestors is null
</if>
</if>
<if test="conditionParamRef.containsKey('ancestorsList') and conditionParamRef.ancestorsList.size() > 0">
${_conditionType_} a.ancestors in
<foreach collection="conditionParamRef.ancestorsList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('ancestorsNotList') and conditionParamRef.ancestorsNotList.size() > 0">
${_conditionType_} a.ancestors not in
<foreach collection="conditionParamRef.ancestorsNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deptName')">
<if test="conditionParamRef.deptName != null and conditionParamRef.deptName != ''">
${_conditionType_} a.deptName like #{${_conditionParam_}.deptName}
</if>
<if test="conditionParamRef.deptName == null">
${_conditionType_} a.deptName is null
</if>
</if>
<if test="conditionParamRef.containsKey('deptNameList') and conditionParamRef.deptNameList.size() > 0">
${_conditionType_} a.deptName in
<foreach collection="conditionParamRef.deptNameList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deptNameNotList') and conditionParamRef.deptNameNotList.size() > 0">
${_conditionType_} a.deptName not in
<foreach collection="conditionParamRef.deptNameNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deptCode')">
<if test="conditionParamRef.deptCode != null and conditionParamRef.deptCode != ''">
${_conditionType_} a.deptCode like #{${_conditionParam_}.deptCode}
</if>
<if test="conditionParamRef.deptCode == null">
${_conditionType_} a.deptCode is null
</if>
</if>
<if test="conditionParamRef.containsKey('deptCodeList') and conditionParamRef.deptCodeList.size() > 0">
${_conditionType_} a.deptCode in
<foreach collection="conditionParamRef.deptCodeList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deptCodeNotList') and conditionParamRef.deptCodeNotList.size() > 0">
${_conditionType_} a.deptCode not in
<foreach collection="conditionParamRef.deptCodeNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deptStatus')">
<if test="conditionParamRef.deptStatus != null ">
${_conditionType_} a.deptStatus = #{${_conditionParam_}.deptStatus}
</if>
<if test="conditionParamRef.deptStatus == null">
${_conditionType_} a.deptStatus is null
</if>
</if>
<if test="conditionParamRef.containsKey('deptStatusList') and conditionParamRef.deptStatusList.size() > 0">
${_conditionType_} a.deptStatus in
<foreach collection="conditionParamRef.deptStatusList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deptStatusNotList') and conditionParamRef.deptStatusNotList.size() > 0">
${_conditionType_} a.deptStatus not in
<foreach collection="conditionParamRef.deptStatusNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deptStatusStart') and conditionParamRef.deptStatusStart != null">
${_conditionType_} a.deptStatus <![CDATA[ >= ]]> #{${_conditionParam_}.deptStatusStart}
</if>
<if test="conditionParamRef.containsKey('deptStatusEnd') and conditionParamRef.deptStatusEnd != null">
${_conditionType_} a.deptStatus <![CDATA[ <= ]]> #{${_conditionParam_}.deptStatusEnd}
</if>
<if test="conditionParamRef.containsKey('orderNum')">
<if test="conditionParamRef.orderNum != null ">
${_conditionType_} a.orderNum = #{${_conditionParam_}.orderNum}
</if>
<if test="conditionParamRef.orderNum == null">
${_conditionType_} a.orderNum is null
</if>
</if>
<if test="conditionParamRef.containsKey('orderNumList') and conditionParamRef.orderNumList.size() > 0">
${_conditionType_} a.orderNum in
<foreach collection="conditionParamRef.orderNumList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('orderNumNotList') and conditionParamRef.orderNumNotList.size() > 0">
${_conditionType_} a.orderNum not in
<foreach collection="conditionParamRef.orderNumNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('orderNumStart') and conditionParamRef.orderNumStart != null">
${_conditionType_} a.orderNum <![CDATA[ >= ]]> #{${_conditionParam_}.orderNumStart}
</if>
<if test="conditionParamRef.containsKey('orderNumEnd') and conditionParamRef.orderNumEnd != null">
${_conditionType_} a.orderNum <![CDATA[ <= ]]> #{${_conditionParam_}.orderNumEnd}
</if>
<if test="conditionParamRef.containsKey('personNum')">
<if test="conditionParamRef.personNum != null ">
${_conditionType_} a.personNum = #{${_conditionParam_}.personNum}
</if>
<if test="conditionParamRef.personNum == null">
${_conditionType_} a.personNum is null
</if>
</if>
<if test="conditionParamRef.containsKey('personNumList') and conditionParamRef.personNumList.size() > 0">
${_conditionType_} a.personNum in
<foreach collection="conditionParamRef.personNumList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('personNumNotList') and conditionParamRef.personNumNotList.size() > 0">
${_conditionType_} a.personNum not in
<foreach collection="conditionParamRef.personNumNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('personNumStart') and conditionParamRef.personNumStart != null">
${_conditionType_} a.personNum <![CDATA[ >= ]]> #{${_conditionParam_}.personNumStart}
</if>
<if test="conditionParamRef.containsKey('personNumEnd') and conditionParamRef.personNumEnd != null">
${_conditionType_} a.personNum <![CDATA[ <= ]]> #{${_conditionParam_}.personNumEnd}
</if>
<if test="conditionParamRef.containsKey('workId')">
<if test="conditionParamRef.workId != null ">
${_conditionType_} a.workId = #{${_conditionParam_}.workId}
</if>
<if test="conditionParamRef.workId == null">
${_conditionType_} a.workId is null
</if>
</if>
<if test="conditionParamRef.containsKey('workIdList') and conditionParamRef.workIdList.size() > 0">
${_conditionType_} a.workId in
<foreach collection="conditionParamRef.workIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('workIdNotList') and conditionParamRef.workIdNotList.size() > 0">
${_conditionType_} a.workId not in
<foreach collection="conditionParamRef.workIdNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('workIdStart') and conditionParamRef.workIdStart != null">
${_conditionType_} a.workId <![CDATA[ >= ]]> #{${_conditionParam_}.workIdStart}
</if>
<if test="conditionParamRef.containsKey('workIdEnd') and conditionParamRef.workIdEnd != null">
${_conditionType_} a.workId <![CDATA[ <= ]]> #{${_conditionParam_}.workIdEnd}
</if>
<if test="conditionParamRef.containsKey('workName')">
<if test="conditionParamRef.workName != null and conditionParamRef.workName != ''">
${_conditionType_} a.workName like #{${_conditionParam_}.workName}
</if>
<if test="conditionParamRef.workName == null">
${_conditionType_} a.workName is null
</if>
</if>
<if test="conditionParamRef.containsKey('workNameList') and conditionParamRef.workNameList.size() > 0">
${_conditionType_} a.workName in
<foreach collection="conditionParamRef.workNameList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('workNameNotList') and conditionParamRef.workNameNotList.size() > 0">
${_conditionType_} a.workName not in
<foreach collection="conditionParamRef.workNameNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('remark')">
<if test="conditionParamRef.remark != null and conditionParamRef.remark != ''">
${_conditionType_} a.remark like #{${_conditionParam_}.remark}
</if>
<if test="conditionParamRef.remark == null">
${_conditionType_} a.remark is null
</if>
</if>
<if test="conditionParamRef.containsKey('remarkList') and conditionParamRef.remarkList.size() > 0">
${_conditionType_} a.remark in
<foreach collection="conditionParamRef.remarkList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('remarkNotList') and conditionParamRef.remarkNotList.size() > 0">
${_conditionType_} a.remark not in
<foreach collection="conditionParamRef.remarkNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('createUserId')">
<if test="conditionParamRef.createUserId != null ">
${_conditionType_} a.createUserId = #{${_conditionParam_}.createUserId}
</if>
<if test="conditionParamRef.createUserId == null">
${_conditionType_} a.createUserId is null
</if>
</if>
<if test="conditionParamRef.containsKey('createUserIdList') and conditionParamRef.createUserIdList.size() > 0">
${_conditionType_} a.createUserId in
<foreach collection="conditionParamRef.createUserIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('createUserIdNotList') and conditionParamRef.createUserIdNotList.size() > 0">
${_conditionType_} a.createUserId not in
<foreach collection="conditionParamRef.createUserIdNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('createUserIdStart') and conditionParamRef.createUserIdStart != null">
${_conditionType_} a.createUserId <![CDATA[ >= ]]> #{${_conditionParam_}.createUserIdStart}
</if>
<if test="conditionParamRef.containsKey('createUserIdEnd') and conditionParamRef.createUserIdEnd != null">
${_conditionType_} a.createUserId <![CDATA[ <= ]]> #{${_conditionParam_}.createUserIdEnd}
</if>
<if test="conditionParamRef.containsKey('createTime')">
<if test="conditionParamRef.createTime != null ">
${_conditionType_} a.createTime = #{${_conditionParam_}.createTime}
</if>
<if test="conditionParamRef.createTime == null">
${_conditionType_} a.createTime is null
</if>
</if>
<if test="conditionParamRef.containsKey('createTimeStart') and conditionParamRef.createTimeStart != null and conditionParamRef.createTimeStart!=''">
${_conditionType_} a.createTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.createTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
</if>
<if test="conditionParamRef.containsKey('createTimeEnd') and conditionParamRef.createTimeEnd != null and conditionParamRef.createTimeEnd!=''">
${_conditionType_} a.createTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.createTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
</if>
<if test="conditionParamRef.containsKey('updateUserId')">
<if test="conditionParamRef.updateUserId != null ">
${_conditionType_} a.updateUserId = #{${_conditionParam_}.updateUserId}
</if>
<if test="conditionParamRef.updateUserId == null">
${_conditionType_} a.updateUserId is null
</if>
</if>
<if test="conditionParamRef.containsKey('updateUserIdList') and conditionParamRef.updateUserIdList.size() > 0">
${_conditionType_} a.updateUserId in
<foreach collection="conditionParamRef.updateUserIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('updateUserIdNotList') and conditionParamRef.updateUserIdNotList.size() > 0">
${_conditionType_} a.updateUserId not in
<foreach collection="conditionParamRef.updateUserIdNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('updateUserIdStart') and conditionParamRef.updateUserIdStart != null">
${_conditionType_} a.updateUserId <![CDATA[ >= ]]> #{${_conditionParam_}.updateUserIdStart}
</if>
<if test="conditionParamRef.containsKey('updateUserIdEnd') and conditionParamRef.updateUserIdEnd != null">
${_conditionType_} a.updateUserId <![CDATA[ <= ]]> #{${_conditionParam_}.updateUserIdEnd}
</if>
<if test="conditionParamRef.containsKey('updateTime')">
<if test="conditionParamRef.updateTime != null ">
${_conditionType_} a.updateTime = #{${_conditionParam_}.updateTime}
</if>
<if test="conditionParamRef.updateTime == null">
${_conditionType_} a.updateTime is null
</if>
</if>
<if test="conditionParamRef.containsKey('updateTimeStart') and conditionParamRef.updateTimeStart != null and conditionParamRef.updateTimeStart!=''">
${_conditionType_} a.updateTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.updateTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
</if>
<if test="conditionParamRef.containsKey('updateTimeEnd') and conditionParamRef.updateTimeEnd != null and conditionParamRef.updateTimeEnd!=''">
${_conditionType_} a.updateTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.updateTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
</if>
<if test="conditionParamRef.containsKey('score')">
<if test="conditionParamRef.score != null ">
${_conditionType_} a.score = #{${_conditionParam_}.score}
</if>
<if test="conditionParamRef.score == null">
${_conditionType_} a.score is null
</if>
</if>
<if test="conditionParamRef.containsKey('scoreList') and conditionParamRef.scoreList.size() > 0">
${_conditionType_} a.score in
<foreach collection="conditionParamRef.scoreList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('scoreNotList') and conditionParamRef.scoreNotList.size() > 0">
${_conditionType_} a.score not in
<foreach collection="conditionParamRef.scoreNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('scoreStart') and conditionParamRef.scoreStart != null">
${_conditionType_} a.score <![CDATA[ >= ]]> #{${_conditionParam_}.scoreStart}
</if>
<if test="conditionParamRef.containsKey('scoreEnd') and conditionParamRef.scoreEnd != null">
${_conditionType_} a.score <![CDATA[ <= ]]> #{${_conditionParam_}.scoreEnd}
</if>
</sql>
<sql id="_orderCols_">
<if test="orderColList != null and !orderColList.isEmpty()">
order by
<trim suffixOverrides="," suffix="">
<foreach collection="orderColList" open="" close="" index="index" item="item" separator=",">
${item.colName} ${item.sortKind}
</foreach>
</trim>
</if>
<if test="(orderColList == null or orderColList.isEmpty()) and orderCol != null and !orderCol.isEmpty()">
order by
<trim suffixOverrides="," suffix="">
<if test="orderCol.containsKey('id')">
a.id
<if test='orderCol.id != null and "DESC".equalsIgnoreCase(orderCol.id)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('parentId')">
a.parentId
<if test='orderCol.parentId != null and "DESC".equalsIgnoreCase(orderCol.parentId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('ancestors')">
a.ancestors
<if test='orderCol.ancestors != null and "DESC".equalsIgnoreCase(orderCol.ancestors)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('deptName')">
a.deptName
<if test='orderCol.deptName != null and "DESC".equalsIgnoreCase(orderCol.deptName)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('deptCode')">
a.deptCode
<if test='orderCol.deptCode != null and "DESC".equalsIgnoreCase(orderCol.deptCode)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('deptStatus')">
a.deptStatus
<if test='orderCol.deptStatus != null and "DESC".equalsIgnoreCase(orderCol.deptStatus)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('orderNum')">
a.orderNum
<if test='orderCol.orderNum != null and "DESC".equalsIgnoreCase(orderCol.orderNum)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('personNum')">
a.personNum
<if test='orderCol.personNum != null and "DESC".equalsIgnoreCase(orderCol.personNum)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('workId')">
a.workId
<if test='orderCol.workId != null and "DESC".equalsIgnoreCase(orderCol.workId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('workName')">
a.workName
<if test='orderCol.workName != null and "DESC".equalsIgnoreCase(orderCol.workName)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('remark')">
a.remark
<if test='orderCol.remark != null and "DESC".equalsIgnoreCase(orderCol.remark)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('createUserId')">
a.createUserId
<if test='orderCol.createUserId != null and "DESC".equalsIgnoreCase(orderCol.createUserId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('createTime')">
a.createTime
<if test='orderCol.createTime != null and "DESC".equalsIgnoreCase(orderCol.createTime)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('updateUserId')">
a.updateUserId
<if test='orderCol.updateUserId != null and "DESC".equalsIgnoreCase(orderCol.updateUserId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('updateTime')">
a.updateTime
<if test='orderCol.updateTime != null and "DESC".equalsIgnoreCase(orderCol.updateTime)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('score')">
a.score
<if test='orderCol.score != null and "DESC".equalsIgnoreCase(orderCol.score)'>DESC</if>
,
</if>
</trim>
</if>
</sql>
<sql id="_group_by_">
<if test="groupList != null and !groupList.isEmpty()">
GROUP BY
<trim suffixOverrides="," suffix="">
<foreach collection="groupList" open="" close="" index="index" item="item" separator=",">
${item}
</foreach>
</trim>
</if>
</sql>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"mybatis-3-mapper.dtd">
<mapper namespace="com.mortals.xhx.module.dept.dao.ibatis.DeptDaoImpl">
<select id="queryDept" resultType="com.mortals.xhx.module.dept.model.DeptEntity">
select * from mortals_xhx_dept where deptCode = #{deptCode}
</select>
<select id="queryDeptParient" resultType="com.mortals.xhx.module.dept.model.DeptEntity">
select * from mortals_xhx_dept where deptCode = #{parentCode}
</select>
<select id="queryDeptParentId" resultType="integer">
select parentId from mortals_xhx_dept where deptId = #{deptId}
</select>
<!--查询所有子部门-->
<select id="getAllChildrenDept" resultType="com.mortals.xhx.module.dept.model.DeptEntity">
SELECT T3.id,T3.parentId, T3.deptName,T3.deptCode,T3.deptStatus
FROM(
SELECT
@codes as _ids,
( SELECT @codes := GROUP_CONCAT(id)
FROM mortals_xhx_dept
WHERE FIND_IN_SET(parentId, @codes)
) as T1,
@l := @l+1 as level_
FROM mortals_xhx_dept, (SELECT @codes := #{deptId}, @l := 0 ) T4
WHERE @codes IS NOT NULL
) T2, mortals_xhx_dept T3
WHERE FIND_IN_SET(T3.parentId, T2._ids)
</select>
</mapper>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"mybatis-3-mapper.dtd">
<mapper namespace="com.mortals.xhx.module.dept.dao.ibatis.DeptPerformStatDaoImpl">
<!-- 按天top10 -->
<select id="getDaySummaryList" parameterType="com.mortals.xhx.module.dept.model.vo.DeptSummaryTopQuery" resultType="com.mortals.xhx.module.dept.model.DeptPerformStatEntity">
SELECT * FROM (
SELECT
`year`,
`month`,
`day`,
deptId,
deptName,
SUM(totalScore) AS totalScore
FROM
mortals_xhx_dept_perform_stat
WHERE 1=1
<if test="year != null">
AND `year` = #{year}
</if>
<if test="month != null">
AND `month` = #{month}
</if>
<if test="day != null">
AND `day` = #{day}
</if>
GROUP BY
deptId,
deptName,
`year`,
`month`,
`day`
) AS a ORDER BY totalScore DESC LIMIT 10
</select>
<!-- 按月top10 -->
<select id="getMonthSummaryList" parameterType="com.mortals.xhx.module.dept.model.vo.DeptSummaryTopQuery" resultType="com.mortals.xhx.module.dept.model.DeptPerformStatEntity">
SELECT * FROM (
SELECT
`year`,
`month`,
deptId,
deptName,
SUM(totalScore) AS totalScore
FROM
mortals_xhx_dept_perform_stat
WHERE 1=1
<if test="year != null">
AND `year` = #{year}
</if>
<if test="month != null">
AND `month` = #{month}
</if>
GROUP BY
deptId,
deptName,
`year`,
`month`
) AS a ORDER BY totalScore DESC LIMIT 10
</select>
<!-- 按年top10 -->
<select id="getYearSummaryList" parameterType="com.mortals.xhx.module.dept.model.vo.DeptSummaryTopQuery" resultType="com.mortals.xhx.module.dept.model.DeptPerformStatEntity">
SELECT * FROM (
SELECT
`year`,
deptId,
deptName,
SUM(totalScore) AS totalScore
FROM
mortals_xhx_dept_perform_stat
WHERE 1=1
<if test="year != null">
AND `year` = #{year}
</if>
<if test="month != null">
AND `month` = #{month}
</if>
<if test="day != null">
AND `day` = #{day}
</if>
GROUP BY
deptId,
deptName,
`year`
) AS a ORDER BY totalScore DESC LIMIT 10
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"mybatis-3-mapper.dtd"> "mybatis-3-mapper.dtd">
<mapper namespace="com.mortals.xhx.module.news.dao.ibatis.NewsDaoImpl"> <mapper namespace="com.mortals.xhx.module.news.dao.ibatis.NewsDaoImpl">
<!-- 字段和属性映射 --> <!-- 字段和属性映射 -->
...@@ -18,6 +18,13 @@ ...@@ -18,6 +18,13 @@
<result property="createTime" column="createTime" /> <result property="createTime" column="createTime" />
<result property="updateUserId" column="updateUserId" /> <result property="updateUserId" column="updateUserId" />
<result property="updateTime" column="updateTime" /> <result property="updateTime" column="updateTime" />
<result property="editor" column="editor" />
<result property="shareNums" column="shareNums" />
<result property="deptId" column="deptId" />
<result property="deptName" column="deptName" />
<result property="statement" column="statement" />
<result property="source" column="source" />
<result property="remark" column="remark" />
</resultMap> </resultMap>
...@@ -64,23 +71,44 @@ ...@@ -64,23 +71,44 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateTime') or colPickMode == 1 and data.containsKey('updateTime')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateTime') or colPickMode == 1 and data.containsKey('updateTime')))">
a.updateTime, a.updateTime,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('editor') or colPickMode == 1 and data.containsKey('editor')))">
a.editor,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('shareNums') or colPickMode == 1 and data.containsKey('shareNums')))">
a.shareNums,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deptId') or colPickMode == 1 and data.containsKey('deptId')))">
a.deptId,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deptName') or colPickMode == 1 and data.containsKey('deptName')))">
a.deptName,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('statement') or colPickMode == 1 and data.containsKey('statement')))">
a.statement,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('source') or colPickMode == 1 and data.containsKey('source')))">
a.source,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('remark') or colPickMode == 1 and data.containsKey('remark')))">
a.remark,
</if>
</trim> </trim>
</sql> </sql>
<!-- 新增 区分主键自增加还是业务插入 --> <!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="NewsEntity" useGeneratedKeys="true" keyProperty="id"> <insert id="insert" parameterType="NewsEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_news insert into mortals_xhx_news
(categoryId,categoryName,title,titleLogoPath,content,top,viewNums,publishTime,createUserId,createTime,updateUserId,updateTime) (categoryId,categoryName,title,titleLogoPath,content,top,viewNums,publishTime,createUserId,createTime,updateUserId,updateTime,editor,shareNums,deptId,deptName,statement,source,remark)
VALUES VALUES
(#{categoryId},#{categoryName},#{title},#{titleLogoPath},#{content},#{top},#{viewNums},#{publishTime},#{createUserId},#{createTime},#{updateUserId},#{updateTime}) (#{categoryId},#{categoryName},#{title},#{titleLogoPath},#{content},#{top},#{viewNums},#{publishTime},#{createUserId},#{createTime},#{updateUserId},#{updateTime},#{editor},#{shareNums},#{deptId},#{deptName},#{statement},#{source},#{remark})
</insert> </insert>
<!-- 批量新增 --> <!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto"> <insert id="insertBatch" parameterType="paramDto">
insert into mortals_xhx_news insert into mortals_xhx_news
(categoryId,categoryName,title,titleLogoPath,content,top,viewNums,publishTime,createUserId,createTime,updateUserId,updateTime) (categoryId,categoryName,title,titleLogoPath,content,top,viewNums,publishTime,createUserId,createTime,updateUserId,updateTime,editor,shareNums,deptId,deptName,statement,source,remark)
VALUES VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," > <foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.categoryId},#{item.categoryName},#{item.title},#{item.titleLogoPath},#{item.content},#{item.top},#{item.viewNums},#{item.publishTime},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime}) (#{item.categoryId},#{item.categoryName},#{item.title},#{item.titleLogoPath},#{item.content},#{item.top},#{item.viewNums},#{item.publishTime},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime},#{item.editor},#{item.shareNums},#{item.deptId},#{item.deptName},#{item.statement},#{item.source},#{item.remark})
</foreach> </foreach>
</insert> </insert>
...@@ -141,6 +169,33 @@ ...@@ -141,6 +169,33 @@
<if test="(colPickMode==0 and data.containsKey('updateTime')) or (colPickMode==1 and !data.containsKey('updateTime'))"> <if test="(colPickMode==0 and data.containsKey('updateTime')) or (colPickMode==1 and !data.containsKey('updateTime'))">
a.updateTime=#{data.updateTime}, a.updateTime=#{data.updateTime},
</if> </if>
<if test="(colPickMode==0 and data.containsKey('editor')) or (colPickMode==1 and !data.containsKey('editor'))">
a.editor=#{data.editor},
</if>
<if test="(colPickMode==0 and data.containsKey('shareNums')) or (colPickMode==1 and !data.containsKey('shareNums'))">
a.shareNums=#{data.shareNums},
</if>
<if test="(colPickMode==0 and data.containsKey('shareNumsIncrement')) or (colPickMode==1 and !data.containsKey('shareNumsIncrement'))">
a.shareNums=ifnull(a.shareNums,0) + #{data.shareNumsIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('deptId')) or (colPickMode==1 and !data.containsKey('deptId'))">
a.deptId=#{data.deptId},
</if>
<if test="(colPickMode==0 and data.containsKey('deptIdIncrement')) or (colPickMode==1 and !data.containsKey('deptIdIncrement'))">
a.deptId=ifnull(a.deptId,0) + #{data.deptIdIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('deptName')) or (colPickMode==1 and !data.containsKey('deptName'))">
a.deptName=#{data.deptName},
</if>
<if test="(colPickMode==0 and data.containsKey('statement')) or (colPickMode==1 and !data.containsKey('statement'))">
a.statement=#{data.statement},
</if>
<if test="(colPickMode==0 and data.containsKey('source')) or (colPickMode==1 and !data.containsKey('source'))">
a.source=#{data.source},
</if>
<if test="(colPickMode==0 and data.containsKey('remark')) or (colPickMode==1 and !data.containsKey('remark'))">
a.remark=#{data.remark},
</if>
</trim> </trim>
<trim suffixOverrides="where" suffix=""> <trim suffixOverrides="where" suffix="">
where where
...@@ -262,6 +317,65 @@ ...@@ -262,6 +317,65 @@
</if> </if>
</foreach> </foreach>
</trim> </trim>
<trim prefix="editor=(case" suffix="ELSE editor end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('editor')) or (colPickMode==1 and !item.containsKey('editor'))">
when a.id=#{item.id} then #{item.editor}
</if>
</foreach>
</trim>
<trim prefix="shareNums=(case" suffix="ELSE shareNums end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('shareNums')) or (colPickMode==1 and !item.containsKey('shareNums'))">
when a.id=#{item.id} then #{item.shareNums}
</when>
<when test="(colPickMode==0 and item.containsKey('shareNumsIncrement')) or (colPickMode==1 and !item.containsKey('shareNumsIncrement'))">
when a.id=#{item.id} then ifnull(a.shareNums,0) + #{item.shareNumsIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="deptId=(case" suffix="ELSE deptId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('deptId')) or (colPickMode==1 and !item.containsKey('deptId'))">
when a.id=#{item.id} then #{item.deptId}
</when>
<when test="(colPickMode==0 and item.containsKey('deptIdIncrement')) or (colPickMode==1 and !item.containsKey('deptIdIncrement'))">
when a.id=#{item.id} then ifnull(a.deptId,0) + #{item.deptIdIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="deptName=(case" suffix="ELSE deptName end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('deptName')) or (colPickMode==1 and !item.containsKey('deptName'))">
when a.id=#{item.id} then #{item.deptName}
</if>
</foreach>
</trim>
<trim prefix="statement=(case" suffix="ELSE statement end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('statement')) or (colPickMode==1 and !item.containsKey('statement'))">
when a.id=#{item.id} then #{item.statement}
</if>
</foreach>
</trim>
<trim prefix="source=(case" suffix="ELSE source end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('source')) or (colPickMode==1 and !item.containsKey('source'))">
when a.id=#{item.id} then #{item.source}
</if>
</foreach>
</trim>
<trim prefix="remark=(case" suffix="ELSE remark end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('remark')) or (colPickMode==1 and !item.containsKey('remark'))">
when a.id=#{item.id} then #{item.remark}
</if>
</foreach>
</trim>
</trim> </trim>
where id in where id in
<foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")"> <foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")">
...@@ -669,18 +783,289 @@ ...@@ -669,18 +783,289 @@
<if test="conditionParamRef.containsKey('updateTimeEnd') and conditionParamRef.updateTimeEnd != null and conditionParamRef.updateTimeEnd!=''"> <if test="conditionParamRef.containsKey('updateTimeEnd') and conditionParamRef.updateTimeEnd != null and conditionParamRef.updateTimeEnd!=''">
${_conditionType_} a.updateTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.updateTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') ${_conditionType_} a.updateTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.updateTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
</if> </if>
<if test="conditionParamRef.containsKey('editor')">
<if test="conditionParamRef.editor != null and conditionParamRef.editor != ''">
${_conditionType_} a.editor like #{${_conditionParam_}.editor}
</if>
<if test="conditionParamRef.editor == null">
${_conditionType_} a.editor is null
</if>
</if>
<if test="conditionParamRef.containsKey('editorList') and conditionParamRef.editorList.size() > 0">
${_conditionType_} a.editor in
<foreach collection="conditionParamRef.editorList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('editorNotList') and conditionParamRef.editorNotList.size() > 0">
${_conditionType_} a.editor not in
<foreach collection="conditionParamRef.editorNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('shareNums')">
<if test="conditionParamRef.shareNums != null ">
${_conditionType_} a.shareNums = #{${_conditionParam_}.shareNums}
</if>
<if test="conditionParamRef.shareNums == null">
${_conditionType_} a.shareNums is null
</if>
</if>
<if test="conditionParamRef.containsKey('shareNumsList') and conditionParamRef.shareNumsList.size() > 0">
${_conditionType_} a.shareNums in
<foreach collection="conditionParamRef.shareNumsList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('shareNumsNotList') and conditionParamRef.shareNumsNotList.size() > 0">
${_conditionType_} a.shareNums not in
<foreach collection="conditionParamRef.shareNumsNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('shareNumsStart') and conditionParamRef.shareNumsStart != null">
${_conditionType_} a.shareNums <![CDATA[ >= ]]> #{${_conditionParam_}.shareNumsStart}
</if>
<if test="conditionParamRef.containsKey('shareNumsEnd') and conditionParamRef.shareNumsEnd != null">
${_conditionType_} a.shareNums <![CDATA[ <= ]]> #{${_conditionParam_}.shareNumsEnd}
</if>
<if test="conditionParamRef.containsKey('deptId')">
<if test="conditionParamRef.deptId != null ">
${_conditionType_} a.deptId = #{${_conditionParam_}.deptId}
</if>
<if test="conditionParamRef.deptId == null">
${_conditionType_} a.deptId is null
</if>
</if>
<if test="conditionParamRef.containsKey('deptIdList') and conditionParamRef.deptIdList.size() > 0">
${_conditionType_} a.deptId in
<foreach collection="conditionParamRef.deptIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deptIdNotList') and conditionParamRef.deptIdNotList.size() > 0">
${_conditionType_} a.deptId not in
<foreach collection="conditionParamRef.deptIdNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deptIdStart') and conditionParamRef.deptIdStart != null">
${_conditionType_} a.deptId <![CDATA[ >= ]]> #{${_conditionParam_}.deptIdStart}
</if>
<if test="conditionParamRef.containsKey('deptIdEnd') and conditionParamRef.deptIdEnd != null">
${_conditionType_} a.deptId <![CDATA[ <= ]]> #{${_conditionParam_}.deptIdEnd}
</if>
<if test="conditionParamRef.containsKey('deptName')">
<if test="conditionParamRef.deptName != null and conditionParamRef.deptName != ''">
${_conditionType_} a.deptName like #{${_conditionParam_}.deptName}
</if>
<if test="conditionParamRef.deptName == null">
${_conditionType_} a.deptName is null
</if>
</if>
<if test="conditionParamRef.containsKey('deptNameList') and conditionParamRef.deptNameList.size() > 0">
${_conditionType_} a.deptName in
<foreach collection="conditionParamRef.deptNameList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deptNameNotList') and conditionParamRef.deptNameNotList.size() > 0">
${_conditionType_} a.deptName not in
<foreach collection="conditionParamRef.deptNameNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('statement')">
<if test="conditionParamRef.statement != null and conditionParamRef.statement != ''">
${_conditionType_} a.statement like #{${_conditionParam_}.statement}
</if>
<if test="conditionParamRef.statement == null">
${_conditionType_} a.statement is null
</if>
</if>
<if test="conditionParamRef.containsKey('statementList') and conditionParamRef.statementList.size() > 0">
${_conditionType_} a.statement in
<foreach collection="conditionParamRef.statementList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('statementNotList') and conditionParamRef.statementNotList.size() > 0">
${_conditionType_} a.statement not in
<foreach collection="conditionParamRef.statementNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('source')">
<if test="conditionParamRef.source != null and conditionParamRef.source != ''">
${_conditionType_} a.source like #{${_conditionParam_}.source}
</if>
<if test="conditionParamRef.source == null">
${_conditionType_} a.source is null
</if>
</if>
<if test="conditionParamRef.containsKey('sourceList') and conditionParamRef.sourceList.size() > 0">
${_conditionType_} a.source in
<foreach collection="conditionParamRef.sourceList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('sourceNotList') and conditionParamRef.sourceNotList.size() > 0">
${_conditionType_} a.source not in
<foreach collection="conditionParamRef.sourceNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('remark')">
<if test="conditionParamRef.remark != null and conditionParamRef.remark != ''">
${_conditionType_} a.remark like #{${_conditionParam_}.remark}
</if>
<if test="conditionParamRef.remark == null">
${_conditionType_} a.remark is null
</if>
</if>
<if test="conditionParamRef.containsKey('remarkList') and conditionParamRef.remarkList.size() > 0">
${_conditionType_} a.remark in
<foreach collection="conditionParamRef.remarkList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('remarkNotList') and conditionParamRef.remarkNotList.size() > 0">
${_conditionType_} a.remark not in
<foreach collection="conditionParamRef.remarkNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
</sql> </sql>
<sql id="_orderCols_"> <sql id="_orderCols_">
<if test="orderColList != null and !orderColList.isEmpty()"> <if test="orderColList != null and !orderColList.isEmpty()">
order by order by
<if test="conditionParamRef.containsKey('idList') and conditionParamRef.idList.size() > 0">
field(a.id,
<foreach collection="conditionParamRef.idList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('categoryIdList') and conditionParamRef.categoryIdList.size() > 0">
field(a.categoryId,
<foreach collection="conditionParamRef.categoryIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('topList') and conditionParamRef.topList.size() > 0">
field(a.top,
<foreach collection="conditionParamRef.topList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('viewNumsList') and conditionParamRef.viewNumsList.size() > 0">
field(a.viewNums,
<foreach collection="conditionParamRef.viewNumsList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('createUserIdList') and conditionParamRef.createUserIdList.size() > 0">
field(a.createUserId,
<foreach collection="conditionParamRef.createUserIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('updateUserIdList') and conditionParamRef.updateUserIdList.size() > 0">
field(a.updateUserId,
<foreach collection="conditionParamRef.updateUserIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('shareNumsList') and conditionParamRef.shareNumsList.size() > 0">
field(a.shareNums,
<foreach collection="conditionParamRef.shareNumsList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('deptIdList') and conditionParamRef.deptIdList.size() > 0">
field(a.deptId,
<foreach collection="conditionParamRef.deptIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<trim suffixOverrides="," suffix=""> <trim suffixOverrides="," suffix="">
<foreach collection="orderColList" open="" close="" index="index" item="item" separator=","> <foreach collection="orderColList" open="" close="" index="index" item="item" separator=",">
${item.colName} ${item.sortKind} a.${item.colName} ${item.sortKind}
</foreach> </foreach>
</trim> </trim>
</if> </if>
<if test="(orderColList == null or orderColList.isEmpty()) and orderCol != null and !orderCol.isEmpty()"> <if test="(orderColList == null or orderColList.isEmpty()) and orderCol != null and !orderCol.isEmpty()">
order by order by
<if test="conditionParamRef.containsKey('idList') and conditionParamRef.idList.size() > 0">
field(a.id,
<foreach collection="conditionParamRef.idList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('categoryIdList') and conditionParamRef.categoryIdList.size() > 0">
field(a.categoryId,
<foreach collection="conditionParamRef.categoryIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('topList') and conditionParamRef.topList.size() > 0">
field(a.top,
<foreach collection="conditionParamRef.topList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('viewNumsList') and conditionParamRef.viewNumsList.size() > 0">
field(a.viewNums,
<foreach collection="conditionParamRef.viewNumsList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('createUserIdList') and conditionParamRef.createUserIdList.size() > 0">
field(a.createUserId,
<foreach collection="conditionParamRef.createUserIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('updateUserIdList') and conditionParamRef.updateUserIdList.size() > 0">
field(a.updateUserId,
<foreach collection="conditionParamRef.updateUserIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('shareNumsList') and conditionParamRef.shareNumsList.size() > 0">
field(a.shareNums,
<foreach collection="conditionParamRef.shareNumsList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<if test="conditionParamRef.containsKey('deptIdList') and conditionParamRef.deptIdList.size() > 0">
field(a.deptId,
<foreach collection="conditionParamRef.deptIdList" open="" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
,
</if>
<trim suffixOverrides="," suffix=""> <trim suffixOverrides="," suffix="">
<if test="orderCol.containsKey('id')"> <if test="orderCol.containsKey('id')">
a.id a.id
...@@ -747,8 +1132,45 @@ ...@@ -747,8 +1132,45 @@
<if test='orderCol.updateTime != null and "DESC".equalsIgnoreCase(orderCol.updateTime)'>DESC</if> <if test='orderCol.updateTime != null and "DESC".equalsIgnoreCase(orderCol.updateTime)'>DESC</if>
, ,
</if> </if>
<if test="orderCol.containsKey('editor')">
a.editor
<if test='orderCol.editor != null and "DESC".equalsIgnoreCase(orderCol.editor)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('shareNums')">
a.shareNums
<if test='orderCol.shareNums != null and "DESC".equalsIgnoreCase(orderCol.shareNums)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('deptId')">
a.deptId
<if test='orderCol.deptId != null and "DESC".equalsIgnoreCase(orderCol.deptId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('deptName')">
a.deptName
<if test='orderCol.deptName != null and "DESC".equalsIgnoreCase(orderCol.deptName)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('statement')">
a.statement
<if test='orderCol.statement != null and "DESC".equalsIgnoreCase(orderCol.statement)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('source')">
a.source
<if test='orderCol.source != null and "DESC".equalsIgnoreCase(orderCol.source)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('remark')">
a.remark
<if test='orderCol.remark != null and "DESC".equalsIgnoreCase(orderCol.remark)'>DESC</if>
,
</if>
</trim> </trim>
</if> </if>
</sql> </sql>
<sql id="_group_by_"> <sql id="_group_by_">
<if test="groupList != null and !groupList.isEmpty()"> <if test="groupList != null and !groupList.isEmpty()">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment