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
a07c71fd
Commit
a07c71fd
authored
Feb 28, 2019
by
乾坤平台
Committed by
季圣华
Feb 28, 2019
Browse files
!30 修改新增采购订单、销售订单的功能数据插入方式
Merge pull request !30 from 乾坤平台/master
parents
01feda93
92b3d21d
Changes
104
Show whitespace changes
Inline
Side-by-side
src/main/java/com/jsh/erp/utils/ParamUtils.java
View file @
a07c71fd
...
...
@@ -12,10 +12,32 @@ public class ParamUtils {
public
static
String
getPageOffset
(
Integer
currentPage
,
Integer
pageSize
)
{
if
(
currentPage
!=
null
&&
pageSize
!=
null
)
{
int
offset
=
(
currentPage
-
1
)
*
pageSize
;
if
(
offset
<
0
)
{
return
0
+
""
;
if
(
offset
<
=
0
)
{
return
"
0
"
;
}
else
{
return
offset
+
""
;
return
new
StringBuffer
().
append
(
offset
).
toString
();
}
}
return
null
;
}
public
static
Integer
getNumberPageOffset
(
Integer
currentPage
,
Integer
pageSize
)
{
if
(
currentPage
!=
null
&&
pageSize
!=
null
)
{
int
offset
=
(
currentPage
-
1
)
*
pageSize
;
if
(
offset
<=
0
)
{
return
0
;
}
else
{
return
offset
;
}
}
return
null
;
}
public
static
Integer
getNumberPageRows
(
Integer
currentPage
,
Integer
pageSize
)
{
if
(
currentPage
!=
null
&&
pageSize
!=
null
)
{
int
rows
=
(
currentPage
)
*
pageSize
;
if
(
rows
<=
0
)
{
return
0
;
}
else
{
return
rows
;
}
}
return
null
;
...
...
src/main/resources/application.properties
View file @
a07c71fd
...
...
@@ -15,6 +15,14 @@ logging.level.com.jsh.erp.datasource.mappers=DEBUG
#日志
logging.config
=
classpath:logback-spring.xml
logging.level.com.didispace
=
DEBUG
#pagehelper配置
pagehelper.helperDialect
=
mysql
pagehelper.offsetAsPageNum
=
true
pagehelper.rowBoundsWithCount
=
true
pagehelper.pageSizeZero
=
true
pagehelper.reasonable
=
false
pagehelper.params
=
pageNum=pageHelperStart;pageSize=pageHelperRows;
pagehelper.supportMethodsArguments
=
false
...
...
src/main/resources/mapper_xml/AccountHeadMapperEx.xml
View file @
a07c71fd
...
...
@@ -34,7 +34,7 @@
</select>
<select
id=
"countsByAccountHead"
resultType=
"java.lang.
Integer
"
>
<select
id=
"countsByAccountHead"
resultType=
"java.lang.
Long
"
>
SELECT
COUNT(id)
FROM jsh_accounthead
...
...
src/main/resources/mapper_xml/AccountItemMapperEx.xml
View file @
a07c71fd
...
...
@@ -24,7 +24,7 @@
limit #{offset},#{rows}
</if>
</select>
<select
id=
"countsByAccountItem"
resultType=
"java.lang.
Integer
"
>
<select
id=
"countsByAccountItem"
resultType=
"java.lang.
Long
"
>
SELECT
COUNT(id)
FROM jsh_accountitem
...
...
src/main/resources/mapper_xml/AccountMapperEx.xml
View file @
a07c71fd
...
...
@@ -33,7 +33,7 @@
</if>
</select>
<select
id=
"countsByAccount"
resultType=
"java.lang.
Integer
"
>
<select
id=
"countsByAccount"
resultType=
"java.lang.
Long
"
>
SELECT
COUNT(id)
FROM jsh_account
...
...
src/main/resources/mapper_xml/AppMapperEx.xml
View file @
a07c71fd
...
...
@@ -16,7 +16,7 @@
limit #{offset},#{rows}
</if>
</select>
<select
id=
"countsByApp"
resultType=
"java.lang.
Integer
"
>
<select
id=
"countsByApp"
resultType=
"java.lang.
Long
"
>
SELECT
COUNT(id)
FROM jsh_app
...
...
src/main/resources/mapper_xml/DepotHeadMapperEx.xml
View file @
a07c71fd
...
...
@@ -73,7 +73,7 @@
limit #{offset},#{rows}
</if>
</select>
<select
id=
"countsByDepotHead"
resultType=
"java.lang.
Integer
"
>
<select
id=
"countsByDepotHead"
resultType=
"java.lang.
Long
"
>
SELECT
COUNT(id)
FROM jsh_depothead
...
...
src/main/resources/mapper_xml/DepotItemMapperEx.xml
View file @
a07c71fd
...
...
@@ -59,7 +59,7 @@
limit #{offset},#{rows}
</if>
</select>
<select
id=
"countsByDepotItem"
resultType=
"java.lang.
Integer
"
>
<select
id=
"countsByDepotItem"
resultType=
"java.lang.
Long
"
>
SELECT
COUNT(id)
FROM jsh_depotitem
...
...
@@ -93,7 +93,7 @@
limit #{offset},#{rows}
</if>
</select>
<select
id=
"findDetailByTypeAndMaterialIdCounts"
resultType=
"java.lang.
Integer
"
>
<select
id=
"findDetailByTypeAndMaterialIdCounts"
resultType=
"java.lang.
Long
"
>
select count(1)
from jsh_depothead dh INNER JOIN jsh_depotitem di on dh.id=di.HeaderId where type!='其它'
and SubType!='调拨'
...
...
@@ -110,7 +110,7 @@
limit #{offset},#{rows}
</if>
</select>
<select
id=
"findStockNumByMaterialIdCounts"
resultType=
"java.lang.
Integer
"
>
<select
id=
"findStockNumByMaterialIdCounts"
resultType=
"java.lang.
Long
"
>
select count(*) from jsh_depotitem where 1=1
<if
test=
"mId != null"
>
and MaterialId=${mId}
...
...
src/main/resources/mapper_xml/DepotMapper.xml
View file @
a07c71fd
...
...
@@ -14,6 +14,7 @@
<result
column=
"type"
jdbcType=
"INTEGER"
property=
"type"
/>
<result
column=
"sort"
jdbcType=
"VARCHAR"
property=
"sort"
/>
<result
column=
"remark"
jdbcType=
"VARCHAR"
property=
"remark"
/>
<result
column=
"principal"
jdbcType=
"BIGINT"
property=
"principal"
/>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
<!--
...
...
@@ -86,7 +87,7 @@
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, name, address, warehousing, truckage, type, sort, remark
id, name, address, warehousing, truckage, type, sort, remark
, principal
</sql>
<select
id=
"selectByExample"
parameterType=
"com.jsh.erp.datasource.entities.DepotExample"
resultMap=
"BaseResultMap"
>
<!--
...
...
@@ -141,10 +142,12 @@
-->
insert into jsh_depot (id, name, address,
warehousing, truckage, type,
sort, remark)
sort, remark, principal
)
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})
#{sort,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{principal,jdbcType=BIGINT}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.jsh.erp.datasource.entities.Depot"
>
<!--
...
...
@@ -177,6 +180,9 @@
<if
test=
"remark != null"
>
remark,
</if>
<if
test=
"principal != null"
>
principal,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
...
...
@@ -203,6 +209,9 @@
<if
test=
"remark != null"
>
#{remark,jdbcType=VARCHAR},
</if>
<if
test=
"principal != null"
>
#{principal,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select
id=
"countByExample"
parameterType=
"com.jsh.erp.datasource.entities.DepotExample"
resultType=
"java.lang.Integer"
>
...
...
@@ -246,6 +255,9 @@
<if
test=
"record.remark != null"
>
remark = #{record.remark,jdbcType=VARCHAR},
</if>
<if
test=
"record.principal != null"
>
principal = #{record.principal,jdbcType=BIGINT},
</if>
</set>
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
...
...
@@ -264,7 +276,8 @@
truckage = #{record.truckage,jdbcType=DECIMAL},
type = #{record.type,jdbcType=INTEGER},
sort = #{record.sort,jdbcType=VARCHAR},
remark = #{record.remark,jdbcType=VARCHAR}
remark = #{record.remark,jdbcType=VARCHAR},
principal = #{record.principal,jdbcType=BIGINT}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
...
...
@@ -297,6 +310,9 @@
<if
test=
"remark != null"
>
remark = #{remark,jdbcType=VARCHAR},
</if>
<if
test=
"principal != null"
>
principal = #{principal,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
...
...
@@ -312,7 +328,8 @@
truckage = #{truckage,jdbcType=DECIMAL},
type = #{type,jdbcType=INTEGER},
sort = #{sort,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR}
remark = #{remark,jdbcType=VARCHAR},
principal = #{principal,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
src/main/resources/mapper_xml/DepotMapperEx.xml
View file @
a07c71fd
<?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.DepotMapperEx"
>
<resultMap
extends=
"com.jsh.erp.datasource.mappers.DepotMapper.BaseResultMap"
id=
"ResultMapEx"
type=
"com.jsh.erp.datasource.entities.DepotEx"
>
<result
column=
"principalName"
jdbcType=
"VARCHAR"
property=
"principalName"
/>
</resultMap>
<select
id=
"selectByConditionDepot"
parameterType=
"com.jsh.erp.datasource.entities.DepotExample"
resultMap=
"com.jsh.erp.datasource.mappers.DepotMapper.BaseResultMap"
>
select *
FROM jsh_depot
...
...
@@ -19,7 +23,7 @@
limit #{offset},#{rows}
</if>
</select>
<select
id=
"countsByDepot"
resultType=
"java.lang.
Integer
"
>
<select
id=
"countsByDepot"
resultType=
"java.lang.
Long
"
>
SELECT
COUNT(id)
FROM jsh_depot
...
...
@@ -34,4 +38,25 @@
and remark like '%${remark}%'
</if>
</select>
<select
id=
"getDepotList"
parameterType=
"java.util.Map"
resultMap=
"ResultMapEx"
>
select dep.*,usr.username as principalName
FROM jsh_depot dep
left join jsh_user usr on usr.id=dep.principal
where 1=1
<if
test=
"name != null and name != ''"
>
<bind
name=
"name"
value=
"'%' + _parameter.name + '%'"
/>
and dep.name like #{name}
</if>
<if
test=
"type != null and type != ''"
>
and dep.type=#{type}
</if>
<if
test=
"remark != null and remark != ''"
>
<bind
name=
"remark"
value=
"'%' + _parameter.remark + '%'"
/>
and dep.remark like #{remark}
</if>
order by dep.sort asc
</select>
</mapper>
\ No newline at end of file
src/main/resources/mapper_xml/FunctionsMapperEx.xml
View file @
a07c71fd
...
...
@@ -16,7 +16,7 @@
limit #{offset},#{rows}
</if>
</select>
<select
id=
"countsByFunctions"
resultType=
"java.lang.
Integer
"
>
<select
id=
"countsByFunctions"
resultType=
"java.lang.
Long
"
>
SELECT
COUNT(id)
FROM jsh_functions
...
...
src/main/resources/mapper_xml/InOutItemMapperEx.xml
View file @
a07c71fd
...
...
@@ -18,7 +18,7 @@
limit #{offset},#{rows}
</if>
</select>
<select
id=
"countsByInOutItem"
resultType=
"java.lang.
Integer
"
>
<select
id=
"countsByInOutItem"
resultType=
"java.lang.
Long
"
>
SELECT
COUNT(id)
FROM jsh_inoutitem
...
...
src/main/resources/mapper_xml/LogMapperEx.xml
View file @
a07c71fd
...
...
@@ -36,7 +36,7 @@
limit #{offset},#{rows}
</if>
</select>
<select
id=
"countsByLog"
resultType=
"java.lang.
Integer
"
>
<select
id=
"countsByLog"
resultType=
"java.lang.
Long
"
>
SELECT
COUNT(id)
FROM jsh_log
...
...
src/main/resources/mapper_xml/MaterialCategoryMapperEx.xml
View file @
a07c71fd
...
...
@@ -16,7 +16,7 @@
limit #{offset},#{rows}
</if>
</select>
<select
id=
"countsByMaterialCategory"
resultType=
"java.lang.
Integer
"
>
<select
id=
"countsByMaterialCategory"
resultType=
"java.lang.
Long
"
>
SELECT
COUNT(id)
FROM jsh_materialcategory
...
...
src/main/resources/mapper_xml/MaterialMapperEx.xml
View file @
a07c71fd
...
...
@@ -31,7 +31,7 @@
</if>
</select>
<select
id=
"countsByMaterial"
resultType=
"java.lang.
Integer
"
>
<select
id=
"countsByMaterial"
resultType=
"java.lang.
Long
"
>
SELECT
COUNT(m.id)
FROM jsh_material m
...
...
src/main/resources/mapper_xml/MaterialPropertyMapperEx.xml
View file @
a07c71fd
...
...
@@ -12,7 +12,7 @@
limit #{offset},#{rows}
</if>
</select>
<select
id=
"countsByMaterialProperty"
resultType=
"java.lang.
Integer
"
>
<select
id=
"countsByMaterialProperty"
resultType=
"java.lang.
Long
"
>
SELECT
COUNT(id)
FROM jsh_materialproperty
...
...
src/main/resources/mapper_xml/PersonMapperEx.xml
View file @
a07c71fd
...
...
@@ -15,7 +15,7 @@
limit #{offset},#{rows}
</if>
</select>
<select
id=
"countsByPerson"
resultType=
"java.lang.
Integer
"
>
<select
id=
"countsByPerson"
resultType=
"java.lang.
Long
"
>
SELECT
COUNT(id)
FROM jsh_person
...
...
src/main/resources/mapper_xml/RoleMapperEx.xml
View file @
a07c71fd
...
...
@@ -12,7 +12,7 @@
limit #{offset},#{rows}
</if>
;
</select>
<select
id=
"countsByRole"
resultType=
"java.lang.
Integer
"
>
<select
id=
"countsByRole"
resultType=
"java.lang.
Long
"
>
SELECT
COUNT(id)
FROM jsh_role
...
...
src/main/resources/mapper_xml/SerialNumberMapperEx.xml
View file @
a07c71fd
...
...
@@ -31,7 +31,7 @@
limit #{offset},#{rows}
</if>
</select>
<select
id=
"countSerialNumber"
resultType=
"java.lang.
Integer
"
>
<select
id=
"countSerialNumber"
resultType=
"java.lang.
Long
"
>
SELECT
COUNT(ser.id)
FROM jsh_serial_number ser
...
...
src/main/resources/mapper_xml/SupplierMapperEx.xml
View file @
a07c71fd
...
...
@@ -24,7 +24,7 @@
limit #{offset},#{rows}
</if>
</select>
<select
id=
"countsBySupplier"
resultType=
"java.lang.
Integer
"
>
<select
id=
"countsBySupplier"
resultType=
"java.lang.
Long
"
>
SELECT
COUNT(id)
FROM jsh_supplier
...
...
Prev
1
2
3
4
5
6
Next
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