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
38dbf19b
Commit
38dbf19b
authored
Apr 30, 2019
by
季圣华
Browse files
规范代码格式,采用generatorConfig.xml执行下就能自动生成
parent
1f628d75
Changes
7
Hide whitespace changes
Inline
Side-by-side
erp_web/js/pages/materials/in_out.js
View file @
38dbf19b
...
...
@@ -229,7 +229,7 @@
{
if(userdepot.indexOf("["+depot.id+"]")!=-1)
{
if
(
depot
.
is
d
efault
){
if(depot.is
D
efault){
defDepotId = depot.id;
}
options += '<option value="' + depot.id + '">' + depot.name + '</option>';
...
...
erp_web/pages/manage/depot.html
View file @
38dbf19b
...
...
@@ -183,9 +183,9 @@
{
title
:
'
负责人
'
,
field
:
'
principalName
'
,
width
:
60
},
{
title
:
'
排序
'
,
field
:
'
sort
'
,
width
:
60
},
{
title
:
'
是否默认
'
,
field
:
'
is
d
efault
'
,
width
:
100
,
align
:
"
center
"
,
title
:
'
是否默认
'
,
field
:
'
is
D
efault
'
,
width
:
100
,
align
:
"
center
"
,
formatter
:
function
(
value
,
rec
)
{
if
(
rec
.
is
d
efault
)
{
if
(
rec
.
is
D
efault
)
{
return
"
<b style='color:green'>是</b>
"
;
}
else
{
...
...
sql/jsh_erp.sql
View file @
38dbf19b
...
...
@@ -328,7 +328,6 @@ CREATE TABLE `jsh_depot` (
`type`
int
(
10
)
DEFAULT
NULL
COMMENT
'类型'
,
`sort`
varchar
(
10
)
DEFAULT
NULL
COMMENT
'排序'
,
`remark`
varchar
(
100
)
DEFAULT
NULL
COMMENT
'描述'
,
`IsDefault`
bit
(
1
)
DEFAULT
NULL
COMMENT
'是否默认'
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
7
DEFAULT
CHARSET
=
utf8
COMMENT
=
'仓库表'
;
...
...
@@ -1607,3 +1606,11 @@ ALTER TABLE jsh_log DROP FOREIGN KEY FKF2696AA13E226853;
ALTER
TABLE
jsh_material
DROP
FOREIGN
KEY
FK675951272AB6672C
;
ALTER
TABLE
jsh_material
DROP
FOREIGN
KEY
jsh_material_ibfk_1
;
-- ----------------------------
-- 时间:2019年4月30日
-- version:1.0.14
-- 此次更新
-- 删除所有外键
-- 特别提醒:之后的sql都是在之前基础上迭代,可以对已存在的系统进行数据保留更新
-- ----------------------------
alter
table
jsh_depot
add
is_default
bit
(
1
)
DEFAULT
NULL
COMMENT
'是否默认'
;
\ No newline at end of file
src/main/java/com/jsh/erp/datasource/entities/Depot.java
View file @
38dbf19b
...
...
@@ -90,15 +90,14 @@ public class Depot {
* @mbggenerated
*/
private
String
deleteFlag
;
private
Boolean
isdefault
;
public
Boolean
getIsdefault
()
{
return
isdefault
;
}
public
void
setIsdefault
(
Boolean
isdefault
)
{
this
.
isdefault
=
isdefault
;
}
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_depot.is_default
*
* @mbggenerated
*/
private
Boolean
isDefault
;
/**
* This method was generated by MyBatis Generator.
...
...
@@ -363,4 +362,28 @@ public class Depot {
public
void
setDeleteFlag
(
String
deleteFlag
)
{
this
.
deleteFlag
=
deleteFlag
==
null
?
null
:
deleteFlag
.
trim
();
}
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_depot.is_default
*
* @return the value of jsh_depot.is_default
*
* @mbggenerated
*/
public
Boolean
getIsDefault
()
{
return
isDefault
;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_depot.is_default
*
* @param isDefault the value for jsh_depot.is_default
*
* @mbggenerated
*/
public
void
setIsDefault
(
Boolean
isDefault
)
{
this
.
isDefault
=
isDefault
;
}
}
\ No newline at end of file
src/main/java/com/jsh/erp/datasource/entities/DepotExample.java
View file @
38dbf19b
...
...
@@ -235,7 +235,6 @@ public class DepotExample {
return
(
Criteria
)
this
;
}
public
Criteria
andIdIn
(
List
<
Long
>
values
)
{
addCriterion
(
"id in"
,
values
,
"id"
);
return
(
Criteria
)
this
;
...
...
@@ -665,65 +664,7 @@ public class DepotExample {
addCriterion
(
"remark <>"
,
value
,
"remark"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIsdefaultIsNull
()
{
addCriterion
(
"IsDefault is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIsdefaultIsNotNull
()
{
addCriterion
(
"IsDefault is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIsdefaultEqualTo
(
Boolean
value
)
{
addCriterion
(
"IsDefault ="
,
value
,
"isdefault"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIsdefaultNotEqualTo
(
Boolean
value
)
{
addCriterion
(
"IsDefault <>"
,
value
,
"isdefault"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIsdefaultGreaterThan
(
Boolean
value
)
{
addCriterion
(
"IsDefault >"
,
value
,
"isdefault"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIsdefaultGreaterThanOrEqualTo
(
Boolean
value
)
{
addCriterion
(
"IsDefault >="
,
value
,
"isdefault"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIsdefaultLessThan
(
Boolean
value
)
{
addCriterion
(
"IsDefault <"
,
value
,
"isdefault"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIsdefaultLessThanOrEqualTo
(
Boolean
value
)
{
addCriterion
(
"IsDefault <="
,
value
,
"isdefault"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIsdefaultIn
(
List
<
Boolean
>
values
)
{
addCriterion
(
"IsDefault in"
,
values
,
"isdefault"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIsdefaultNotIn
(
List
<
Boolean
>
values
)
{
addCriterion
(
"IsDefault not in"
,
values
,
"isdefault"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIsdefaultBetween
(
Boolean
value1
,
Boolean
value2
)
{
addCriterion
(
"IsDefault between"
,
value1
,
value2
,
"isdefault"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIsdefaultNotBetween
(
Boolean
value1
,
Boolean
value2
)
{
addCriterion
(
"IsDefault not between"
,
value1
,
value2
,
"isdefault"
);
return
(
Criteria
)
this
;
}
public
Criteria
andRemarkGreaterThan
(
String
value
)
{
addCriterion
(
"remark >"
,
value
,
"remark"
);
return
(
Criteria
)
this
;
...
...
@@ -963,6 +904,66 @@ public class DepotExample {
addCriterion
(
"delete_Flag not between"
,
value1
,
value2
,
"deleteFlag"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIsDefaultIsNull
()
{
addCriterion
(
"is_default is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIsDefaultIsNotNull
()
{
addCriterion
(
"is_default is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIsDefaultEqualTo
(
Boolean
value
)
{
addCriterion
(
"is_default ="
,
value
,
"isDefault"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIsDefaultNotEqualTo
(
Boolean
value
)
{
addCriterion
(
"is_default <>"
,
value
,
"isDefault"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIsDefaultGreaterThan
(
Boolean
value
)
{
addCriterion
(
"is_default >"
,
value
,
"isDefault"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIsDefaultGreaterThanOrEqualTo
(
Boolean
value
)
{
addCriterion
(
"is_default >="
,
value
,
"isDefault"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIsDefaultLessThan
(
Boolean
value
)
{
addCriterion
(
"is_default <"
,
value
,
"isDefault"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIsDefaultLessThanOrEqualTo
(
Boolean
value
)
{
addCriterion
(
"is_default <="
,
value
,
"isDefault"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIsDefaultIn
(
List
<
Boolean
>
values
)
{
addCriterion
(
"is_default in"
,
values
,
"isDefault"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIsDefaultNotIn
(
List
<
Boolean
>
values
)
{
addCriterion
(
"is_default not in"
,
values
,
"isDefault"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIsDefaultBetween
(
Boolean
value1
,
Boolean
value2
)
{
addCriterion
(
"is_default between"
,
value1
,
value2
,
"isDefault"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIsDefaultNotBetween
(
Boolean
value1
,
Boolean
value2
)
{
addCriterion
(
"is_default not between"
,
value1
,
value2
,
"isDefault"
);
return
(
Criteria
)
this
;
}
}
/**
...
...
@@ -1069,4 +1070,4 @@ public class DepotExample {
this
(
condition
,
value
,
secondValue
,
null
);
}
}
}
}
\ No newline at end of file
src/main/java/com/jsh/erp/service/depot/DepotService.java
View file @
38dbf19b
...
...
@@ -322,7 +322,7 @@ public class DepotService {
logService
.
insertLog
(
BusinessConstants
.
LOG_INTERFACE_NAME_DEPOT
,
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
+
depotID
,
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
());
Depot
depot
=
new
Depot
();
depot
.
setIs
d
efault
(
isDefault
);
depot
.
setIs
D
efault
(
isDefault
);
DepotExample
example
=
new
DepotExample
();
example
.
createCriteria
().
andIdEqualTo
(
depotID
);
int
result
=
0
;
...
...
src/main/resources/mapper_xml/DepotMapper.xml
View file @
38dbf19b
<?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">
<?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">
<mapper
namespace=
"com.jsh.erp.datasource.mappers.DepotMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.jsh.erp.datasource.entities.Depot"
>
<!--
...
...
@@ -17,7 +17,7 @@
<result
column=
"principal"
jdbcType=
"BIGINT"
property=
"principal"
/>
<result
column=
"tenant_id"
jdbcType=
"BIGINT"
property=
"tenantId"
/>
<result
column=
"delete_Flag"
jdbcType=
"VARCHAR"
property=
"deleteFlag"
/>
<result
column=
"
IsD
efault"
jdbcType=
"BIT"
property=
"is
d
efault"
/>
<result
column=
"
is_d
efault"
jdbcType=
"BIT"
property=
"is
D
efault"
/>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
<!--
...
...
@@ -90,8 +90,8 @@
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, name, address, warehousing, truckage, type, sort, remark, principal, tenant_id,
delete_Flag,
IsD
efault
id, name, address, warehousing, truckage, type, sort, remark, principal, tenant_id,
delete_Flag,
is_d
efault
</sql>
<select
id=
"selectByExample"
parameterType=
"com.jsh.erp.datasource.entities.DepotExample"
resultMap=
"BaseResultMap"
>
<!--
...
...
@@ -116,7 +116,7 @@
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
select
<include
refid=
"Base_Column_List"
/>
from jsh_depot
where id = #{id,jdbcType=BIGINT}
...
...
@@ -144,14 +144,16 @@
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into jsh_depot (id, name, address,
warehousing, truckage, type,
sort, remark, principal,
tenant_id, delete_Flag)
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR},
#{warehousing,jdbcType=DECIMAL}, #{truckage,jdbcType=DECIMAL}, #{type,jdbcType=INTEGER},
#{sort,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{principal,jdbcType=BIGINT},
#{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR})
insert into jsh_depot (id, name, address,
warehousing, truckage, type,
sort, remark, principal,
tenant_id, delete_Flag, is_default
)
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR},
#{warehousing,jdbcType=DECIMAL}, #{truckage,jdbcType=DECIMAL}, #{type,jdbcType=INTEGER},
#{sort,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{principal,jdbcType=BIGINT},
#{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR}, #{isDefault,jdbcType=BIT}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.jsh.erp.datasource.entities.Depot"
>
<!--
...
...
@@ -193,6 +195,9 @@
<if
test=
"deleteFlag != null"
>
delete_Flag,
</if>
<if
test=
"isDefault != null"
>
is_default,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
...
...
@@ -228,6 +233,9 @@
<if
test=
"deleteFlag != null"
>
#{deleteFlag,jdbcType=VARCHAR},
</if>
<if
test=
"isDefault != null"
>
#{isDefault,jdbcType=BIT},
</if>
</trim>
</insert>
<select
id=
"countByExample"
parameterType=
"com.jsh.erp.datasource.entities.DepotExample"
resultType=
"java.lang.Integer"
>
...
...
@@ -280,8 +288,8 @@
<if
test=
"record.deleteFlag != null"
>
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR},
</if>
<if
test=
"record.is
d
efault != null"
>
IsD
efault = #{record.is
d
efault,jdbcType=BIT},
<if
test=
"record.is
D
efault != null"
>
is_d
efault = #{record.is
D
efault,jdbcType=BIT},
</if>
</set>
<if
test=
"_parameter != null"
>
...
...
@@ -304,7 +312,8 @@
remark = #{record.remark,jdbcType=VARCHAR},
principal = #{record.principal,jdbcType=BIGINT},
tenant_id = #{record.tenantId,jdbcType=BIGINT},
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR}
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR},
is_default = #{record.isDefault,jdbcType=BIT}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
...
...
@@ -346,6 +355,9 @@
<if
test=
"deleteFlag != null"
>
delete_Flag = #{deleteFlag,jdbcType=VARCHAR},
</if>
<if
test=
"isDefault != null"
>
is_default = #{isDefault,jdbcType=BIT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
...
...
@@ -364,7 +376,8 @@
remark = #{remark,jdbcType=VARCHAR},
principal = #{principal,jdbcType=BIGINT},
tenant_id = #{tenantId,jdbcType=BIGINT},
delete_Flag = #{deleteFlag,jdbcType=VARCHAR}
delete_Flag = #{deleteFlag,jdbcType=VARCHAR},
is_default = #{isDefault,jdbcType=BIT}
where id = #{id,jdbcType=BIGINT}
</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