Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
JSH ERP
Commits
6bbc0aef
Commit
6bbc0aef
authored
Feb 20, 2019
by
cjl
Browse files
修改商品类别展示方式为树形结构
parent
9fff3f2a
Changes
15
Hide whitespace changes
Inline
Side-by-side
erp_web/pages/materials/materialcategory.html
View file @
6bbc0aef
...
@@ -15,65 +15,53 @@
...
@@ -15,65 +15,53 @@
<script
type=
"text/javascript"
src=
"/js/common/common.js"
></script>
<script
type=
"text/javascript"
src=
"/js/common/common.js"
></script>
</head>
</head>
<body>
<body>
<!-- 查询 -->
<div
id=
"searchPanel"
class=
"easyui-panel"
style=
"padding:10px;"
title=
"查询窗口"
iconCls=
"icon-search"
collapsible=
"true"
closable=
"false"
>
<table
id=
"searchTable"
>
<tr>
<td>
名称:
</td>
<td>
<input
name=
"searchName"
id=
"searchName"
style=
"width:100px;"
/>
</td>
<td>
</td>
<td>
类别:
</td>
<td>
<select
name=
"searchParentId_f"
id=
"searchParentId_f"
style=
"width:100px;"
></select>
<select
name=
"searchParentId_s"
id=
"searchParentId_s"
style=
"width:100px;"
></select>
<select
name=
"searchParentId_t"
id=
"searchParentId_t"
style=
"width:100px;"
></select>
</td>
<td>
</td>
<td>
<a
href=
"javascript:void(0)"
class=
"easyui-linkbutton"
iconCls=
"icon-search"
id=
"searchBtn"
>
查询
</a>
<a
href=
"javascript:void(0)"
class=
"easyui-linkbutton"
iconCls=
"icon-redo"
id=
"searchResetBtn"
>
重置
</a>
</td>
</tr>
</table>
</div>
<!-- 数据显示table -->
<!-- 数据显示table -->
<div
id=
"tablePanel"
class=
"easyui-panel"
style=
"padding:1px;top:300px;"
title=
"商品类别列表"
iconCls=
"icon-list"
<div
id=
"tablePanel"
class=
"easyui-panel"
style=
"padding:1px;top:300px;"
title=
"商品类别列表"
iconCls=
"icon-list"
collapsible=
"true"
closable=
"false"
>
collapsible=
"true"
closable=
"false"
>
<table
id=
"tableData"
style=
"top:300px;border-bottom-color:#FFFFFF"
></table>
<table
id=
"tableData"
style=
"top:300px;border-bottom-color:#FFFFFF"
>
</table>
</div>
</div>
<div
id=
"materialCategoryDlg"
class=
"easyui-dialog"
style=
"width:380px;padding:10px 20px"
<div
id=
"materialCategoryDlg"
class=
"easyui-dialog"
style=
"width:380px;padding:10px 20px"
closed=
"true"
buttons=
"#dlg-buttons"
modal=
"true"
cache=
"false"
collapsible=
"false"
closable=
"true"
>
closed=
"true"
buttons=
"#dlg-buttons"
modal=
"true"
cache=
"false"
collapsible=
"false"
closable=
"true"
>
<form
id=
"materialCategoryFM"
method=
"post"
novalidate
>
<form
id=
"materialCategoryFM"
method=
"post"
novalidate
>
<table>
<table>
<tr>
<td>
上级目录
</td>
<td
style=
"padding:5px"
>
<input
name=
"parentName"
id=
"parentName"
style=
"width: 200px;height: 20px"
readonly=
"readonly"
/>
<a
href=
"javascript:void(0)"
class=
"l-btn l-btn-plain"
group=
""
id=
"lookForSelectMaterialCategory"
>
<span
class=
"l-btn-left"
><span
class=
"l-btn-text icon-search l-btn-icon-left"
></span></span></a>
<input
name=
"parentid"
id=
"parentid"
type=
"hidden"
/>
</td>
</tr>
<tr>
<tr>
<td>
名称
</td>
<td>
名称
</td>
<td
style=
"padding:5px"
>
<td
style=
"padding:5px"
>
<input
name=
"Name"
id=
"Name"
class=
"easyui-validatebox"
<input
name=
"Name"
id=
"Name"
class=
"easyui-validatebox"
data-options=
"required:true,validType:'length[2,30]'"
style=
"width: 100px;height: 20px"
/>
data-options=
"required:true,validType:'length[2,30]'"
style=
"width: 200px;height: 20px"
/>
<input
name=
"id"
id=
"id"
type=
"hidden"
/>
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<td>
层次
</td>
<td>
编号
</td>
<td
style=
"padding:5px"
>
<td
style=
"padding:5px"
>
<select
name=
"CategoryLevel"
id=
"CategoryLevel"
style=
"width:100px;"
>
<input
name=
"serialNo"
id=
"serialNo"
style=
"width: 200px;height: 20px"
/>
<option
value=
"1"
>
一级分类
</option>
<option
value=
"2"
>
二级分类
</option>
<option
value=
"3"
>
三级分类
</option>
</select>
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<td>
上级
</td>
<td>
序号
</td>
<td
style=
"padding:5px"
>
<td
style=
"padding:5px"
>
<select
name=
"ParentId_f"
id=
"ParentId_f"
style=
"width:100px;height: 20px"
></select>
<input
name=
"sort"
id=
"sort"
style=
"width: 200px;height: 20px"
/>
<select
name=
"ParentId_s"
id=
"ParentId_s"
style=
"width:100px;height: 20px"
></select>
</td>
</td>
</tr>
</tr>
<tr>
<td>
备注
</td>
<td
style=
"padding:5px"
>
<textarea
name=
"remark"
id=
"remark"
placeholder=
"暂无备注信息"
style=
"width: 200px; height:40px;"
></textarea>
</td>
</tr>
</table>
</table>
</form>
</form>
</div>
</div>
...
@@ -82,169 +70,18 @@
...
@@ -82,169 +70,18 @@
<a
href=
"javascript:void(0)"
id=
"cancelMaterialCategory"
class=
"easyui-linkbutton"
iconCls=
"icon-cancel"
<a
href=
"javascript:void(0)"
id=
"cancelMaterialCategory"
class=
"easyui-linkbutton"
iconCls=
"icon-cancel"
onclick=
"javascript:$('#materialCategoryDlg').dialog('close')"
>
取消
</a>
onclick=
"javascript:$('#materialCategoryDlg').dialog('close')"
>
取消
</a>
</div>
</div>
<div
id=
"forSelectMaterialCategoryDlg"
class=
"easyui-dialog"
style=
"width:380px;padding:10px 20px"
closed=
"true"
modal=
"true"
cache=
"false"
collapsible=
"false"
closable=
"true"
>
</div>
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
var
materialCategoryList
=
null
;
var
url
;
var
materialCategoryID
=
null
;
var
parentid_search
=
null
;
var
lei
=
null
;
//初始化界面
//初始化界面
$
(
function
()
{
$
(
function
()
{
var
treeHeight
=
webH
-
35
;
//初始化系统基础信息
//初始化系统基础信息
initSystemData
(
1
);
initSelectInfo
(
1
);
initTableData
();
ininPager
();
initForm
();
});
//初始化系统基础信息
function
initSystemData
(
parentid_search
)
{
$
.
ajax
({
type
:
"
get
"
,
url
:
"
/materialCategory/getAllList
"
,
data
:
({
parentId
:
parentid_search
}),
//设置为同步
async
:
false
,
dataType
:
"
json
"
,
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
){
materialCategoryList
=
res
.
data
;
}
else
{
$
.
messager
.
alert
(
'
提示
'
,
'
查找系统基础信息异常,请与管理员联系!
'
,
'
error
'
);
return
;
}
}
});
}
//初始化页面选项卡
function
initSelectInfo
(
lei
)
{
var
options
=
""
;
if
(
materialCategoryList
!=
null
)
{
options
=
""
;
for
(
var
i
=
0
;
i
<
materialCategoryList
.
length
;
i
++
)
{
var
materialCategory
=
materialCategoryList
[
i
];
if
(
0
==
i
)
{
materialCategoryID
=
materialCategory
.
id
;
}
options
+=
'
<option value="
'
+
materialCategory
.
id
+
'
">
'
+
materialCategory
.
name
+
'
</option>
'
;
}
//$("#ParentId").empty().append(options);
if
(
lei
==
1
)
{
$
(
"
#searchParentId_f
"
).
empty
().
append
(
'
<option value="">全部</option>
'
).
append
(
options
);
}
else
if
(
lei
==
2
)
{
$
(
"
#searchParentId_s
"
).
empty
().
append
(
'
<option value="">全部</option>
'
).
append
(
options
);
}
else
if
(
lei
==
3
)
{
$
(
"
#searchParentId_t
"
).
empty
().
append
(
'
<option value="">全部</option>
'
).
append
(
options
);
}
else
if
(
lei
==
11
)
{
$
(
"
#ParentId_f
"
).
empty
().
append
(
'
<option value="">全部</option>
'
).
append
(
options
);
}
else
if
(
lei
==
12
)
{
$
(
"
#ParentId_s
"
).
empty
().
append
(
'
<option value="">全部</option>
'
).
append
(
options
);
}
}
}
$
(
"
#searchParentId_f
"
).
change
(
function
()
{
var
parentid_search
=
$
(
"
#searchParentId_f
"
).
val
();
if
(
parentid_search
!=
''
)
{
initSystemData
(
parentid_search
);
initSelectInfo
(
2
);
}
}
);
$
(
"
#searchParentId_s
"
).
change
(
function
()
{
var
parentid_search
=
$
(
"
#searchParentId_s
"
).
val
();
if
(
parentid_search
!=
''
)
{
initSystemData
(
parentid_search
);
initSelectInfo
(
3
);
}
}
);
$
(
"
#CategoryLevel
"
).
change
(
function
()
{
var
CategoryLevel
=
$
(
"
#CategoryLevel
"
).
val
();
if
(
CategoryLevel
==
1
)
{
$
(
"
#ParentId_f
"
).
empty
();
$
(
"
#ParentId_s
"
).
empty
();
}
else
if
(
CategoryLevel
==
2
)
{
initSystemData
(
1
);
initSelectInfo
(
11
);
$
(
"
#ParentId_s
"
).
enabled
=
false
;
}
else
if
(
CategoryLevel
==
3
)
{
initSystemData
(
1
);
initSelectInfo
(
11
);
}
}
);
$
(
"
#ParentId_f
"
).
change
(
function
()
{
var
ParentId_f
=
$
(
"
#ParentId_f
"
).
val
();
initSystemData
(
ParentId_f
);
initSelectInfo
(
12
);
}
);
//防止表单提交重复
function
initForm
()
{
$
(
'
#materialCategoryFM
'
).
form
({
onSubmit
:
function
()
{
return
false
;
}
});
}
//初始化表格数据
function
initTableData
()
{
$
(
'
#tableData
'
).
datagrid
({
$
(
'
#tableData
'
).
datagrid
({
//title:'商品类别列表',
height
:
treeHeight
,
//iconCls:'icon-save',
//width:700,
height
:
heightInfo
,
nowrap
:
false
,
rownumbers
:
false
,
//动画效果
animate
:
false
,
//选中单行
singleSelect
:
true
,
collapsible
:
false
,
selectOnCheck
:
false
,
//fitColumns:true,
//单击行是否选中
//checkOnSelect : false,
pagination
:
true
,
//交替出现背景
striped
:
true
,
//loadFilter: pagerFilter,
pageSize
:
initPageSize
,
pageList
:
initPageNum
,
columns
:
[[
{
field
:
'
id
'
,
width
:
35
,
align
:
"
center
"
,
checkbox
:
true
},
{
title
:
'
名称
'
,
field
:
'
name
'
,
width
:
250
},
{
title
:
'
操作
'
,
field
:
'
op
'
,
align
:
"
center
"
,
width
:
130
,
formatter
:
function
(
value
,
rec
)
{
var
str
=
''
;
var
rowInfo
=
rec
.
id
+
'
AaBb
'
+
rec
.
parentId
+
'
AaBb
'
+
rec
.
categoryLevel
+
'
AaBb
'
+
rec
.
name
;
str
+=
'
<img src="/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editMaterialCategory(
\'
'
+
rowInfo
+
'
\'
);"/> <a onclick="editMaterialCategory(
\'
'
+
rowInfo
+
'
\'
);" style="text-decoration:none;color:black;" href="javascript:void(0)">编辑</a>
'
;
str
+=
'
<img src="/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteMaterialCategory(
'
+
rec
.
id
+
'
);"/> <a onclick="deleteMaterialCategory(
'
+
rec
.
id
+
'
);" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a>
'
;
return
str
;
}
}
]],
toolbar
:
[
toolbar
:
[
{
{
id
:
'
addMaterialCategory
'
,
id
:
'
addMaterialCategory
'
,
...
@@ -264,100 +101,91 @@
...
@@ -264,100 +101,91 @@
}
}
}
}
],
],
onLoadError
:
function
()
{
});
$
.
messager
.
alert
(
'
页面加载提示
'
,
'
页面加载异常,请稍后再试!
'
,
'
error
'
);
$
(
'
#tableData
'
).
prev
(
'
.datagrid-view2
'
).
find
(
"
.datagrid-body
"
).
append
(
"
<ul id='tt'><ul>
"
);
return
;
$
(
'
#tt
'
).
tree
({
url
:
'
/materialCategory/getMaterialCategoryTree
'
,
animate
:
true
,
checkbox
:
true
,
onDblClick
:
function
(
node
){
//双击修改
editMaterialCategory
(
node
);
}
}
});
});
showMaterialCategoryDetails
(
1
,
initPageSize
);
}
//初始化键盘enter事件
$
(
document
).
keydown
(
function
(
event
)
{
//兼容 IE和firefox 事件
var
e
=
window
.
event
||
event
;
var
k
=
e
.
keyCode
||
e
.
which
||
e
.
charCode
;
//兼容 IE,firefox 兼容
var
obj
=
e
.
srcElement
?
e
.
srcElement
:
e
.
target
;
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
if
(
k
==
"
13
"
&&
(
obj
.
id
==
"
CategoryLevel
"
||
obj
.
id
==
"
Name
"
))
{
$
(
"
#saveMaterialCategory
"
).
click
();
}
//搜索按钮添加快捷键
if
(
k
==
"
13
"
&&
(
obj
.
id
==
"
searchParentId
"
||
(
obj
.
id
==
"
searchName
"
)))
{
$
(
"
#searchBtn
"
).
click
();
}
});
});
//分页信息处理
function
addMaterialCategory
()
{
function
ininPager
()
{
$
(
'
#materialCategoryFM
'
).
form
(
'
clear
'
);
try
{
$
(
'
#materialCategoryDlg
'
).
dialog
(
'
open
'
).
dialog
(
'
setTitle
'
,
'
<img src="/js/easyui-1.3.5/themes/icons/edit_add.png"/> 增加商品类别信息
'
);
var
opts
=
$
(
"
#tableData
"
).
datagrid
(
'
options
'
);
$
(
"
.window-mask
"
).
css
({
width
:
webW
,
height
:
webH
});
var
pager
=
$
(
"
#tableData
"
).
datagrid
(
'
getPager
'
);
$
(
"
#Name
"
).
val
(
""
).
focus
();
pager
.
pagination
({
$
(
"
#parentName
"
).
val
(
""
);
onSelectPage
:
function
(
pageNum
,
pageSize
)
{
$
(
"
#parentid
"
).
val
(
""
);
opts
.
pageNumber
=
pageNum
;
$
(
"
#serialNo
"
).
val
(
""
);
opts
.
pageSize
=
pageSize
;
$
(
"
#sort
"
).
val
(
""
);
pager
.
pagination
(
'
refresh
'
,
{
$
(
"
#remark
"
).
val
(
""
);
pageNumber
:
pageNum
,
$
(
"
#id
"
).
val
(
""
);
pageSize
:
pageSize
url
=
'
/materialCategory/addMaterialCategory
'
;
});
showMaterialCategoryDetails
(
pageNum
,
pageSize
);
}
});
}
catch
(
e
)
{
$
.
messager
.
alert
(
'
异常处理提示
'
,
"
分页信息异常 :
"
+
e
.
name
+
"
:
"
+
e
.
message
,
'
error
'
);
}
}
}
function
editMaterialCategory
(
node
)
{
//删除商品类别信息
var
id
=
node
.
id
;
function
deleteMaterialCategory
(
materialCategoryID
)
{
$
.
ajax
({
$
.
messager
.
confirm
(
'
删除确认
'
,
'
确定要删除此商品类别信息吗?
'
,
function
(
r
)
{
type
:
"
post
"
,
if
(
r
)
{
url
:
'
/materialCategory/findById
'
,
$
.
ajax
({
dataType
:
"
json
"
,
type
:
"
post
"
,
data
:
({
url
:
"
/materialCategory/
"
+
materialCategoryID
+
"
/delete
"
,
id
:
id
dataType
:
"
json
"
,
}),
success
:
function
(
res
)
{
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
==
200
)
{
if
(
res
)
{
$
(
"
#searchBtn
"
).
click
();
if
(
res
.
code
!=
200
){
}
else
{
$
.
messager
.
alert
(
'
提示
'
,
res
.
msg
,
'
error
'
);
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除商品类别信息失败,请稍后再试!
'
,
'
error
'
);
}
},
//此处添加错误处理
error
:
function
()
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除商品类别信息异常,请稍后再试!
'
,
'
error
'
);
return
;
return
;
}
}
});
$
(
'
#materialCategoryFM
'
).
form
(
'
clear
'
);
$
(
'
#materialCategoryDlg
'
).
dialog
(
'
open
'
).
dialog
(
'
setTitle
'
,
'
<img src="/js/easyui-1.3.5/themes/icons/edit_add.png"/> 修改商品类别信息
'
);
$
(
"
.window-mask
"
).
css
({
width
:
webW
,
height
:
webH
});
$
(
"
#Name
"
).
val
(
res
.
data
.
name
).
focus
();
$
(
"
#parentName
"
).
val
(
res
.
data
.
parentName
);
$
(
"
#parentid
"
).
val
(
res
.
data
.
parentId
);
$
(
"
#serialNo
"
).
val
(
res
.
data
.
serialNo
);
$
(
"
#sort
"
).
val
(
res
.
data
.
sort
);
$
(
"
#remark
"
).
val
(
res
.
data
.
remark
);
$
(
"
#id
"
).
val
(
res
.
data
.
id
);
url
=
'
/materialCategory/editMaterialCategory
'
;
}
},
//此处添加错误处理
error
:
function
()
{
$
.
messager
.
alert
(
'
提示
'
,
'
修改商品类别信息异常,请稍后再试!
'
,
'
error
'
);
return
;
}
}
});
});
}
}
//批量删除商品类别
//批量删除商品类别
function
batDeleteMaterialCategory
()
{
function
batDeleteMaterialCategory
()
{
var
row
=
$
(
'
#t
ableData
'
).
datagrid
(
'
getChecked
'
);
var
nodes
=
$
(
'
#t
t
'
).
tree
(
'
getChecked
'
);
if
(
row
.
length
==
0
)
{
if
(
nodes
.
length
==
0
)
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
没有记录被选中!
'
,
'
info
'
);
$
.
messager
.
alert
(
'
删除提示
'
,
'
没有记录被选中!
'
,
'
info
'
);
return
;
return
;
}
}
if
(
row
.
length
>
0
)
{
if
(
nodes
.
length
>
0
)
{
$
.
messager
.
confirm
(
'
删除确认
'
,
'
确定要删除选中的
'
+
row
.
length
+
'
条商品类别信息吗?
'
,
function
(
r
)
{
$
.
messager
.
confirm
(
'
删除确认
'
,
'
确定要删除选中的
'
+
nodes
.
length
+
'
条商品类别信息吗?
'
,
function
(
r
)
{
if
(
r
)
{
if
(
r
)
{
var
ids
=
""
;
var
ids
=
""
;
for
(
var
i
=
0
;
i
<
row
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
nodes
.
length
;
i
++
)
{
if
(
i
==
row
.
length
-
1
)
{
if
(
i
==
nodes
.
length
-
1
)
{
ids
+=
row
[
i
].
id
;
ids
+=
nodes
[
i
].
id
;
break
;
break
;
}
}
//alert(row[i].id);
//alert(row[i].id);
ids
+=
row
[
i
].
id
+
"
,
"
;
ids
+=
nodes
[
i
].
id
+
"
,
"
;
}
}
$
.
ajax
({
$
.
ajax
({
type
:
"
post
"
,
type
:
"
post
"
,
url
:
"
/materialCategory/batchDelete
"
,
url
:
"
/materialCategory/batchDelete
MaterialCategory
"
,
dataType
:
"
json
"
,
dataType
:
"
json
"
,
async
:
false
,
async
:
false
,
data
:
({
data
:
({
...
@@ -365,8 +193,7 @@
...
@@ -365,8 +193,7 @@
}),
}),
success
:
function
(
res
)
{
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
)
{
if
(
res
&&
res
.
code
===
200
)
{
$
(
"
#searchBtn
"
).
click
();
$
(
'
#tt
'
).
tree
(
'
reload
'
);
$
(
"
:checkbox
"
).
attr
(
"
checked
"
,
false
);
}
else
{
}
else
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除商品类别信息失败,请稍后再试!
'
,
'
error
'
);
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除商品类别信息失败,请稍后再试!
'
,
'
error
'
);
}
}
...
@@ -382,49 +209,29 @@
...
@@ -382,49 +209,29 @@
}
}
}
}
//增加
var
url
;
var
materialCategoryID
=
0
;
//保存编辑前的名称
var
orgMaterialCategory
=
""
;
function
addMaterialCategory
()
{
$
(
'
#materialCategoryFM
'
).
form
(
'
clear
'
);
$
(
'
#materialCategoryDlg
'
).
dialog
(
'
open
'
).
dialog
(
'
setTitle
'
,
'
<img src="/js/easyui-1.3.5/themes/icons/edit_add.png"/> 增加商品类别信息
'
);
$
(
"
.window-mask
"
).
css
({
width
:
webW
,
height
:
webH
});
$
(
"
#Name
"
).
val
(
""
).
focus
();
orgMaterialCategory
=
""
;
materialCategoryID
=
0
;
url
=
'
/materialCategory/add
'
;
}
//保存信息
//保存信息
$
(
"
#saveMaterialCategory
"
).
off
(
"
click
"
).
on
(
"
click
"
,
function
()
{
$
(
"
#saveMaterialCategory
"
).
off
(
"
click
"
).
on
(
"
click
"
,
function
()
{
var
parent
=
1
;
if
(
!
$
(
"
#Name
"
).
val
())
{
if
(
$
(
"
#ParentId_f
"
).
val
()
!=
""
&&
$
(
"
#ParentId_f
"
).
val
()
!=
null
)
{
$
.
messager
.
alert
(
'
提示
'
,
'
商品类别名称不能为空!
'
,
'
warning
'
);
parent
=
$
(
"
#ParentId_f
"
).
val
();
return
;
}
if
(
$
(
"
#ParentId_s
"
).
val
()
!=
""
&&
$
(
"
#ParentId_s
"
).
val
()
!=
null
)
{
parent
=
$
(
"
#ParentId_s
"
).
val
();
}
}
var
objInfo
=
$
(
"
#materialCategoryFM
"
).
serializeObject
();
$
.
ajax
({
$
.
ajax
({
type
:
"
post
"
,
type
:
"
post
"
,
url
:
url
,
url
:
url
,
dataType
:
"
json
"
,
dataType
:
"
json
"
,
data
:
({
data
:
({
info
:
JSON
.
stringify
({
info
:
JSON
.
stringify
(
objInfo
)
ParentId
:
parent
,
CategoryLevel
:
$
(
"
#CategoryLevel
"
).
val
(),
Name
:
$
.
trim
(
$
(
"
#Name
"
).
val
())
})
}),
}),
success
:
function
(
res
)
{
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
)
{
if
(
res
)
{
if
(
res
.
code
!=
200
){
$
.
messager
.
alert
(
'
提示
'
,
res
.
msg
,
'
error
'
);
return
;
}
$
(
'
#materialCategoryDlg
'
).
dialog
(
'
close
'
);
$
(
'
#materialCategoryDlg
'
).
dialog
(
'
close
'
);
//加载完以后重新初始化
//加载完以后重新初始化
var
opts
=
$
(
"
#tableData
"
).
datagrid
(
'
options
'
);
$
(
'
#tt
'
).
tree
(
'
reload
'
);
showMaterialCategoryDetails
(
opts
.
pageNumber
,
opts
.
pageSize
);
}
}
},
},
//此处添加错误处理
//此处添加错误处理
...
@@ -434,88 +241,26 @@
...
@@ -434,88 +241,26 @@
}
}
});
});
});
});
$
(
'
#btnSetFunctions
'
).
click
(
function
()
{
//编辑信息
var
currentRow
=
$
(
"
#tableData
"
).
datagrid
(
"
getSelected
"
);
function
editMaterialCategory
(
materialCategoryTotalInfo
)
{
if
(
currentRow
==
null
)
{
var
materialCategoryInfo
=
materialCategoryTotalInfo
.
split
(
"
AaBb
"
);
$
.
messager
.
alert
(
'
提示
'
,
"
请选择一条数据再操作!
"
,
'
warning
'
);
return
false
;
$
(
"
#ParentId
"
).
focus
().
val
(
materialCategoryInfo
[
1
]);
$
(
"
#CategoryLevel
"
).
val
(
materialCategoryInfo
[
2
]);
$
(
"
#Name
"
).
val
(
materialCategoryInfo
[
3
]);
//orgMaterialCategory = materialCategoryInfo[1];
$
(
'
#materialCategoryDlg
'
).
dialog
(
'
open
'
).
dialog
(
'
setTitle
'
,
'
<img src="/js/easyui-1.3.5/themes/icons/pencil.png"/> 编辑商品类别信息
'
);
$
(
"
.window-mask
"
).
css
({
width
:
webW
,
height
:
webH
});
materialCategoryID
=
materialCategoryInfo
[
0
];
//焦点在名称输入框==定焦在输入文字后面
$
(
"
#Name
"
).
val
(
""
).
focus
().
val
(
materialCategoryInfo
[
3
]);
url
=
'
/materialCategory/update?id=
'
+
materialCategoryInfo
[
0
];
}
//搜索处理
$
(
"
#searchBtn
"
).
unbind
().
bind
({
click
:
function
()
{
showMaterialCategoryDetails
(
1
,
initPageSize
);
var
opts
=
$
(
"
#tableData
"
).
datagrid
(
'
options
'
);
var
pager
=
$
(
"
#tableData
"
).
datagrid
(
'
getPager
'
);
opts
.
pageNumber
=
1
;
opts
.
pageSize
=
initPageSize
;
pager
.
pagination
(
'
refresh
'
,
{
pageNumber
:
1
,
pageSize
:
initPageSize
});
}
}
this
.
href
=
"
/pages/manage/roleFunctions.html?id=
"
+
currentRow
.
id
;
});
});
//查询父级商品类别
$
(
"
#lookForSelectMaterialCategory
"
).
on
(
"
click
"
,
function
()
{
function
showMaterialCategoryDetails
(
pageNo
,
pageSize
)
{
$
(
'
#forSelectMaterialCategoryDlg
'
).
dialog
({
var
parent
=
1
;
title
:
'
商品类别选择
'
,
if
(
$
(
"
#searchParentId_f
"
).
val
()
!=
""
&&
$
(
"
#searchParentId_f
"
).
val
()
!=
null
)
{
width
:
webW
/
2
,
parent
=
$
(
"
#searchParentId_f
"
).
val
();
height
:
webH
/
2
,
}
closed
:
false
,
if
(
$
(
"
#searchParentId_s
"
).
val
()
!=
""
&&
$
(
"
#searchParentId_s
"
).
val
()
!=
null
)
{
cache
:
false
,
parent
=
$
(
"
#searchParentId_s
"
).
val
();
href
:
'
/pages/materials/materialcategory_forselect.html
'
,
}
modal
:
true
,
if
(
$
(
"
#searchParentId_t
"
).
val
()
!=
""
&&
$
(
"
#searchParentId_t
"
).
val
()
!=
null
)
{
resizable
:
true
parent
=
$
(
"
#searchParentId_t
"
).
val
();
}
$
.
ajax
({
type
:
"
get
"
,
url
:
"
/materialCategory/list
"
,
dataType
:
"
json
"
,
data
:
({
search
:
JSON
.
stringify
({
name
:
$
.
trim
(
$
(
"
#searchName
"
).
val
()),
parentId
:
parent
,
}),
currentPage
:
pageNo
,
pageSize
:
pageSize
}),
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
){
if
(
res
.
data
&&
res
.
data
.
page
)
{
$
(
"
#tableData
"
).
datagrid
(
'
loadData
'
,
res
.
data
.
page
);
}
}
},
//此处添加错误处理
error
:
function
()
{
$
.
messager
.
alert
(
'
查询提示
'
,
'
查询数据后台异常,请稍后再试!
'
,
'
error
'
);
return
;
}
});
});
}
//重置按钮
$
(
"
#searchResetBtn
"
).
unbind
().
bind
({
click
:
function
()
{
$
(
"
#searchParentId_f
"
).
val
(
""
);
$
(
"
#searchParentId_s
"
).
val
(
""
);
$
(
"
#searchParentId_t
"
).
val
(
""
);
//加载完以后重新初始化
$
(
"
#searchBtn
"
).
click
();
}
});
});
</script>
</script>
...
...
erp_web/pages/materials/materialcategory_forselect.html
0 → 100644
View file @
6bbc0aef
<!DOCTYPE html>
<html>
<head>
<title>
商品类别选择
</title>
<meta
charset=
"utf-8"
>
<!-- 指定以IE8的方式来渲染 -->
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=EmulateIE8"
/>
<link
rel=
"shortcut icon"
href=
"/images/favicon.ico"
type=
"image/x-icon"
/>
<script
type=
"text/javascript"
src=
"/js/jquery-1.8.0.min.js"
></script>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/js/easyui-1.3.5/themes/default/easyui.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/js/easyui-1.3.5/themes/icon.css"
/>
<link
type=
"text/css"
rel=
"stylesheet"
href=
"/css/common.css"
/>
<script
type=
"text/javascript"
src=
"/js/easyui-1.3.5/jquery.easyui.min.js"
></script>
<script
type=
"text/javascript"
src=
"/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"
></script>
<script
type=
"text/javascript"
src=
"/js/common/common.js"
></script>
</head>
<body>
<!-- 数据显示table -->
<div>
<ul
id=
"ttForSelect"
></ul>
</div>
<script
type=
"text/javascript"
>
$
(
function
()
{
$
(
'
#ttForSelect
'
).
tree
({
url
:
'
/materialCategory/getMaterialCategoryTree
'
,
animate
:
true
,
onDblClick
:
function
(
node
)
{
//双击修改
forSelectMaterialCategory
(
node
);
}
});
function
forSelectMaterialCategory
(
node
)
{
console
.
log
(
node
);
$
(
"
#parentName
"
).
val
(
node
.
text
);
$
(
"
#parentid
"
).
val
(
node
.
id
);
$
(
'
#forSelectMaterialCategoryDlg
'
).
dialog
(
'
close
'
);
}
});
</script>
</body>
</html>
\ No newline at end of file
sql/jsh_erp.sql
View file @
6bbc0aef
...
@@ -5291,3 +5291,51 @@ end;
...
@@ -5291,3 +5291,51 @@ end;
//
//
DELIMITER ;
DELIMITER ;
-- ----------------------------
-- 时间:2019年2月18日
-- version:1.0.3
-- 此次更新修改产品类型表jsh_materialcategory,添加一些字段
-- 特别提醒:之后的sql都是在之前基础上迭代,可以对已存在的系统进行数据保留更新
-- ----------------------------
-- ----------------------------
-- 产品类型表添加字段sort,显示顺序
-- ----------------------------
alter table jsh_materialcategory add sort varchar(10) DEFAULT null COMMENT '显示顺序';
-- ----------------------------
-- 产品类型表添加字段status,状态,0系统默认,1启用,2删除
-- ----------------------------
alter table jsh_materialcategory add status varchar(1) DEFAULT '0' COMMENT '状态,0系统默认,1启用,2删除';
-- ----------------------------
-- 产品类型表添加字段serial_no,编号
-- ----------------------------
alter table jsh_materialcategory add serial_no varchar(100) DEFAULT null COMMENT '编号';
-- ----------------------------
-- 产品类型表添加字段remark,备注
-- ----------------------------
alter table jsh_materialcategory add remark varchar(1024) DEFAULT null COMMENT '备注';
-- ----------------------------
-- 产品类型表添加字段create_time,创建时间
-- ----------------------------
alter table jsh_materialcategory add create_time datetime DEFAULT null COMMENT '创建时间';
-- ----------------------------
-- 产品类型表添加字段creator,创建人
-- ----------------------------
alter table jsh_materialcategory add creator bigint(20) DEFAULT null COMMENT '创建人';
-- ----------------------------
-- 产品类型表添加字段update_time,更新时间
-- ----------------------------
alter table jsh_materialcategory add update_time datetime DEFAULT null COMMENT '更新时间';
-- ----------------------------
-- 产品类型表添加字段updater,更新人
-- ----------------------------
alter table jsh_materialcategory add updater bigint(20) DEFAULT null COMMENT '更新人';
-- ----------------------------
-- 去掉jsh_materialcategory外键
-- ----------------------------
ALTER TABLE jsh_materialcategory DROP FOREIGN KEY FK3EE7F725237A77D8;
-- ----------------------------
-- 修改根目录父节点id为-1
-- ----------------------------
update jsh_materialcategory set ParentId='-1' where id='1'
sql/华夏ERP数据库设计汇总.xlsx
View file @
6bbc0aef
No preview for this file type
src/main/java/com/jsh/erp/constants/BusinessConstants.java
View file @
6bbc0aef
...
@@ -70,6 +70,19 @@ public class BusinessConstants {
...
@@ -70,6 +70,19 @@ public class BusinessConstants {
public
static
final
String
SEQ_TO_STRING_LESS_INSERT
=
"0"
;
public
static
final
String
SEQ_TO_STRING_LESS_INSERT
=
"0"
;
//单据编号
//单据编号
public
static
final
String
DEPOT_NUMBER_SEQ
=
"depot_number_seq"
;
public
static
final
String
DEPOT_NUMBER_SEQ
=
"depot_number_seq"
;
/**
* 商品类别根目录id
* */
public
static
final
Long
MATERIAL_CATEGORY_ROOT_ID
=
1L
;
/**
* 商品类别状态
* 0系统默认,1启用,2删除
* */
public
static
final
String
MATERIAL_CATEGORY_STATUS_DEFAULT
=
"0"
;
public
static
final
String
MATERIAL_CATEGORY_STATUS_ENABLE
=
"1"
;
public
static
final
String
MATERIAL_CATEGORY_STATUS_DELETE
=
"2"
;
...
...
src/main/java/com/jsh/erp/constants/ExceptionConstants.java
View file @
6bbc0aef
...
@@ -59,6 +59,19 @@ public class ExceptionConstants {
...
@@ -59,6 +59,19 @@ public class ExceptionConstants {
//商品库存不足
//商品库存不足
public
static
final
int
MATERIAL_STOCK_NOT_ENOUGH_CODE
=
8000004
;
public
static
final
int
MATERIAL_STOCK_NOT_ENOUGH_CODE
=
8000004
;
public
static
final
String
MATERIAL_STOCK_NOT_ENOUGH_MSG
=
"商品:%s库存不足"
;
public
static
final
String
MATERIAL_STOCK_NOT_ENOUGH_MSG
=
"商品:%s库存不足"
;
/**
* 商品类别信息
* type = 75
* */
//添加商品类别信息失败
public
static
final
int
MATERIAL_CATEGORY_ADD_FAILED_CODE
=
7500000
;
public
static
final
String
MATERIAL_CATEGORY_ADD_FAILED_MSG
=
"添加商品类别信息失败"
;
//删除商品类别信息失败
public
static
final
int
MATERIAL_CATEGORY_DELETE_FAILED_CODE
=
7500001
;
public
static
final
String
MATERIAL_CATEGORY_DELETE_FAILED_MSG
=
"删除商品类别信息失败"
;
//修改商品类别信息失败
public
static
final
int
MATERIAL_CATEGORY_EDIT_FAILED_CODE
=
7500002
;
public
static
final
String
MATERIAL_CATEGORY_EDIT_FAILED_MSG
=
"添加商品类别信息失败"
;
/**
/**
* 标准正常返回/操作成功返回
* 标准正常返回/操作成功返回
...
...
src/main/java/com/jsh/erp/controller/MaterialCategoryController.java
View file @
6bbc0aef
package
com.jsh.erp.controller
;
package
com.jsh.erp.controller
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONArray
;
import
com.jsh.erp.datasource.entities.MaterialCategory
;
import
com.alibaba.fastjson.JSONObject
;
import
com.jsh.erp.service.materialCategory.MaterialCategoryService
;
import
com.google.gson.JsonObject
;
import
com.jsh.erp.utils.BaseResponseInfo
;
import
com.jsh.erp.constants.ExceptionConstants
;
import
org.slf4j.Logger
;
import
com.jsh.erp.datasource.entities.MaterialCategory
;
import
org.slf4j.LoggerFactory
;
import
com.jsh.erp.datasource.entities.SerialNumberEx
;
import
org.springframework.web.bind.annotation.*
;
import
com.jsh.erp.datasource.vo.TreeNode
;
import
com.jsh.erp.exception.BusinessRunTimeException
;
import
javax.annotation.Resource
;
import
com.jsh.erp.service.materialCategory.MaterialCategoryService
;
import
javax.servlet.http.HttpServletRequest
;
import
com.jsh.erp.utils.BaseResponseInfo
;
import
java.util.List
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
/**
import
org.springframework.web.bind.annotation.GetMapping
;
* @author ji—sheng—hua 华夏ERP
import
org.springframework.web.bind.annotation.RequestMapping
;
*/
import
org.springframework.web.bind.annotation.RequestParam
;
@RestController
import
org.springframework.web.bind.annotation.RestController
;
@RequestMapping
(
value
=
"/materialCategory"
)
public
class
MaterialCategoryController
{
import
javax.annotation.Resource
;
private
Logger
logger
=
LoggerFactory
.
getLogger
(
MaterialCategoryController
.
class
);
import
javax.servlet.http.HttpServletRequest
;
import
java.util.List
;
@Resource
private
MaterialCategoryService
materialCategoryService
;
/**
* @author ji—sheng—hua 华夏ERP
@GetMapping
(
value
=
"/getAllList"
)
*/
public
BaseResponseInfo
getAllList
(
@RequestParam
(
"parentId"
)
Long
parentId
,
HttpServletRequest
request
)
{
@RestController
BaseResponseInfo
res
=
new
BaseResponseInfo
();
@RequestMapping
(
value
=
"/materialCategory"
)
try
{
public
class
MaterialCategoryController
{
List
<
MaterialCategory
>
materialCategoryList
=
materialCategoryService
.
getAllList
(
parentId
);
private
Logger
logger
=
LoggerFactory
.
getLogger
(
MaterialCategoryController
.
class
);
res
.
code
=
200
;
res
.
data
=
materialCategoryList
;
@Resource
}
catch
(
Exception
e
){
private
MaterialCategoryService
materialCategoryService
;
e
.
printStackTrace
();
res
.
code
=
500
;
@GetMapping
(
value
=
"/getAllList"
)
res
.
data
=
"获取数据失败"
;
public
BaseResponseInfo
getAllList
(
@RequestParam
(
"parentId"
)
Long
parentId
,
HttpServletRequest
request
)
{
}
BaseResponseInfo
res
=
new
BaseResponseInfo
();
return
res
;
try
{
}
List
<
MaterialCategory
>
materialCategoryList
=
materialCategoryService
.
getAllList
(
parentId
);
res
.
code
=
200
;
/**
res
.
data
=
materialCategoryList
;
* 根据id来查询商品名称
}
catch
(
Exception
e
){
* @param id
e
.
printStackTrace
();
* @param request
res
.
code
=
500
;
* @return
res
.
data
=
"获取数据失败"
;
*/
}
@GetMapping
(
value
=
"/findById"
)
return
res
;
public
BaseResponseInfo
findById
(
@RequestParam
(
"id"
)
Long
id
,
HttpServletRequest
request
)
{
}
BaseResponseInfo
res
=
new
BaseResponseInfo
();
try
{
/**
List
<
MaterialCategory
>
dataList
=
materialCategoryService
.
findById
(
id
);
* 根据id来查询商品名称
JSONObject
outer
=
new
JSONObject
();
* @param id
if
(
null
!=
dataList
)
{
* @param request
for
(
MaterialCategory
mc
:
dataList
)
{
* @return
outer
.
put
(
"name"
,
mc
.
getName
());
*/
outer
.
put
(
"parentId"
,
mc
.
getParentid
());
@RequestMapping
(
value
=
"/findById"
)
}
public
BaseResponseInfo
findById
(
@RequestParam
(
"id"
)
Long
id
,
HttpServletRequest
request
)
{
}
BaseResponseInfo
res
=
new
BaseResponseInfo
();
res
.
code
=
200
;
try
{
res
.
data
=
outer
;
List
<
MaterialCategory
>
dataList
=
materialCategoryService
.
findById
(
id
);
}
catch
(
Exception
e
){
JSONObject
outer
=
new
JSONObject
();
e
.
printStackTrace
();
if
(
null
!=
dataList
)
{
res
.
code
=
500
;
for
(
MaterialCategory
mc
:
dataList
)
{
res
.
data
=
"获取数据失败"
;
outer
.
put
(
"id"
,
mc
.
getId
());
}
outer
.
put
(
"name"
,
mc
.
getName
());
return
res
;
outer
.
put
(
"parentId"
,
mc
.
getParentid
());
}
List
<
MaterialCategory
>
dataParentList
=
materialCategoryService
.
findById
(
mc
.
getParentid
());
}
if
(
dataParentList
!=
null
&&
dataParentList
.
size
()>
0
){
outer
.
put
(
"parentName"
,
dataParentList
.
get
(
0
).
getName
());
}
outer
.
put
(
"sort"
,
mc
.
getSort
());
outer
.
put
(
"serialNo"
,
mc
.
getSerialNo
());
outer
.
put
(
"remark"
,
mc
.
getRemark
());
}
}
res
.
code
=
200
;
res
.
data
=
outer
;
}
catch
(
Exception
e
){
e
.
printStackTrace
();
res
.
code
=
500
;
res
.
data
=
"获取数据失败"
;
}
return
res
;
}
/**
* create by: cjl
* description:
* 获取商品类别树数据
* create time: 2019/2/19 11:49
* @Param:
* @return com.alibaba.fastjson.JSONArray
*/
@RequestMapping
(
value
=
"/getMaterialCategoryTree"
)
public
JSONArray
getMaterialCategoryTree
()
throws
Exception
{
JSONArray
arr
=
new
JSONArray
();
List
<
TreeNode
>
materialCategoryTree
=
materialCategoryService
.
getMaterialCategoryTree
();
if
(
materialCategoryTree
!=
null
&&
materialCategoryTree
.
size
()>
0
){
for
(
TreeNode
node:
materialCategoryTree
){
String
str
=
JSON
.
toJSONString
(
node
);
JSONObject
obj
=
JSON
.
parseObject
(
str
);
arr
.
add
(
obj
)
;
}
}
return
arr
;
}
/**
* create by: cjl
* description:
* 新增商品类别数据
* create time: 2019/2/19 17:17
* @Param: beanJson
* @return java.lang.Object
*/
@RequestMapping
(
value
=
"/addMaterialCategory"
)
public
Object
addMaterialCategory
(
@RequestParam
(
"info"
)
String
beanJson
)
throws
Exception
{
JSONObject
result
=
ExceptionConstants
.
standardSuccess
();
MaterialCategory
mc
=
JSON
.
parseObject
(
beanJson
,
MaterialCategory
.
class
);
int
i
=
materialCategoryService
.
addMaterialCategory
(
mc
);
if
(
i
<
1
){
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
MATERIAL_CATEGORY_ADD_FAILED_CODE
,
ExceptionConstants
.
MATERIAL_CATEGORY_ADD_FAILED_MSG
);
}
return
result
;
}
/**
* create by: cjl
* description:
* 修改商品类别数据
* create time: 2019/2/20 9:30
* @Param: beanJson
* @return java.lang.Object
*/
@RequestMapping
(
value
=
"/editMaterialCategory"
)
public
Object
editMaterialCategory
(
@RequestParam
(
"info"
)
String
beanJson
)
throws
Exception
{
JSONObject
result
=
ExceptionConstants
.
standardSuccess
();
MaterialCategory
mc
=
JSON
.
parseObject
(
beanJson
,
MaterialCategory
.
class
);
int
i
=
materialCategoryService
.
editMaterialCategory
(
mc
);
if
(
i
<
1
){
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
MATERIAL_CATEGORY_ADD_FAILED_CODE
,
ExceptionConstants
.
MATERIAL_CATEGORY_ADD_FAILED_MSG
);
}
return
result
;
}
/**
* create by: cjl
* description:
* 批量删除商品类别信息
* create time: 2019/2/19 17:26
* @Param: ids
* @return java.lang.Object
*/
@RequestMapping
(
value
=
"/batchDeleteMaterialCategory"
)
public
Object
batchDeleteMaterialCategory
(
@RequestParam
(
"ids"
)
String
ids
)
throws
Exception
{
JSONObject
result
=
ExceptionConstants
.
standardSuccess
();
int
i
=
materialCategoryService
.
batchDeleteMaterialCategoryByIds
(
ids
);
if
(
i
<
1
){
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
MATERIAL_CATEGORY_DELETE_FAILED_CODE
,
ExceptionConstants
.
MATERIAL_CATEGORY_DELETE_FAILED_MSG
);
}
return
result
;
}
}
src/main/java/com/jsh/erp/datasource/entities/MaterialCategory.java
View file @
6bbc0aef
package
com.jsh.erp.datasource.entities
;
package
com.jsh.erp.datasource.entities
;
public
class
MaterialCategory
{
import
java.util.Date
;
/**
* This field was generated by MyBatis Generator.
public
class
MaterialCategory
{
* This field corresponds to the database column jsh_materialcategory.Id
/**
*
* This field was generated by MyBatis Generator.
* @mbggenerated
* This field corresponds to the database column jsh_materialcategory.Id
*/
*
private
Long
id
;
* @mbggenerated
*/
/**
private
Long
id
;
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_materialcategory.Name
/**
*
* This field was generated by MyBatis Generator.
* @mbggenerated
* This field corresponds to the database column jsh_materialcategory.Name
*/
*
private
String
name
;
* @mbggenerated
*/
/**
private
String
name
;
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_materialcategory.CategoryLevel
/**
*
* This field was generated by MyBatis Generator.
* @mbggenerated
* This field corresponds to the database column jsh_materialcategory.CategoryLevel
*/
*
private
Short
categorylevel
;
* @mbggenerated
*/
/**
private
Short
categorylevel
;
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_materialcategory.ParentId
/**
*
* This field was generated by MyBatis Generator.
* @mbggenerated
* This field corresponds to the database column jsh_materialcategory.ParentId
*/
*
private
Long
parentid
;
* @mbggenerated
*/
/**
private
Long
parentid
;
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_materialcategory.Id
/**
*
* This field was generated by MyBatis Generator.
* @return the value of jsh_materialcategory.Id
* This field corresponds to the database column jsh_materialcategory.sort
*
*
* @mbggenerated
* @mbggenerated
*/
*/
public
Long
getId
()
{
private
String
sort
;
return
id
;
}
/**
* This field was generated by MyBatis Generator.
/**
* This field corresponds to the database column jsh_materialcategory.status
* This method was generated by MyBatis Generator.
*
* This method sets the value of the database column jsh_materialcategory.Id
* @mbggenerated
*
*/
* @param id the value for jsh_materialcategory.Id
private
String
status
;
*
* @mbggenerated
/**
*/
* This field was generated by MyBatis Generator.
public
void
setId
(
Long
id
)
{
* This field corresponds to the database column jsh_materialcategory.serial_no
this
.
id
=
id
;
*
}
* @mbggenerated
*/
/**
private
String
serialNo
;
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_materialcategory.Name
/**
*
* This field was generated by MyBatis Generator.
* @return the value of jsh_materialcategory.Name
* This field corresponds to the database column jsh_materialcategory.remark
*
*
* @mbggenerated
* @mbggenerated
*/
*/
public
String
getName
()
{
private
String
remark
;
return
name
;
}
/**
* This field was generated by MyBatis Generator.
/**
* This field corresponds to the database column jsh_materialcategory.create_time
* This method was generated by MyBatis Generator.
*
* This method sets the value of the database column jsh_materialcategory.Name
* @mbggenerated
*
*/
* @param name the value for jsh_materialcategory.Name
private
Date
createTime
;
*
* @mbggenerated
/**
*/
* This field was generated by MyBatis Generator.
public
void
setName
(
String
name
)
{
* This field corresponds to the database column jsh_materialcategory.creator
this
.
name
=
name
==
null
?
null
:
name
.
trim
();
*
}
* @mbggenerated
*/
/**
private
Long
creator
;
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_materialcategory.CategoryLevel
/**
*
* This field was generated by MyBatis Generator.
* @return the value of jsh_materialcategory.CategoryLevel
* This field corresponds to the database column jsh_materialcategory.update_time
*
*
* @mbggenerated
* @mbggenerated
*/
*/
public
Short
getCategorylevel
()
{
private
Date
updateTime
;
return
categorylevel
;
}
/**
* This field was generated by MyBatis Generator.
/**
* This field corresponds to the database column jsh_materialcategory.updater
* This method was generated by MyBatis Generator.
*
* This method sets the value of the database column jsh_materialcategory.CategoryLevel
* @mbggenerated
*
*/
* @param categorylevel the value for jsh_materialcategory.CategoryLevel
private
Long
updater
;
*
* @mbggenerated
/**
*/
* This method was generated by MyBatis Generator.
public
void
setCategorylevel
(
Short
categorylevel
)
{
* This method returns the value of the database column jsh_materialcategory.Id
this
.
categorylevel
=
categorylevel
;
*
}
* @return the value of jsh_materialcategory.Id
*
/**
* @mbggenerated
* This method was generated by MyBatis Generator.
*/
* This method returns the value of the database column jsh_materialcategory.ParentId
public
Long
getId
()
{
*
return
id
;
* @return the value of jsh_materialcategory.ParentId
}
*
* @mbggenerated
/**
*/
* This method was generated by MyBatis Generator.
public
Long
getParentid
()
{
* This method sets the value of the database column jsh_materialcategory.Id
return
parentid
;
*
}
* @param id the value for jsh_materialcategory.Id
*
/**
* @mbggenerated
* This method was generated by MyBatis Generator.
*/
* This method sets the value of the database column jsh_materialcategory.ParentId
public
void
setId
(
Long
id
)
{
*
this
.
id
=
id
;
* @param parentid the value for jsh_materialcategory.ParentId
}
*
* @mbggenerated
/**
*/
* This method was generated by MyBatis Generator.
public
void
setParentid
(
Long
parentid
)
{
* This method returns the value of the database column jsh_materialcategory.Name
this
.
parentid
=
parentid
;
*
}
* @return the value of jsh_materialcategory.Name
*
* @mbggenerated
*/
public
String
getName
()
{
return
name
;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_materialcategory.Name
*
* @param name the value for jsh_materialcategory.Name
*
* @mbggenerated
*/
public
void
setName
(
String
name
)
{
this
.
name
=
name
==
null
?
null
:
name
.
trim
();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_materialcategory.CategoryLevel
*
* @return the value of jsh_materialcategory.CategoryLevel
*
* @mbggenerated
*/
public
Short
getCategorylevel
()
{
return
categorylevel
;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_materialcategory.CategoryLevel
*
* @param categorylevel the value for jsh_materialcategory.CategoryLevel
*
* @mbggenerated
*/
public
void
setCategorylevel
(
Short
categorylevel
)
{
this
.
categorylevel
=
categorylevel
;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_materialcategory.ParentId
*
* @return the value of jsh_materialcategory.ParentId
*
* @mbggenerated
*/
public
Long
getParentid
()
{
return
parentid
;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_materialcategory.ParentId
*
* @param parentid the value for jsh_materialcategory.ParentId
*
* @mbggenerated
*/
public
void
setParentid
(
Long
parentid
)
{
this
.
parentid
=
parentid
;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_materialcategory.sort
*
* @return the value of jsh_materialcategory.sort
*
* @mbggenerated
*/
public
String
getSort
()
{
return
sort
;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_materialcategory.sort
*
* @param sort the value for jsh_materialcategory.sort
*
* @mbggenerated
*/
public
void
setSort
(
String
sort
)
{
this
.
sort
=
sort
==
null
?
null
:
sort
.
trim
();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_materialcategory.status
*
* @return the value of jsh_materialcategory.status
*
* @mbggenerated
*/
public
String
getStatus
()
{
return
status
;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_materialcategory.status
*
* @param status the value for jsh_materialcategory.status
*
* @mbggenerated
*/
public
void
setStatus
(
String
status
)
{
this
.
status
=
status
==
null
?
null
:
status
.
trim
();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_materialcategory.serial_no
*
* @return the value of jsh_materialcategory.serial_no
*
* @mbggenerated
*/
public
String
getSerialNo
()
{
return
serialNo
;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_materialcategory.serial_no
*
* @param serialNo the value for jsh_materialcategory.serial_no
*
* @mbggenerated
*/
public
void
setSerialNo
(
String
serialNo
)
{
this
.
serialNo
=
serialNo
==
null
?
null
:
serialNo
.
trim
();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_materialcategory.remark
*
* @return the value of jsh_materialcategory.remark
*
* @mbggenerated
*/
public
String
getRemark
()
{
return
remark
;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_materialcategory.remark
*
* @param remark the value for jsh_materialcategory.remark
*
* @mbggenerated
*/
public
void
setRemark
(
String
remark
)
{
this
.
remark
=
remark
==
null
?
null
:
remark
.
trim
();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_materialcategory.create_time
*
* @return the value of jsh_materialcategory.create_time
*
* @mbggenerated
*/
public
Date
getCreateTime
()
{
return
createTime
;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_materialcategory.create_time
*
* @param createTime the value for jsh_materialcategory.create_time
*
* @mbggenerated
*/
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_materialcategory.creator
*
* @return the value of jsh_materialcategory.creator
*
* @mbggenerated
*/
public
Long
getCreator
()
{
return
creator
;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_materialcategory.creator
*
* @param creator the value for jsh_materialcategory.creator
*
* @mbggenerated
*/
public
void
setCreator
(
Long
creator
)
{
this
.
creator
=
creator
;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_materialcategory.update_time
*
* @return the value of jsh_materialcategory.update_time
*
* @mbggenerated
*/
public
Date
getUpdateTime
()
{
return
updateTime
;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_materialcategory.update_time
*
* @param updateTime the value for jsh_materialcategory.update_time
*
* @mbggenerated
*/
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_materialcategory.updater
*
* @return the value of jsh_materialcategory.updater
*
* @mbggenerated
*/
public
Long
getUpdater
()
{
return
updater
;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_materialcategory.updater
*
* @param updater the value for jsh_materialcategory.updater
*
* @mbggenerated
*/
public
void
setUpdater
(
Long
updater
)
{
this
.
updater
=
updater
;
}
}
}
\ No newline at end of file
src/main/java/com/jsh/erp/datasource/entities/MaterialCategoryExample.java
View file @
6bbc0aef
package
com.jsh.erp.datasource.entities
;
package
com.jsh.erp.datasource.entities
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Date
;
import
java.util.List
;
public
class
MaterialCategoryExample
{
/**
public
class
MaterialCategoryExample
{
* This field was generated by MyBatis Generator.
/**
* This field corresponds to the database table jsh_materialcategory
* This field was generated by MyBatis Generator.
*
* This field corresponds to the database table jsh_materialcategory
* @mbggenerated
*
*/
* @mbggenerated
protected
String
orderByClause
;
*/
protected
String
orderByClause
;
/**
* This field was generated by MyBatis Generator.
/**
* This field corresponds to the database table jsh_materialcategory
* This field was generated by MyBatis Generator.
*
* This field corresponds to the database table jsh_materialcategory
* @mbggenerated
*
*/
* @mbggenerated
protected
boolean
distinct
;
*/
protected
boolean
distinct
;
/**
* This field was generated by MyBatis Generator.
/**
* This field corresponds to the database table jsh_materialcategory
* This field was generated by MyBatis Generator.
*
* This field corresponds to the database table jsh_materialcategory
* @mbggenerated
*
*/
* @mbggenerated
protected
List
<
Criteria
>
oredCriteria
;
*/
protected
List
<
Criteria
>
oredCriteria
;
/**
* This method was generated by MyBatis Generator.
/**
* This method corresponds to the database table jsh_materialcategory
* This method was generated by MyBatis Generator.
*
* This method corresponds to the database table jsh_materialcategory
* @mbggenerated
*
*/
* @mbggenerated
public
MaterialCategoryExample
()
{
*/
oredCriteria
=
new
ArrayList
<
Criteria
>();
public
MaterialCategoryExample
()
{
}
oredCriteria
=
new
ArrayList
<
Criteria
>();
}
/**
* This method was generated by MyBatis Generator.
/**
* This method corresponds to the database table jsh_materialcategory
* This method was generated by MyBatis Generator.
*
* This method corresponds to the database table jsh_materialcategory
* @mbggenerated
*
*/
* @mbggenerated
public
void
setOrderByClause
(
String
orderByClause
)
{
*/
this
.
orderByClause
=
orderByClause
;
public
void
setOrderByClause
(
String
orderByClause
)
{
}
this
.
orderByClause
=
orderByClause
;
}
/**
* This method was generated by MyBatis Generator.
/**
* This method corresponds to the database table jsh_materialcategory
* This method was generated by MyBatis Generator.
*
* This method corresponds to the database table jsh_materialcategory
* @mbggenerated
*
*/
* @mbggenerated
public
String
getOrderByClause
()
{
*/
return
orderByClause
;
public
String
getOrderByClause
()
{
}
return
orderByClause
;
}
/**
* This method was generated by MyBatis Generator.
/**
* This method corresponds to the database table jsh_materialcategory
* This method was generated by MyBatis Generator.
*
* This method corresponds to the database table jsh_materialcategory
* @mbggenerated
*
*/
* @mbggenerated
public
void
setDistinct
(
boolean
distinct
)
{
*/
this
.
distinct
=
distinct
;
public
void
setDistinct
(
boolean
distinct
)
{
}
this
.
distinct
=
distinct
;
}
/**
* This method was generated by MyBatis Generator.
/**
* This method corresponds to the database table jsh_materialcategory
* This method was generated by MyBatis Generator.
*
* This method corresponds to the database table jsh_materialcategory
* @mbggenerated
*
*/
* @mbggenerated
public
boolean
isDistinct
()
{
*/
return
distinct
;
public
boolean
isDistinct
()
{
}
return
distinct
;
}
/**
* This method was generated by MyBatis Generator.
/**
* This method corresponds to the database table jsh_materialcategory
* This method was generated by MyBatis Generator.
*
* This method corresponds to the database table jsh_materialcategory
* @mbggenerated
*
*/
* @mbggenerated
public
List
<
Criteria
>
getOredCriteria
()
{
*/
return
oredCriteria
;
public
List
<
Criteria
>
getOredCriteria
()
{
}
return
oredCriteria
;
}
/**
* This method was generated by MyBatis Generator.
/**
* This method corresponds to the database table jsh_materialcategory
* This method was generated by MyBatis Generator.
*
* This method corresponds to the database table jsh_materialcategory
* @mbggenerated
*
*/
* @mbggenerated
public
void
or
(
Criteria
criteria
)
{
*/
oredCriteria
.
add
(
criteria
);
public
void
or
(
Criteria
criteria
)
{
}
oredCriteria
.
add
(
criteria
);
}
/**
* This method was generated by MyBatis Generator.
/**
* This method corresponds to the database table jsh_materialcategory
* This method was generated by MyBatis Generator.
*
* This method corresponds to the database table jsh_materialcategory
* @mbggenerated
*
*/
* @mbggenerated
public
Criteria
or
()
{
*/
Criteria
criteria
=
createCriteriaInternal
();
public
Criteria
or
()
{
oredCriteria
.
add
(
criteria
);
Criteria
criteria
=
createCriteriaInternal
();
return
criteria
;
oredCriteria
.
add
(
criteria
);
}
return
criteria
;
}
/**
* This method was generated by MyBatis Generator.
/**
* This method corresponds to the database table jsh_materialcategory
* This method was generated by MyBatis Generator.
*
* This method corresponds to the database table jsh_materialcategory
* @mbggenerated
*
*/
* @mbggenerated
public
Criteria
createCriteria
()
{
*/
Criteria
criteria
=
createCriteriaInternal
();
public
Criteria
createCriteria
()
{
if
(
oredCriteria
.
size
()
==
0
)
{
Criteria
criteria
=
createCriteriaInternal
();
oredCriteria
.
add
(
criteria
);
if
(
oredCriteria
.
size
()
==
0
)
{
}
oredCriteria
.
add
(
criteria
);
return
criteria
;
}
}
return
criteria
;
}
/**
* This method was generated by MyBatis Generator.
/**
* This method corresponds to the database table jsh_materialcategory
* This method was generated by MyBatis Generator.
*
* This method corresponds to the database table jsh_materialcategory
* @mbggenerated
*
*/
* @mbggenerated
protected
Criteria
createCriteriaInternal
()
{
*/
Criteria
criteria
=
new
Criteria
();
protected
Criteria
createCriteriaInternal
()
{
return
criteria
;
Criteria
criteria
=
new
Criteria
();
}
return
criteria
;
}
/**
* This method was generated by MyBatis Generator.
/**
* This method corresponds to the database table jsh_materialcategory
* This method was generated by MyBatis Generator.
*
* This method corresponds to the database table jsh_materialcategory
* @mbggenerated
*
*/
* @mbggenerated
public
void
clear
()
{
*/
oredCriteria
.
clear
();
public
void
clear
()
{
orderByClause
=
null
;
oredCriteria
.
clear
();
distinct
=
false
;
orderByClause
=
null
;
}
distinct
=
false
;
}
/**
* This class was generated by MyBatis Generator.
/**
* This class corresponds to the database table jsh_materialcategory
* This class was generated by MyBatis Generator.
*
* This class corresponds to the database table jsh_materialcategory
* @mbggenerated
*
*/
* @mbggenerated
protected
abstract
static
class
GeneratedCriteria
{
*/
protected
List
<
Criterion
>
criteria
;
protected
abstract
static
class
GeneratedCriteria
{
protected
List
<
Criterion
>
criteria
;
protected
GeneratedCriteria
()
{
super
();
protected
GeneratedCriteria
()
{
criteria
=
new
ArrayList
<
Criterion
>();
super
();
}
criteria
=
new
ArrayList
<
Criterion
>();
}
public
boolean
isValid
()
{
return
criteria
.
size
()
>
0
;
public
boolean
isValid
()
{
}
return
criteria
.
size
()
>
0
;
}
public
List
<
Criterion
>
getAllCriteria
()
{
return
criteria
;
public
List
<
Criterion
>
getAllCriteria
()
{
}
return
criteria
;
}
public
List
<
Criterion
>
getCriteria
()
{
return
criteria
;
public
List
<
Criterion
>
getCriteria
()
{
}
return
criteria
;
}
protected
void
addCriterion
(
String
condition
)
{
if
(
condition
==
null
)
{
protected
void
addCriterion
(
String
condition
)
{
throw
new
RuntimeException
(
"Value for condition cannot be null"
);
if
(
condition
==
null
)
{
}
throw
new
RuntimeException
(
"Value for condition cannot be null"
);
criteria
.
add
(
new
Criterion
(
condition
));
}
}
criteria
.
add
(
new
Criterion
(
condition
));
}
protected
void
addCriterion
(
String
condition
,
Object
value
,
String
property
)
{
if
(
value
==
null
)
{
protected
void
addCriterion
(
String
condition
,
Object
value
,
String
property
)
{
throw
new
RuntimeException
(
"Value for "
+
property
+
" cannot be null"
);
if
(
value
==
null
)
{
}
throw
new
RuntimeException
(
"Value for "
+
property
+
" cannot be null"
);
criteria
.
add
(
new
Criterion
(
condition
,
value
));
}
}
criteria
.
add
(
new
Criterion
(
condition
,
value
));
}
protected
void
addCriterion
(
String
condition
,
Object
value1
,
Object
value2
,
String
property
)
{
if
(
value1
==
null
||
value2
==
null
)
{
protected
void
addCriterion
(
String
condition
,
Object
value1
,
Object
value2
,
String
property
)
{
throw
new
RuntimeException
(
"Between values for "
+
property
+
" cannot be null"
);
if
(
value1
==
null
||
value2
==
null
)
{
}
throw
new
RuntimeException
(
"Between values for "
+
property
+
" cannot be null"
);
criteria
.
add
(
new
Criterion
(
condition
,
value1
,
value2
));
}
}
criteria
.
add
(
new
Criterion
(
condition
,
value1
,
value2
));
}
public
Criteria
andIdIsNull
()
{
addCriterion
(
"Id is null"
);
public
Criteria
andIdIsNull
()
{
return
(
Criteria
)
this
;
addCriterion
(
"Id is null"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andIdIsNotNull
()
{
addCriterion
(
"Id is not null"
);
public
Criteria
andIdIsNotNull
()
{
return
(
Criteria
)
this
;
addCriterion
(
"Id is not null"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andIdEqualTo
(
Long
value
)
{
addCriterion
(
"Id ="
,
value
,
"id"
);
public
Criteria
andIdEqualTo
(
Long
value
)
{
return
(
Criteria
)
this
;
addCriterion
(
"Id ="
,
value
,
"id"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andIdNotEqualTo
(
Long
value
)
{
addCriterion
(
"Id <>"
,
value
,
"id"
);
public
Criteria
andIdNotEqualTo
(
Long
value
)
{
return
(
Criteria
)
this
;
addCriterion
(
"Id <>"
,
value
,
"id"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andIdGreaterThan
(
Long
value
)
{
addCriterion
(
"Id >"
,
value
,
"id"
);
public
Criteria
andIdGreaterThan
(
Long
value
)
{
return
(
Criteria
)
this
;
addCriterion
(
"Id >"
,
value
,
"id"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andIdGreaterThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"Id >="
,
value
,
"id"
);
public
Criteria
andIdGreaterThanOrEqualTo
(
Long
value
)
{
return
(
Criteria
)
this
;
addCriterion
(
"Id >="
,
value
,
"id"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andIdLessThan
(
Long
value
)
{
addCriterion
(
"Id <"
,
value
,
"id"
);
public
Criteria
andIdLessThan
(
Long
value
)
{
return
(
Criteria
)
this
;
addCriterion
(
"Id <"
,
value
,
"id"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andIdLessThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"Id <="
,
value
,
"id"
);
public
Criteria
andIdLessThanOrEqualTo
(
Long
value
)
{
return
(
Criteria
)
this
;
addCriterion
(
"Id <="
,
value
,
"id"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andIdIn
(
List
<
Long
>
values
)
{
addCriterion
(
"Id in"
,
values
,
"id"
);
public
Criteria
andIdIn
(
List
<
Long
>
values
)
{
return
(
Criteria
)
this
;
addCriterion
(
"Id in"
,
values
,
"id"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andIdNotIn
(
List
<
Long
>
values
)
{
addCriterion
(
"Id not in"
,
values
,
"id"
);
public
Criteria
andIdNotIn
(
List
<
Long
>
values
)
{
return
(
Criteria
)
this
;
addCriterion
(
"Id not in"
,
values
,
"id"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andIdBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"Id between"
,
value1
,
value2
,
"id"
);
public
Criteria
andIdBetween
(
Long
value1
,
Long
value2
)
{
return
(
Criteria
)
this
;
addCriterion
(
"Id between"
,
value1
,
value2
,
"id"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andIdNotBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"Id not between"
,
value1
,
value2
,
"id"
);
public
Criteria
andIdNotBetween
(
Long
value1
,
Long
value2
)
{
return
(
Criteria
)
this
;
addCriterion
(
"Id not between"
,
value1
,
value2
,
"id"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andNameIsNull
()
{
addCriterion
(
"Name is null"
);
public
Criteria
andNameIsNull
()
{
return
(
Criteria
)
this
;
addCriterion
(
"Name is null"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andNameIsNotNull
()
{
addCriterion
(
"Name is not null"
);
public
Criteria
andNameIsNotNull
()
{
return
(
Criteria
)
this
;
addCriterion
(
"Name is not null"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andNameEqualTo
(
String
value
)
{
addCriterion
(
"Name ="
,
value
,
"name"
);
public
Criteria
andNameEqualTo
(
String
value
)
{
return
(
Criteria
)
this
;
addCriterion
(
"Name ="
,
value
,
"name"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andNameNotEqualTo
(
String
value
)
{
addCriterion
(
"Name <>"
,
value
,
"name"
);
public
Criteria
andNameNotEqualTo
(
String
value
)
{
return
(
Criteria
)
this
;
addCriterion
(
"Name <>"
,
value
,
"name"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andNameGreaterThan
(
String
value
)
{
addCriterion
(
"Name >"
,
value
,
"name"
);
public
Criteria
andNameGreaterThan
(
String
value
)
{
return
(
Criteria
)
this
;
addCriterion
(
"Name >"
,
value
,
"name"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andNameGreaterThanOrEqualTo
(
String
value
)
{
addCriterion
(
"Name >="
,
value
,
"name"
);
public
Criteria
andNameGreaterThanOrEqualTo
(
String
value
)
{
return
(
Criteria
)
this
;
addCriterion
(
"Name >="
,
value
,
"name"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andNameLessThan
(
String
value
)
{
addCriterion
(
"Name <"
,
value
,
"name"
);
public
Criteria
andNameLessThan
(
String
value
)
{
return
(
Criteria
)
this
;
addCriterion
(
"Name <"
,
value
,
"name"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andNameLessThanOrEqualTo
(
String
value
)
{
addCriterion
(
"Name <="
,
value
,
"name"
);
public
Criteria
andNameLessThanOrEqualTo
(
String
value
)
{
return
(
Criteria
)
this
;
addCriterion
(
"Name <="
,
value
,
"name"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andNameLike
(
String
value
)
{
addCriterion
(
"Name like"
,
value
,
"name"
);
public
Criteria
andNameLike
(
String
value
)
{
return
(
Criteria
)
this
;
addCriterion
(
"Name like"
,
value
,
"name"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andNameNotLike
(
String
value
)
{
addCriterion
(
"Name not like"
,
value
,
"name"
);
public
Criteria
andNameNotLike
(
String
value
)
{
return
(
Criteria
)
this
;
addCriterion
(
"Name not like"
,
value
,
"name"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andNameIn
(
List
<
String
>
values
)
{
addCriterion
(
"Name in"
,
values
,
"name"
);
public
Criteria
andNameIn
(
List
<
String
>
values
)
{
return
(
Criteria
)
this
;
addCriterion
(
"Name in"
,
values
,
"name"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andNameNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"Name not in"
,
values
,
"name"
);
public
Criteria
andNameNotIn
(
List
<
String
>
values
)
{
return
(
Criteria
)
this
;
addCriterion
(
"Name not in"
,
values
,
"name"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andNameBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"Name between"
,
value1
,
value2
,
"name"
);
public
Criteria
andNameBetween
(
String
value1
,
String
value2
)
{
return
(
Criteria
)
this
;
addCriterion
(
"Name between"
,
value1
,
value2
,
"name"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andNameNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"Name not between"
,
value1
,
value2
,
"name"
);
public
Criteria
andNameNotBetween
(
String
value1
,
String
value2
)
{
return
(
Criteria
)
this
;
addCriterion
(
"Name not between"
,
value1
,
value2
,
"name"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andCategorylevelIsNull
()
{
addCriterion
(
"CategoryLevel is null"
);
public
Criteria
andCategorylevelIsNull
()
{
return
(
Criteria
)
this
;
addCriterion
(
"CategoryLevel is null"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andCategorylevelIsNotNull
()
{
addCriterion
(
"CategoryLevel is not null"
);
public
Criteria
andCategorylevelIsNotNull
()
{
return
(
Criteria
)
this
;
addCriterion
(
"CategoryLevel is not null"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andCategorylevelEqualTo
(
Short
value
)
{
addCriterion
(
"CategoryLevel ="
,
value
,
"categorylevel"
);
public
Criteria
andCategorylevelEqualTo
(
Short
value
)
{
return
(
Criteria
)
this
;
addCriterion
(
"CategoryLevel ="
,
value
,
"categorylevel"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andCategorylevelNotEqualTo
(
Short
value
)
{
addCriterion
(
"CategoryLevel <>"
,
value
,
"categorylevel"
);
public
Criteria
andCategorylevelNotEqualTo
(
Short
value
)
{
return
(
Criteria
)
this
;
addCriterion
(
"CategoryLevel <>"
,
value
,
"categorylevel"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andCategorylevelGreaterThan
(
Short
value
)
{
addCriterion
(
"CategoryLevel >"
,
value
,
"categorylevel"
);
public
Criteria
andCategorylevelGreaterThan
(
Short
value
)
{
return
(
Criteria
)
this
;
addCriterion
(
"CategoryLevel >"
,
value
,
"categorylevel"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andCategorylevelGreaterThanOrEqualTo
(
Short
value
)
{
addCriterion
(
"CategoryLevel >="
,
value
,
"categorylevel"
);
public
Criteria
andCategorylevelGreaterThanOrEqualTo
(
Short
value
)
{
return
(
Criteria
)
this
;
addCriterion
(
"CategoryLevel >="
,
value
,
"categorylevel"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andCategorylevelLessThan
(
Short
value
)
{
addCriterion
(
"CategoryLevel <"
,
value
,
"categorylevel"
);
public
Criteria
andCategorylevelLessThan
(
Short
value
)
{
return
(
Criteria
)
this
;
addCriterion
(
"CategoryLevel <"
,
value
,
"categorylevel"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andCategorylevelLessThanOrEqualTo
(
Short
value
)
{
addCriterion
(
"CategoryLevel <="
,
value
,
"categorylevel"
);
public
Criteria
andCategorylevelLessThanOrEqualTo
(
Short
value
)
{
return
(
Criteria
)
this
;
addCriterion
(
"CategoryLevel <="
,
value
,
"categorylevel"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andCategorylevelIn
(
List
<
Short
>
values
)
{
addCriterion
(
"CategoryLevel in"
,
values
,
"categorylevel"
);
public
Criteria
andCategorylevelIn
(
List
<
Short
>
values
)
{
return
(
Criteria
)
this
;
addCriterion
(
"CategoryLevel in"
,
values
,
"categorylevel"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andCategorylevelNotIn
(
List
<
Short
>
values
)
{
addCriterion
(
"CategoryLevel not in"
,
values
,
"categorylevel"
);
public
Criteria
andCategorylevelNotIn
(
List
<
Short
>
values
)
{
return
(
Criteria
)
this
;
addCriterion
(
"CategoryLevel not in"
,
values
,
"categorylevel"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andCategorylevelBetween
(
Short
value1
,
Short
value2
)
{
addCriterion
(
"CategoryLevel between"
,
value1
,
value2
,
"categorylevel"
);
public
Criteria
andCategorylevelBetween
(
Short
value1
,
Short
value2
)
{
return
(
Criteria
)
this
;
addCriterion
(
"CategoryLevel between"
,
value1
,
value2
,
"categorylevel"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andCategorylevelNotBetween
(
Short
value1
,
Short
value2
)
{
addCriterion
(
"CategoryLevel not between"
,
value1
,
value2
,
"categorylevel"
);
public
Criteria
andCategorylevelNotBetween
(
Short
value1
,
Short
value2
)
{
return
(
Criteria
)
this
;
addCriterion
(
"CategoryLevel not between"
,
value1
,
value2
,
"categorylevel"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andParentidIsNull
()
{
addCriterion
(
"ParentId is null"
);
public
Criteria
andParentidIsNull
()
{
return
(
Criteria
)
this
;
addCriterion
(
"ParentId is null"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andParentidIsNotNull
()
{
addCriterion
(
"ParentId is not null"
);
public
Criteria
andParentidIsNotNull
()
{
return
(
Criteria
)
this
;
addCriterion
(
"ParentId is not null"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andParentidEqualTo
(
Long
value
)
{
addCriterion
(
"ParentId ="
,
value
,
"parentid"
);
public
Criteria
andParentidEqualTo
(
Long
value
)
{
return
(
Criteria
)
this
;
addCriterion
(
"ParentId ="
,
value
,
"parentid"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andParentidNotEqualTo
(
Long
value
)
{
addCriterion
(
"ParentId <>"
,
value
,
"parentid"
);
public
Criteria
andParentidNotEqualTo
(
Long
value
)
{
return
(
Criteria
)
this
;
addCriterion
(
"ParentId <>"
,
value
,
"parentid"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andParentidGreaterThan
(
Long
value
)
{
addCriterion
(
"ParentId >"
,
value
,
"parentid"
);
public
Criteria
andParentidGreaterThan
(
Long
value
)
{
return
(
Criteria
)
this
;
addCriterion
(
"ParentId >"
,
value
,
"parentid"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andParentidGreaterThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"ParentId >="
,
value
,
"parentid"
);
public
Criteria
andParentidGreaterThanOrEqualTo
(
Long
value
)
{
return
(
Criteria
)
this
;
addCriterion
(
"ParentId >="
,
value
,
"parentid"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andParentidLessThan
(
Long
value
)
{
addCriterion
(
"ParentId <"
,
value
,
"parentid"
);
public
Criteria
andParentidLessThan
(
Long
value
)
{
return
(
Criteria
)
this
;
addCriterion
(
"ParentId <"
,
value
,
"parentid"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andParentidLessThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"ParentId <="
,
value
,
"parentid"
);
public
Criteria
andParentidLessThanOrEqualTo
(
Long
value
)
{
return
(
Criteria
)
this
;
addCriterion
(
"ParentId <="
,
value
,
"parentid"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andParentidIn
(
List
<
Long
>
values
)
{
addCriterion
(
"ParentId in"
,
values
,
"parentid"
);
public
Criteria
andParentidIn
(
List
<
Long
>
values
)
{
return
(
Criteria
)
this
;
addCriterion
(
"ParentId in"
,
values
,
"parentid"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andParentidNotIn
(
List
<
Long
>
values
)
{
addCriterion
(
"ParentId not in"
,
values
,
"parentid"
);
public
Criteria
andParentidNotIn
(
List
<
Long
>
values
)
{
return
(
Criteria
)
this
;
addCriterion
(
"ParentId not in"
,
values
,
"parentid"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andParentidBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"ParentId between"
,
value1
,
value2
,
"parentid"
);
public
Criteria
andParentidBetween
(
Long
value1
,
Long
value2
)
{
return
(
Criteria
)
this
;
addCriterion
(
"ParentId between"
,
value1
,
value2
,
"parentid"
);
}
return
(
Criteria
)
this
;
}
public
Criteria
andParentidNotBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"ParentId not between"
,
value1
,
value2
,
"parentid"
);
public
Criteria
andParentidNotBetween
(
Long
value1
,
Long
value2
)
{
return
(
Criteria
)
this
;
addCriterion
(
"ParentId not between"
,
value1
,
value2
,
"parentid"
);
}
return
(
Criteria
)
this
;
}
}
/**
public
Criteria
andSortIsNull
()
{
* This class was generated by MyBatis Generator.
addCriterion
(
"sort is null"
);
* This class corresponds to the database table jsh_materialcategory
return
(
Criteria
)
this
;
*
}
* @mbggenerated do_not_delete_during_merge
*/
public
Criteria
andSortIsNotNull
()
{
public
static
class
Criteria
extends
GeneratedCriteria
{
addCriterion
(
"sort is not null"
);
return
(
Criteria
)
this
;
protected
Criteria
()
{
}
super
();
}
public
Criteria
andSortEqualTo
(
String
value
)
{
}
addCriterion
(
"sort ="
,
value
,
"sort"
);
return
(
Criteria
)
this
;
/**
}
* This class was generated by MyBatis Generator.
* This class corresponds to the database table jsh_materialcategory
public
Criteria
andSortNotEqualTo
(
String
value
)
{
*
addCriterion
(
"sort <>"
,
value
,
"sort"
);
* @mbggenerated
return
(
Criteria
)
this
;
*/
}
public
static
class
Criterion
{
private
String
condition
;
public
Criteria
andSortGreaterThan
(
String
value
)
{
addCriterion
(
"sort >"
,
value
,
"sort"
);
private
Object
value
;
return
(
Criteria
)
this
;
}
private
Object
secondValue
;
public
Criteria
andSortGreaterThanOrEqualTo
(
String
value
)
{
private
boolean
noValue
;
addCriterion
(
"sort >="
,
value
,
"sort"
);
return
(
Criteria
)
this
;
private
boolean
singleValue
;
}
private
boolean
betweenValue
;
public
Criteria
andSortLessThan
(
String
value
)
{
addCriterion
(
"sort <"
,
value
,
"sort"
);
private
boolean
listValue
;
return
(
Criteria
)
this
;
}
private
String
typeHandler
;
public
Criteria
andSortLessThanOrEqualTo
(
String
value
)
{
public
String
getCondition
()
{
addCriterion
(
"sort <="
,
value
,
"sort"
);
return
condition
;
return
(
Criteria
)
this
;
}
}
public
Object
getValue
()
{
public
Criteria
andSortLike
(
String
value
)
{
return
value
;
addCriterion
(
"sort like"
,
value
,
"sort"
);
}
return
(
Criteria
)
this
;
}
public
Object
getSecondValue
()
{
return
secondValue
;
public
Criteria
andSortNotLike
(
String
value
)
{
}
addCriterion
(
"sort not like"
,
value
,
"sort"
);
return
(
Criteria
)
this
;
public
boolean
isNoValue
()
{
}
return
noValue
;
}
public
Criteria
andSortIn
(
List
<
String
>
values
)
{
addCriterion
(
"sort in"
,
values
,
"sort"
);
public
boolean
isSingleValue
()
{
return
(
Criteria
)
this
;
return
singleValue
;
}
}
public
Criteria
andSortNotIn
(
List
<
String
>
values
)
{
public
boolean
isBetweenValue
()
{
addCriterion
(
"sort not in"
,
values
,
"sort"
);
return
betweenValue
;
return
(
Criteria
)
this
;
}
}
public
boolean
isListValue
()
{
public
Criteria
andSortBetween
(
String
value1
,
String
value2
)
{
return
listValue
;
addCriterion
(
"sort between"
,
value1
,
value2
,
"sort"
);
}
return
(
Criteria
)
this
;
}
public
String
getTypeHandler
()
{
return
typeHandler
;
public
Criteria
andSortNotBetween
(
String
value1
,
String
value2
)
{
}
addCriterion
(
"sort not between"
,
value1
,
value2
,
"sort"
);
return
(
Criteria
)
this
;
protected
Criterion
(
String
condition
)
{
}
super
();
this
.
condition
=
condition
;
public
Criteria
andStatusIsNull
()
{
this
.
typeHandler
=
null
;
addCriterion
(
"status is null"
);
this
.
noValue
=
true
;
return
(
Criteria
)
this
;
}
}
protected
Criterion
(
String
condition
,
Object
value
,
String
typeHandler
)
{
public
Criteria
andStatusIsNotNull
()
{
super
();
addCriterion
(
"status is not null"
);
this
.
condition
=
condition
;
return
(
Criteria
)
this
;
this
.
value
=
value
;
}
this
.
typeHandler
=
typeHandler
;
if
(
value
instanceof
List
<?>)
{
public
Criteria
andStatusEqualTo
(
String
value
)
{
this
.
listValue
=
true
;
addCriterion
(
"status ="
,
value
,
"status"
);
}
else
{
return
(
Criteria
)
this
;
this
.
singleValue
=
true
;
}
}
}
public
Criteria
andStatusNotEqualTo
(
String
value
)
{
addCriterion
(
"status <>"
,
value
,
"status"
);
protected
Criterion
(
String
condition
,
Object
value
)
{
return
(
Criteria
)
this
;
this
(
condition
,
value
,
null
);
}
}
public
Criteria
andStatusGreaterThan
(
String
value
)
{
protected
Criterion
(
String
condition
,
Object
value
,
Object
secondValue
,
String
typeHandler
)
{
addCriterion
(
"status >"
,
value
,
"status"
);
super
();
return
(
Criteria
)
this
;
this
.
condition
=
condition
;
}
this
.
value
=
value
;
this
.
secondValue
=
secondValue
;
public
Criteria
andStatusGreaterThanOrEqualTo
(
String
value
)
{
this
.
typeHandler
=
typeHandler
;
addCriterion
(
"status >="
,
value
,
"status"
);
this
.
betweenValue
=
true
;
return
(
Criteria
)
this
;
}
}
protected
Criterion
(
String
condition
,
Object
value
,
Object
secondValue
)
{
public
Criteria
andStatusLessThan
(
String
value
)
{
this
(
condition
,
value
,
secondValue
,
null
);
addCriterion
(
"status <"
,
value
,
"status"
);
}
return
(
Criteria
)
this
;
}
}
public
Criteria
andStatusLessThanOrEqualTo
(
String
value
)
{
addCriterion
(
"status <="
,
value
,
"status"
);
return
(
Criteria
)
this
;
}
public
Criteria
andStatusLike
(
String
value
)
{
addCriterion
(
"status like"
,
value
,
"status"
);
return
(
Criteria
)
this
;
}
public
Criteria
andStatusNotLike
(
String
value
)
{
addCriterion
(
"status not like"
,
value
,
"status"
);
return
(
Criteria
)
this
;
}
public
Criteria
andStatusIn
(
List
<
String
>
values
)
{
addCriterion
(
"status in"
,
values
,
"status"
);
return
(
Criteria
)
this
;
}
public
Criteria
andStatusNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"status not in"
,
values
,
"status"
);
return
(
Criteria
)
this
;
}
public
Criteria
andStatusBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"status between"
,
value1
,
value2
,
"status"
);
return
(
Criteria
)
this
;
}
public
Criteria
andStatusNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"status not between"
,
value1
,
value2
,
"status"
);
return
(
Criteria
)
this
;
}
public
Criteria
andSerialNoIsNull
()
{
addCriterion
(
"serial_no is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andSerialNoIsNotNull
()
{
addCriterion
(
"serial_no is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andSerialNoEqualTo
(
String
value
)
{
addCriterion
(
"serial_no ="
,
value
,
"serialNo"
);
return
(
Criteria
)
this
;
}
public
Criteria
andSerialNoNotEqualTo
(
String
value
)
{
addCriterion
(
"serial_no <>"
,
value
,
"serialNo"
);
return
(
Criteria
)
this
;
}
public
Criteria
andSerialNoGreaterThan
(
String
value
)
{
addCriterion
(
"serial_no >"
,
value
,
"serialNo"
);
return
(
Criteria
)
this
;
}
public
Criteria
andSerialNoGreaterThanOrEqualTo
(
String
value
)
{
addCriterion
(
"serial_no >="
,
value
,
"serialNo"
);
return
(
Criteria
)
this
;
}
public
Criteria
andSerialNoLessThan
(
String
value
)
{
addCriterion
(
"serial_no <"
,
value
,
"serialNo"
);
return
(
Criteria
)
this
;
}
public
Criteria
andSerialNoLessThanOrEqualTo
(
String
value
)
{
addCriterion
(
"serial_no <="
,
value
,
"serialNo"
);
return
(
Criteria
)
this
;
}
public
Criteria
andSerialNoLike
(
String
value
)
{
addCriterion
(
"serial_no like"
,
value
,
"serialNo"
);
return
(
Criteria
)
this
;
}
public
Criteria
andSerialNoNotLike
(
String
value
)
{
addCriterion
(
"serial_no not like"
,
value
,
"serialNo"
);
return
(
Criteria
)
this
;
}
public
Criteria
andSerialNoIn
(
List
<
String
>
values
)
{
addCriterion
(
"serial_no in"
,
values
,
"serialNo"
);
return
(
Criteria
)
this
;
}
public
Criteria
andSerialNoNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"serial_no not in"
,
values
,
"serialNo"
);
return
(
Criteria
)
this
;
}
public
Criteria
andSerialNoBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"serial_no between"
,
value1
,
value2
,
"serialNo"
);
return
(
Criteria
)
this
;
}
public
Criteria
andSerialNoNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"serial_no not between"
,
value1
,
value2
,
"serialNo"
);
return
(
Criteria
)
this
;
}
public
Criteria
andRemarkIsNull
()
{
addCriterion
(
"remark is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andRemarkIsNotNull
()
{
addCriterion
(
"remark is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andRemarkEqualTo
(
String
value
)
{
addCriterion
(
"remark ="
,
value
,
"remark"
);
return
(
Criteria
)
this
;
}
public
Criteria
andRemarkNotEqualTo
(
String
value
)
{
addCriterion
(
"remark <>"
,
value
,
"remark"
);
return
(
Criteria
)
this
;
}
public
Criteria
andRemarkGreaterThan
(
String
value
)
{
addCriterion
(
"remark >"
,
value
,
"remark"
);
return
(
Criteria
)
this
;
}
public
Criteria
andRemarkGreaterThanOrEqualTo
(
String
value
)
{
addCriterion
(
"remark >="
,
value
,
"remark"
);
return
(
Criteria
)
this
;
}
public
Criteria
andRemarkLessThan
(
String
value
)
{
addCriterion
(
"remark <"
,
value
,
"remark"
);
return
(
Criteria
)
this
;
}
public
Criteria
andRemarkLessThanOrEqualTo
(
String
value
)
{
addCriterion
(
"remark <="
,
value
,
"remark"
);
return
(
Criteria
)
this
;
}
public
Criteria
andRemarkLike
(
String
value
)
{
addCriterion
(
"remark like"
,
value
,
"remark"
);
return
(
Criteria
)
this
;
}
public
Criteria
andRemarkNotLike
(
String
value
)
{
addCriterion
(
"remark not like"
,
value
,
"remark"
);
return
(
Criteria
)
this
;
}
public
Criteria
andRemarkIn
(
List
<
String
>
values
)
{
addCriterion
(
"remark in"
,
values
,
"remark"
);
return
(
Criteria
)
this
;
}
public
Criteria
andRemarkNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"remark not in"
,
values
,
"remark"
);
return
(
Criteria
)
this
;
}
public
Criteria
andRemarkBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"remark between"
,
value1
,
value2
,
"remark"
);
return
(
Criteria
)
this
;
}
public
Criteria
andRemarkNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"remark not between"
,
value1
,
value2
,
"remark"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeIsNull
()
{
addCriterion
(
"create_time is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeIsNotNull
()
{
addCriterion
(
"create_time is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeEqualTo
(
Date
value
)
{
addCriterion
(
"create_time ="
,
value
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeNotEqualTo
(
Date
value
)
{
addCriterion
(
"create_time <>"
,
value
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeGreaterThan
(
Date
value
)
{
addCriterion
(
"create_time >"
,
value
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeGreaterThanOrEqualTo
(
Date
value
)
{
addCriterion
(
"create_time >="
,
value
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeLessThan
(
Date
value
)
{
addCriterion
(
"create_time <"
,
value
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeLessThanOrEqualTo
(
Date
value
)
{
addCriterion
(
"create_time <="
,
value
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeIn
(
List
<
Date
>
values
)
{
addCriterion
(
"create_time in"
,
values
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeNotIn
(
List
<
Date
>
values
)
{
addCriterion
(
"create_time not in"
,
values
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeBetween
(
Date
value1
,
Date
value2
)
{
addCriterion
(
"create_time between"
,
value1
,
value2
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeNotBetween
(
Date
value1
,
Date
value2
)
{
addCriterion
(
"create_time not between"
,
value1
,
value2
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreatorIsNull
()
{
addCriterion
(
"creator is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreatorIsNotNull
()
{
addCriterion
(
"creator is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreatorEqualTo
(
Long
value
)
{
addCriterion
(
"creator ="
,
value
,
"creator"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreatorNotEqualTo
(
Long
value
)
{
addCriterion
(
"creator <>"
,
value
,
"creator"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreatorGreaterThan
(
Long
value
)
{
addCriterion
(
"creator >"
,
value
,
"creator"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreatorGreaterThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"creator >="
,
value
,
"creator"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreatorLessThan
(
Long
value
)
{
addCriterion
(
"creator <"
,
value
,
"creator"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreatorLessThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"creator <="
,
value
,
"creator"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreatorIn
(
List
<
Long
>
values
)
{
addCriterion
(
"creator in"
,
values
,
"creator"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreatorNotIn
(
List
<
Long
>
values
)
{
addCriterion
(
"creator not in"
,
values
,
"creator"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreatorBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"creator between"
,
value1
,
value2
,
"creator"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreatorNotBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"creator not between"
,
value1
,
value2
,
"creator"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateTimeIsNull
()
{
addCriterion
(
"update_time is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateTimeIsNotNull
()
{
addCriterion
(
"update_time is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateTimeEqualTo
(
Date
value
)
{
addCriterion
(
"update_time ="
,
value
,
"updateTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateTimeNotEqualTo
(
Date
value
)
{
addCriterion
(
"update_time <>"
,
value
,
"updateTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateTimeGreaterThan
(
Date
value
)
{
addCriterion
(
"update_time >"
,
value
,
"updateTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateTimeGreaterThanOrEqualTo
(
Date
value
)
{
addCriterion
(
"update_time >="
,
value
,
"updateTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateTimeLessThan
(
Date
value
)
{
addCriterion
(
"update_time <"
,
value
,
"updateTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateTimeLessThanOrEqualTo
(
Date
value
)
{
addCriterion
(
"update_time <="
,
value
,
"updateTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateTimeIn
(
List
<
Date
>
values
)
{
addCriterion
(
"update_time in"
,
values
,
"updateTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateTimeNotIn
(
List
<
Date
>
values
)
{
addCriterion
(
"update_time not in"
,
values
,
"updateTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateTimeBetween
(
Date
value1
,
Date
value2
)
{
addCriterion
(
"update_time between"
,
value1
,
value2
,
"updateTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateTimeNotBetween
(
Date
value1
,
Date
value2
)
{
addCriterion
(
"update_time not between"
,
value1
,
value2
,
"updateTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdaterIsNull
()
{
addCriterion
(
"updater is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdaterIsNotNull
()
{
addCriterion
(
"updater is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdaterEqualTo
(
Long
value
)
{
addCriterion
(
"updater ="
,
value
,
"updater"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdaterNotEqualTo
(
Long
value
)
{
addCriterion
(
"updater <>"
,
value
,
"updater"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdaterGreaterThan
(
Long
value
)
{
addCriterion
(
"updater >"
,
value
,
"updater"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdaterGreaterThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"updater >="
,
value
,
"updater"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdaterLessThan
(
Long
value
)
{
addCriterion
(
"updater <"
,
value
,
"updater"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdaterLessThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"updater <="
,
value
,
"updater"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdaterIn
(
List
<
Long
>
values
)
{
addCriterion
(
"updater in"
,
values
,
"updater"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdaterNotIn
(
List
<
Long
>
values
)
{
addCriterion
(
"updater not in"
,
values
,
"updater"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdaterBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"updater between"
,
value1
,
value2
,
"updater"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdaterNotBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"updater not between"
,
value1
,
value2
,
"updater"
);
return
(
Criteria
)
this
;
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table jsh_materialcategory
*
* @mbggenerated do_not_delete_during_merge
*/
public
static
class
Criteria
extends
GeneratedCriteria
{
protected
Criteria
()
{
super
();
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table jsh_materialcategory
*
* @mbggenerated
*/
public
static
class
Criterion
{
private
String
condition
;
private
Object
value
;
private
Object
secondValue
;
private
boolean
noValue
;
private
boolean
singleValue
;
private
boolean
betweenValue
;
private
boolean
listValue
;
private
String
typeHandler
;
public
String
getCondition
()
{
return
condition
;
}
public
Object
getValue
()
{
return
value
;
}
public
Object
getSecondValue
()
{
return
secondValue
;
}
public
boolean
isNoValue
()
{
return
noValue
;
}
public
boolean
isSingleValue
()
{
return
singleValue
;
}
public
boolean
isBetweenValue
()
{
return
betweenValue
;
}
public
boolean
isListValue
()
{
return
listValue
;
}
public
String
getTypeHandler
()
{
return
typeHandler
;
}
protected
Criterion
(
String
condition
)
{
super
();
this
.
condition
=
condition
;
this
.
typeHandler
=
null
;
this
.
noValue
=
true
;
}
protected
Criterion
(
String
condition
,
Object
value
,
String
typeHandler
)
{
super
();
this
.
condition
=
condition
;
this
.
value
=
value
;
this
.
typeHandler
=
typeHandler
;
if
(
value
instanceof
List
<?>)
{
this
.
listValue
=
true
;
}
else
{
this
.
singleValue
=
true
;
}
}
protected
Criterion
(
String
condition
,
Object
value
)
{
this
(
condition
,
value
,
null
);
}
protected
Criterion
(
String
condition
,
Object
value
,
Object
secondValue
,
String
typeHandler
)
{
super
();
this
.
condition
=
condition
;
this
.
value
=
value
;
this
.
secondValue
=
secondValue
;
this
.
typeHandler
=
typeHandler
;
this
.
betweenValue
=
true
;
}
protected
Criterion
(
String
condition
,
Object
value
,
Object
secondValue
)
{
this
(
condition
,
value
,
secondValue
,
null
);
}
}
}
}
\ No newline at end of file
src/main/java/com/jsh/erp/datasource/mappers/MaterialCategoryMapper.java
View file @
6bbc0aef
package
com.jsh.erp.datasource.mappers
;
package
com.jsh.erp.datasource.mappers
;
import
com.jsh.erp.datasource.entities.MaterialCategory
;
import
com.jsh.erp.datasource.entities.MaterialCategory
;
import
com.jsh.erp.datasource.entities.MaterialCategoryExample
;
import
com.jsh.erp.datasource.entities.MaterialCategoryExample
;
import
java.util.List
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
public
interface
MaterialCategoryMapper
{
public
interface
MaterialCategoryMapper
{
/**
/**
* This method was generated by MyBatis Generator.
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_materialcategory
* This method corresponds to the database table jsh_materialcategory
*
*
* @mbggenerated
* @mbggenerated
*/
*/
int
countByExample
(
MaterialCategoryExample
example
);
int
countByExample
(
MaterialCategoryExample
example
);
/**
/**
* This method was generated by MyBatis Generator.
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_materialcategory
* This method corresponds to the database table jsh_materialcategory
*
*
* @mbggenerated
* @mbggenerated
*/
*/
int
deleteByExample
(
MaterialCategoryExample
example
);
int
deleteByExample
(
MaterialCategoryExample
example
);
/**
/**
* This method was generated by MyBatis Generator.
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_materialcategory
* This method corresponds to the database table jsh_materialcategory
*
*
* @mbggenerated
* @mbggenerated
*/
*/
int
deleteByPrimaryKey
(
Long
id
);
int
deleteByPrimaryKey
(
Long
id
);
/**
/**
* This method was generated by MyBatis Generator.
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_materialcategory
* This method corresponds to the database table jsh_materialcategory
*
*
* @mbggenerated
* @mbggenerated
*/
*/
int
insert
(
MaterialCategory
record
);
int
insert
(
MaterialCategory
record
);
/**
/**
* This method was generated by MyBatis Generator.
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_materialcategory
* This method corresponds to the database table jsh_materialcategory
*
*
* @mbggenerated
* @mbggenerated
*/
*/
int
insertSelective
(
MaterialCategory
record
);
int
insertSelective
(
MaterialCategory
record
);
/**
/**
* This method was generated by MyBatis Generator.
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_materialcategory
* This method corresponds to the database table jsh_materialcategory
*
*
* @mbggenerated
* @mbggenerated
*/
*/
List
<
MaterialCategory
>
selectByExample
(
MaterialCategoryExample
example
);
List
<
MaterialCategory
>
selectByExample
(
MaterialCategoryExample
example
);
/**
/**
* This method was generated by MyBatis Generator.
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_materialcategory
* This method corresponds to the database table jsh_materialcategory
*
*
* @mbggenerated
* @mbggenerated
*/
*/
MaterialCategory
selectByPrimaryKey
(
Long
id
);
MaterialCategory
selectByPrimaryKey
(
Long
id
);
/**
/**
* This method was generated by MyBatis Generator.
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_materialcategory
* This method corresponds to the database table jsh_materialcategory
*
*
* @mbggenerated
* @mbggenerated
*/
*/
int
updateByExampleSelective
(
@Param
(
"record"
)
MaterialCategory
record
,
@Param
(
"example"
)
MaterialCategoryExample
example
);
int
updateByExampleSelective
(
@Param
(
"record"
)
MaterialCategory
record
,
@Param
(
"example"
)
MaterialCategoryExample
example
);
/**
/**
* This method was generated by MyBatis Generator.
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_materialcategory
* This method corresponds to the database table jsh_materialcategory
*
*
* @mbggenerated
* @mbggenerated
*/
*/
int
updateByExample
(
@Param
(
"record"
)
MaterialCategory
record
,
@Param
(
"example"
)
MaterialCategoryExample
example
);
int
updateByExample
(
@Param
(
"record"
)
MaterialCategory
record
,
@Param
(
"example"
)
MaterialCategoryExample
example
);
/**
/**
* This method was generated by MyBatis Generator.
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_materialcategory
* This method corresponds to the database table jsh_materialcategory
*
*
* @mbggenerated
* @mbggenerated
*/
*/
int
updateByPrimaryKeySelective
(
MaterialCategory
record
);
int
updateByPrimaryKeySelective
(
MaterialCategory
record
);
/**
/**
* This method was generated by MyBatis Generator.
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_materialcategory
* This method corresponds to the database table jsh_materialcategory
*
*
* @mbggenerated
* @mbggenerated
*/
*/
int
updateByPrimaryKey
(
MaterialCategory
record
);
int
updateByPrimaryKey
(
MaterialCategory
record
);
List
<
MaterialCategory
>
selectByConditionMaterialCategory
(
@Param
(
"name"
)
String
name
,
@Param
(
"parentId"
)
Integer
parentId
,
@Param
(
"offset"
)
Integer
offset
,
@Param
(
"rows"
)
Integer
rows
);
int
countsByMaterialCategory
(
@Param
(
"name"
)
String
name
,
@Param
(
"parentId"
)
Integer
parentId
);
}
}
\ No newline at end of file
src/main/java/com/jsh/erp/datasource/mappers/MaterialCategoryMapperEx.java
0 → 100644
View file @
6bbc0aef
package
com.jsh.erp.datasource.mappers
;
import
com.jsh.erp.datasource.entities.MaterialCategory
;
import
com.jsh.erp.datasource.vo.TreeNode
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.Date
;
import
java.util.List
;
/**
* Description
*
* @Author: cjl
* @Date: 2019/2/18 17:23
*/
public
interface
MaterialCategoryMapperEx
{
List
<
MaterialCategory
>
selectByConditionMaterialCategory
(
@Param
(
"name"
)
String
name
,
@Param
(
"parentId"
)
Integer
parentId
,
@Param
(
"offset"
)
Integer
offset
,
@Param
(
"rows"
)
Integer
rows
);
int
countsByMaterialCategory
(
@Param
(
"name"
)
String
name
,
@Param
(
"parentId"
)
Integer
parentId
);
List
<
TreeNode
>
getNodeTree
();
List
<
TreeNode
>
getNextNodeTree
(
@Param
(
"id"
)
Long
id
);
int
addMaterialCategory
(
MaterialCategory
mc
);
int
batchDeleteMaterialCategoryByIds
(
@Param
(
"updateTime"
)
Date
updateTime
,
@Param
(
"updater"
)
Long
updater
,
@Param
(
"ids"
)
String
ids
[]);
int
editMaterialCategory
(
MaterialCategory
mc
);
}
src/main/java/com/jsh/erp/datasource/vo/TreeNode.java
0 → 100644
View file @
6bbc0aef
package
com.jsh.erp.datasource.vo
;
import
java.util.List
;
/**
* Description
* 树形结构基本元素
* @Author: cjl
* @Date: 2019/2/19 11:27
*/
public
class
TreeNode
{
/**
* id主键
* */
private
Long
id
;
/**
* text显示的文本
* */
private
String
text
;
/**
*state节点状态,'open' 或 'closed',默认:'open'。如果为'closed'的时候,将不自动展开该节点。
* */
private
String
state
=
"open"
;
/**
*iconCls 节点图标id
* */
private
String
iconCls
;
/**
* checked 是否被选中
* */
private
boolean
checked
;
/**
*attributes 自定义属性
* */
private
String
attributes
;
/**
* children 子节点
* */
private
List
<
TreeNode
>
children
;
public
Long
getId
()
{
return
id
;
}
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
String
getText
()
{
return
text
;
}
public
void
setText
(
String
text
)
{
this
.
text
=
text
;
}
public
String
getState
()
{
return
state
;
}
public
void
setState
(
String
state
)
{
this
.
state
=
state
;
}
public
String
getIconCls
()
{
return
iconCls
;
}
public
void
setIconCls
(
String
iconCls
)
{
this
.
iconCls
=
iconCls
;
}
public
boolean
isChecked
()
{
return
checked
;
}
public
void
setChecked
(
boolean
checked
)
{
this
.
checked
=
checked
;
}
public
String
getAttributes
()
{
return
attributes
;
}
public
void
setAttributes
(
String
attributes
)
{
this
.
attributes
=
attributes
;
}
public
List
<
TreeNode
>
getChildren
()
{
return
children
;
}
public
void
setChildren
(
List
<
TreeNode
>
children
)
{
this
.
children
=
children
;
}
}
src/main/java/com/jsh/erp/service/materialCategory/MaterialCategoryService.java
View file @
6bbc0aef
package
com.jsh.erp.service.materialCategory
;
package
com.jsh.erp.service.materialCategory
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.jsh.erp.constants.BusinessConstants
;
import
com.jsh.erp.datasource.entities.MaterialCategory
;
import
com.jsh.erp.datasource.entities.MaterialCategory
;
import
com.jsh.erp.datasource.entities.MaterialCategoryExample
;
import
com.jsh.erp.datasource.entities.MaterialCategoryExample
;
import
com.jsh.erp.datasource.entities.User
;
import
com.jsh.erp.datasource.mappers.MaterialCategoryMapper
;
import
com.jsh.erp.datasource.mappers.MaterialCategoryMapper
;
import
com.jsh.erp.datasource.mappers.MaterialCategoryMapperEx
;
import
com.jsh.erp.datasource.vo.TreeNode
;
import
com.jsh.erp.service.user.UserService
;
import
com.jsh.erp.utils.StringUtil
;
import
com.jsh.erp.utils.StringUtil
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -12,6 +17,7 @@ import org.springframework.transaction.annotation.Transactional;
...
@@ -12,6 +17,7 @@ import org.springframework.transaction.annotation.Transactional;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
@Service
@Service
...
@@ -20,6 +26,10 @@ public class MaterialCategoryService {
...
@@ -20,6 +26,10 @@ public class MaterialCategoryService {
@Resource
@Resource
private
MaterialCategoryMapper
materialCategoryMapper
;
private
MaterialCategoryMapper
materialCategoryMapper
;
@Resource
private
MaterialCategoryMapperEx
materialCategoryMapperEx
;
@Resource
private
UserService
userService
;
public
MaterialCategory
getMaterialCategory
(
long
id
)
{
public
MaterialCategory
getMaterialCategory
(
long
id
)
{
return
materialCategoryMapper
.
selectByPrimaryKey
(
id
);
return
materialCategoryMapper
.
selectByPrimaryKey
(
id
);
...
@@ -38,11 +48,11 @@ public class MaterialCategoryService {
...
@@ -38,11 +48,11 @@ public class MaterialCategoryService {
}
}
public
List
<
MaterialCategory
>
select
(
String
name
,
Integer
parentId
,
int
offset
,
int
rows
)
{
public
List
<
MaterialCategory
>
select
(
String
name
,
Integer
parentId
,
int
offset
,
int
rows
)
{
return
materialCategoryMapper
.
selectByConditionMaterialCategory
(
name
,
parentId
,
offset
,
rows
);
return
materialCategoryMapper
Ex
.
selectByConditionMaterialCategory
(
name
,
parentId
,
offset
,
rows
);
}
}
public
int
countMaterialCategory
(
String
name
,
Integer
parentId
)
{
public
int
countMaterialCategory
(
String
name
,
Integer
parentId
)
{
return
materialCategoryMapper
.
countsByMaterialCategory
(
name
,
parentId
);
return
materialCategoryMapper
Ex
.
countsByMaterialCategory
(
name
,
parentId
);
}
}
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
...
@@ -80,4 +90,68 @@ public class MaterialCategoryService {
...
@@ -80,4 +90,68 @@ public class MaterialCategoryService {
example
.
createCriteria
().
andIdEqualTo
(
id
);
example
.
createCriteria
().
andIdEqualTo
(
id
);
return
materialCategoryMapper
.
selectByExample
(
example
);
return
materialCategoryMapper
.
selectByExample
(
example
);
}
}
/**
* create by: cjl
* description:
*获取商品类别树数据
* create time: 2019/2/19 14:30
* @Param:
* @return java.util.List<com.jsh.erp.datasource.vo.TreeNode>
*/
public
List
<
TreeNode
>
getMaterialCategoryTree
()
throws
Exception
{
return
materialCategoryMapperEx
.
getNodeTree
();
}
/**
* create by: cjl
* description:
* 新增商品类别信息
* create time: 2019/2/19 16:30
* @Param: mc
* @return void
*/
public
int
addMaterialCategory
(
MaterialCategory
mc
)
throws
Exception
{
if
(
mc
==
null
){
return
0
;
}
if
(
mc
.
getParentid
()==
null
){
//没有给定父级目录的id,默认设置父级目录为根目录
mc
.
setParentid
(
BusinessConstants
.
MATERIAL_CATEGORY_ROOT_ID
);
}
//数据状态新增时默认设置为启用
mc
.
setStatus
(
BusinessConstants
.
MATERIAL_CATEGORY_STATUS_ENABLE
);
Date
date
=
new
Date
();
User
userInfo
=
userService
.
getCurrentUser
();
//创建时间
mc
.
setCreateTime
(
date
);
//创建人
mc
.
setCreator
(
userInfo
==
null
?
null
:
userInfo
.
getId
());
//更新时间
mc
.
setUpdateTime
(
date
);
//更新人
mc
.
setUpdater
(
userInfo
==
null
?
null
:
userInfo
.
getId
());
return
materialCategoryMapperEx
.
addMaterialCategory
(
mc
);
}
public
int
batchDeleteMaterialCategoryByIds
(
String
ids
)
throws
Exception
{
//更新时间
Date
updateDate
=
new
Date
();
//更新人
User
userInfo
=
userService
.
getCurrentUser
();
Long
updater
=
userInfo
==
null
?
null
:
userInfo
.
getId
();
StringBuffer
sb
=
new
StringBuffer
();
String
strArray
[]=
ids
.
split
(
","
);
if
(
strArray
.
length
<
1
){
return
0
;
}
return
materialCategoryMapperEx
.
batchDeleteMaterialCategoryByIds
(
updateDate
,
updater
,
strArray
);
}
public
int
editMaterialCategory
(
MaterialCategory
mc
)
{
//更新时间
mc
.
setUpdateTime
(
new
Date
());
//更新人
User
userInfo
=
userService
.
getCurrentUser
();
mc
.
setUpdater
(
userInfo
==
null
?
null
:
userInfo
.
getId
());
return
materialCategoryMapperEx
.
editMaterialCategory
(
mc
);
}
}
}
src/main/resources/mapper_xml/MaterialCategoryMapper.xml
View file @
6bbc0aef
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.jsh.erp.datasource.mappers.MaterialCategoryMapper"
>
<mapper
namespace=
"com.jsh.erp.datasource.mappers.MaterialCategoryMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.jsh.erp.datasource.entities.MaterialCategory"
>
<resultMap
id=
"BaseResultMap"
type=
"com.jsh.erp.datasource.entities.MaterialCategory"
>
<!--
<!--
...
@@ -10,6 +10,14 @@
...
@@ -10,6 +10,14 @@
<result
column=
"Name"
jdbcType=
"VARCHAR"
property=
"name"
/>
<result
column=
"Name"
jdbcType=
"VARCHAR"
property=
"name"
/>
<result
column=
"CategoryLevel"
jdbcType=
"SMALLINT"
property=
"categorylevel"
/>
<result
column=
"CategoryLevel"
jdbcType=
"SMALLINT"
property=
"categorylevel"
/>
<result
column=
"ParentId"
jdbcType=
"BIGINT"
property=
"parentid"
/>
<result
column=
"ParentId"
jdbcType=
"BIGINT"
property=
"parentid"
/>
<result
column=
"sort"
jdbcType=
"VARCHAR"
property=
"sort"
/>
<result
column=
"status"
jdbcType=
"VARCHAR"
property=
"status"
/>
<result
column=
"serial_no"
jdbcType=
"VARCHAR"
property=
"serialNo"
/>
<result
column=
"remark"
jdbcType=
"VARCHAR"
property=
"remark"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"creator"
jdbcType=
"BIGINT"
property=
"creator"
/>
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
<result
column=
"updater"
jdbcType=
"BIGINT"
property=
"updater"
/>
</resultMap>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
<sql
id=
"Example_Where_Clause"
>
<!--
<!--
...
@@ -82,7 +90,8 @@
...
@@ -82,7 +90,8 @@
WARNING - @mbggenerated
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element is automatically generated by MyBatis Generator, do not modify.
-->
-->
Id, Name, CategoryLevel, ParentId
Id, Name, CategoryLevel, ParentId, sort, status, serial_no, remark, create_time,
creator, update_time, updater
</sql>
</sql>
<select
id=
"selectByExample"
parameterType=
"com.jsh.erp.datasource.entities.MaterialCategoryExample"
resultMap=
"BaseResultMap"
>
<select
id=
"selectByExample"
parameterType=
"com.jsh.erp.datasource.entities.MaterialCategoryExample"
resultMap=
"BaseResultMap"
>
<!--
<!--
...
@@ -136,9 +145,15 @@
...
@@ -136,9 +145,15 @@
This element is automatically generated by MyBatis Generator, do not modify.
This element is automatically generated by MyBatis Generator, do not modify.
-->
-->
insert into jsh_materialcategory (Id, Name, CategoryLevel,
insert into jsh_materialcategory (Id, Name, CategoryLevel,
ParentId)
ParentId, sort, status,
serial_no, remark, create_time,
creator, update_time, updater
)
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{categorylevel,jdbcType=SMALLINT},
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{categorylevel,jdbcType=SMALLINT},
#{parentid,jdbcType=BIGINT})
#{parentid,jdbcType=BIGINT}, #{sort,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},
#{serialNo,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{creator,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP}, #{updater,jdbcType=BIGINT}
)
</insert>
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.jsh.erp.datasource.entities.MaterialCategory"
>
<insert
id=
"insertSelective"
parameterType=
"com.jsh.erp.datasource.entities.MaterialCategory"
>
<!--
<!--
...
@@ -159,6 +174,30 @@
...
@@ -159,6 +174,30 @@
<if
test=
"parentid != null"
>
<if
test=
"parentid != null"
>
ParentId,
ParentId,
</if>
</if>
<if
test=
"sort != null"
>
sort,
</if>
<if
test=
"status != null"
>
status,
</if>
<if
test=
"serialNo != null"
>
serial_no,
</if>
<if
test=
"remark != null"
>
remark,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"creator != null"
>
creator,
</if>
<if
test=
"updateTime != null"
>
update_time,
</if>
<if
test=
"updater != null"
>
updater,
</if>
</trim>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
<if
test=
"id != null"
>
...
@@ -173,6 +212,30 @@
...
@@ -173,6 +212,30 @@
<if
test=
"parentid != null"
>
<if
test=
"parentid != null"
>
#{parentid,jdbcType=BIGINT},
#{parentid,jdbcType=BIGINT},
</if>
</if>
<if
test=
"sort != null"
>
#{sort,jdbcType=VARCHAR},
</if>
<if
test=
"status != null"
>
#{status,jdbcType=VARCHAR},
</if>
<if
test=
"serialNo != null"
>
#{serialNo,jdbcType=VARCHAR},
</if>
<if
test=
"remark != null"
>
#{remark,jdbcType=VARCHAR},
</if>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"creator != null"
>
#{creator,jdbcType=BIGINT},
</if>
<if
test=
"updateTime != null"
>
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updater != null"
>
#{updater,jdbcType=BIGINT},
</if>
</trim>
</trim>
</insert>
</insert>
<select
id=
"countByExample"
parameterType=
"com.jsh.erp.datasource.entities.MaterialCategoryExample"
resultType=
"java.lang.Integer"
>
<select
id=
"countByExample"
parameterType=
"com.jsh.erp.datasource.entities.MaterialCategoryExample"
resultType=
"java.lang.Integer"
>
...
@@ -204,6 +267,30 @@
...
@@ -204,6 +267,30 @@
<if
test=
"record.parentid != null"
>
<if
test=
"record.parentid != null"
>
ParentId = #{record.parentid,jdbcType=BIGINT},
ParentId = #{record.parentid,jdbcType=BIGINT},
</if>
</if>
<if
test=
"record.sort != null"
>
sort = #{record.sort,jdbcType=VARCHAR},
</if>
<if
test=
"record.status != null"
>
status = #{record.status,jdbcType=VARCHAR},
</if>
<if
test=
"record.serialNo != null"
>
serial_no = #{record.serialNo,jdbcType=VARCHAR},
</if>
<if
test=
"record.remark != null"
>
remark = #{record.remark,jdbcType=VARCHAR},
</if>
<if
test=
"record.createTime != null"
>
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"record.creator != null"
>
creator = #{record.creator,jdbcType=BIGINT},
</if>
<if
test=
"record.updateTime != null"
>
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"record.updater != null"
>
updater = #{record.updater,jdbcType=BIGINT},
</if>
</set>
</set>
<if
test=
"_parameter != null"
>
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
<include
refid=
"Update_By_Example_Where_Clause"
/>
...
@@ -218,7 +305,15 @@
...
@@ -218,7 +305,15 @@
set Id = #{record.id,jdbcType=BIGINT},
set Id = #{record.id,jdbcType=BIGINT},
Name = #{record.name,jdbcType=VARCHAR},
Name = #{record.name,jdbcType=VARCHAR},
CategoryLevel = #{record.categorylevel,jdbcType=SMALLINT},
CategoryLevel = #{record.categorylevel,jdbcType=SMALLINT},
ParentId = #{record.parentid,jdbcType=BIGINT}
ParentId = #{record.parentid,jdbcType=BIGINT},
sort = #{record.sort,jdbcType=VARCHAR},
status = #{record.status,jdbcType=VARCHAR},
serial_no = #{record.serialNo,jdbcType=VARCHAR},
remark = #{record.remark,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
creator = #{record.creator,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
updater = #{record.updater,jdbcType=BIGINT}
<if
test=
"_parameter != null"
>
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
</if>
...
@@ -239,6 +334,30 @@
...
@@ -239,6 +334,30 @@
<if
test=
"parentid != null"
>
<if
test=
"parentid != null"
>
ParentId = #{parentid,jdbcType=BIGINT},
ParentId = #{parentid,jdbcType=BIGINT},
</if>
</if>
<if
test=
"sort != null"
>
sort = #{sort,jdbcType=VARCHAR},
</if>
<if
test=
"status != null"
>
status = #{status,jdbcType=VARCHAR},
</if>
<if
test=
"serialNo != null"
>
serial_no = #{serialNo,jdbcType=VARCHAR},
</if>
<if
test=
"remark != null"
>
remark = #{remark,jdbcType=VARCHAR},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"creator != null"
>
creator = #{creator,jdbcType=BIGINT},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updater != null"
>
updater = #{updater,jdbcType=BIGINT},
</if>
</set>
</set>
where Id = #{id,jdbcType=BIGINT}
where Id = #{id,jdbcType=BIGINT}
</update>
</update>
...
@@ -250,7 +369,15 @@
...
@@ -250,7 +369,15 @@
update jsh_materialcategory
update jsh_materialcategory
set Name = #{name,jdbcType=VARCHAR},
set Name = #{name,jdbcType=VARCHAR},
CategoryLevel = #{categorylevel,jdbcType=SMALLINT},
CategoryLevel = #{categorylevel,jdbcType=SMALLINT},
ParentId = #{parentid,jdbcType=BIGINT}
ParentId = #{parentid,jdbcType=BIGINT},
sort = #{sort,jdbcType=VARCHAR},
status = #{status,jdbcType=VARCHAR},
serial_no = #{serialNo,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
creator = #{creator,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=TIMESTAMP},
updater = #{updater,jdbcType=BIGINT}
where Id = #{id,jdbcType=BIGINT}
where Id = #{id,jdbcType=BIGINT}
</update>
</update>
</mapper>
</mapper>
\ No newline at end of file
src/main/resources/mapper_xml/MaterialCategoryMapperEx.xml
View file @
6bbc0aef
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.jsh.erp.datasource.mappers.MaterialCategoryMapper"
>
<mapper
namespace=
"com.jsh.erp.datasource.mappers.MaterialCategoryMapper
Ex
"
>
<select
id=
"selectByConditionMaterialCategory"
parameterType=
"com.jsh.erp.datasource.entities.MaterialCategoryExample"
resultMap=
"BaseResultMap"
>
<select
id=
"selectByConditionMaterialCategory"
parameterType=
"com.jsh.erp.datasource.entities.MaterialCategoryExample"
resultMap=
"
com.jsh.erp.datasource.mappers.MaterialCategoryMapper.
BaseResultMap"
>
select *
select *
FROM jsh_materialcategory
FROM jsh_materialcategory
where 1=1
where 1=1
...
@@ -29,4 +29,67 @@
...
@@ -29,4 +29,67 @@
</if>
</if>
and Id !=1
and Id !=1
</select>
</select>
<resultMap
id=
"BaseTreeResultMap"
type=
"com.jsh.erp.datasource.vo.TreeNode"
>
<result
column=
"id"
property=
"id"
/>
<result
column=
"name"
property=
"text"
/>
<collection
column=
"id"
property=
"children"
javaType=
"java.util.ArrayList"
ofType=
"com.jsh.erp.datasource.vo.TreeNode"
select=
"getNextNodeTree"
/>
</resultMap>
<resultMap
id=
"NextTreeResultMap"
type=
"com.jsh.erp.datasource.vo.TreeNode"
>
<result
column=
"id"
property=
"id"
/>
<result
column=
"name"
property=
"text"
/>
<collection
column=
"id"
property=
"children"
javaType=
"java.util.ArrayList"
ofType=
"com.jsh.erp.datasource.vo.TreeNode"
select=
"getNextNodeTree"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, name
</sql>
<select
id=
"getNextNodeTree"
resultMap=
"NextTreeResultMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM jsh_materialcategory
WHERE ParentId = #{id}
and status !='2'
order by sort asc
</select>
<select
id=
"getNodeTree"
resultMap=
"BaseTreeResultMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM jsh_materialcategory
WHERE ParentId = -1
and status !='2'
order by sort asc
</select>
<insert
id=
"addMaterialCategory"
parameterType=
"com.jsh.erp.datasource.entities.MaterialCategory"
useGeneratedKeys=
"true"
keyProperty=
"id"
keyColumn=
"id"
>
insert into jsh_materialcategory
(Name, CategoryLevel, ParentId, sort,status,serial_no,remark,
create_Time, creator,update_Time, updater)
values
(#{name},#{categorylevel},#{parentid},#{sort},#{status},#{serialNo},#{remark},
#{createTime},#{creator},#{updateTime},#{updater}
)
</insert>
<update
id=
"batchDeleteMaterialCategoryByIds"
>
update jsh_materialcategory
set update_Time=#{updateTime},updater=#{updater},status='2'
where id in (
<foreach
collection=
"ids"
item=
"id"
separator=
","
>
#{id}
</foreach>
)
</update>
<update
id=
"editMaterialCategory"
>
update jsh_materialcategory
set update_Time=#{updateTime},updater=#{updater},
ParentId=#{parentid},sort=#{sort},serial_no=#{serialNo},
name=#{name},remark=#{remark}
where id =#{id}
</update>
</mapper>
</mapper>
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment