Commit a07c71fd authored by 乾坤平台's avatar 乾坤平台 Committed by 季圣华
Browse files

!30 修改新增采购订单、销售订单的功能数据插入方式

Merge pull request !30 from 乾坤平台/master
parents 01feda93 92b3d21d
......@@ -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;
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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}
......
......@@ -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
<?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
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment