"litemall-wx-api/src/vscode:/vscode.git/clone" did not exist on "f142c661b0b9915fbeaf80962b7b59ed9f1b09f6"
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 { ...@@ -12,10 +12,32 @@ public class ParamUtils {
public static String getPageOffset(Integer currentPage, Integer pageSize) { public static String getPageOffset(Integer currentPage, Integer pageSize) {
if (currentPage != null && pageSize != null) { if (currentPage != null && pageSize != null) {
int offset = (currentPage - 1) * pageSize; int offset = (currentPage - 1) * pageSize;
if (offset < 0) { if (offset <= 0) {
return 0 + ""; return "0";
} else { } 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; return null;
......
...@@ -15,6 +15,14 @@ logging.level.com.jsh.erp.datasource.mappers=DEBUG ...@@ -15,6 +15,14 @@ logging.level.com.jsh.erp.datasource.mappers=DEBUG
#日志 #日志
logging.config=classpath:logback-spring.xml logging.config=classpath:logback-spring.xml
logging.level.com.didispace=DEBUG 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 @@ ...@@ -34,7 +34,7 @@
</select> </select>
<select id="countsByAccountHead" resultType="java.lang.Integer"> <select id="countsByAccountHead" resultType="java.lang.Long">
SELECT SELECT
COUNT(id) COUNT(id)
FROM jsh_accounthead FROM jsh_accounthead
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
limit #{offset},#{rows} limit #{offset},#{rows}
</if> </if>
</select> </select>
<select id="countsByAccountItem" resultType="java.lang.Integer"> <select id="countsByAccountItem" resultType="java.lang.Long">
SELECT SELECT
COUNT(id) COUNT(id)
FROM jsh_accountitem FROM jsh_accountitem
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
</if> </if>
</select> </select>
<select id="countsByAccount" resultType="java.lang.Integer"> <select id="countsByAccount" resultType="java.lang.Long">
SELECT SELECT
COUNT(id) COUNT(id)
FROM jsh_account FROM jsh_account
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
limit #{offset},#{rows} limit #{offset},#{rows}
</if> </if>
</select> </select>
<select id="countsByApp" resultType="java.lang.Integer"> <select id="countsByApp" resultType="java.lang.Long">
SELECT SELECT
COUNT(id) COUNT(id)
FROM jsh_app FROM jsh_app
......
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
limit #{offset},#{rows} limit #{offset},#{rows}
</if> </if>
</select> </select>
<select id="countsByDepotHead" resultType="java.lang.Integer"> <select id="countsByDepotHead" resultType="java.lang.Long">
SELECT SELECT
COUNT(id) COUNT(id)
FROM jsh_depothead FROM jsh_depothead
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
limit #{offset},#{rows} limit #{offset},#{rows}
</if> </if>
</select> </select>
<select id="countsByDepotItem" resultType="java.lang.Integer"> <select id="countsByDepotItem" resultType="java.lang.Long">
SELECT SELECT
COUNT(id) COUNT(id)
FROM jsh_depotitem FROM jsh_depotitem
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
limit #{offset},#{rows} limit #{offset},#{rows}
</if> </if>
</select> </select>
<select id="findDetailByTypeAndMaterialIdCounts" resultType="java.lang.Integer"> <select id="findDetailByTypeAndMaterialIdCounts" resultType="java.lang.Long">
select count(1) select count(1)
from jsh_depothead dh INNER JOIN jsh_depotitem di on dh.id=di.HeaderId where type!='其它' from jsh_depothead dh INNER JOIN jsh_depotitem di on dh.id=di.HeaderId where type!='其它'
and SubType!='调拨' and SubType!='调拨'
...@@ -110,7 +110,7 @@ ...@@ -110,7 +110,7 @@
limit #{offset},#{rows} limit #{offset},#{rows}
</if> </if>
</select> </select>
<select id="findStockNumByMaterialIdCounts" resultType="java.lang.Integer"> <select id="findStockNumByMaterialIdCounts" resultType="java.lang.Long">
select count(*) from jsh_depotitem where 1=1 select count(*) from jsh_depotitem where 1=1
<if test="mId != null"> <if test="mId != null">
and MaterialId=${mId} and MaterialId=${mId}
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
<result column="type" jdbcType="INTEGER" property="type" /> <result column="type" jdbcType="INTEGER" property="type" />
<result column="sort" jdbcType="VARCHAR" property="sort" /> <result column="sort" jdbcType="VARCHAR" property="sort" />
<result column="remark" jdbcType="VARCHAR" property="remark" /> <result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="principal" jdbcType="BIGINT" property="principal" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<!-- <!--
...@@ -86,7 +87,7 @@ ...@@ -86,7 +87,7 @@
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, address, warehousing, truckage, type, sort, remark id, name, address, warehousing, truckage, type, sort, remark, principal
</sql> </sql>
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.DepotExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.DepotExample" resultMap="BaseResultMap">
<!-- <!--
...@@ -141,10 +142,12 @@ ...@@ -141,10 +142,12 @@
--> -->
insert into jsh_depot (id, name, address, insert into jsh_depot (id, name, address,
warehousing, truckage, type, warehousing, truckage, type,
sort, remark) sort, remark, principal
)
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR},
#{warehousing,jdbcType=DECIMAL}, #{truckage,jdbcType=DECIMAL}, #{type,jdbcType=INTEGER}, #{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>
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.Depot"> <insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.Depot">
<!-- <!--
...@@ -177,6 +180,9 @@ ...@@ -177,6 +180,9 @@
<if test="remark != null"> <if test="remark != null">
remark, remark,
</if> </if>
<if test="principal != null">
principal,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null"> <if test="id != null">
...@@ -203,6 +209,9 @@ ...@@ -203,6 +209,9 @@
<if test="remark != null"> <if test="remark != null">
#{remark,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
</if> </if>
<if test="principal != null">
#{principal,jdbcType=BIGINT},
</if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="com.jsh.erp.datasource.entities.DepotExample" resultType="java.lang.Integer"> <select id="countByExample" parameterType="com.jsh.erp.datasource.entities.DepotExample" resultType="java.lang.Integer">
...@@ -246,6 +255,9 @@ ...@@ -246,6 +255,9 @@
<if test="record.remark != null"> <if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR}, remark = #{record.remark,jdbcType=VARCHAR},
</if> </if>
<if test="record.principal != null">
principal = #{record.principal,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" />
...@@ -264,7 +276,8 @@ ...@@ -264,7 +276,8 @@
truckage = #{record.truckage,jdbcType=DECIMAL}, truckage = #{record.truckage,jdbcType=DECIMAL},
type = #{record.type,jdbcType=INTEGER}, type = #{record.type,jdbcType=INTEGER},
sort = #{record.sort,jdbcType=VARCHAR}, sort = #{record.sort,jdbcType=VARCHAR},
remark = #{record.remark,jdbcType=VARCHAR} remark = #{record.remark,jdbcType=VARCHAR},
principal = #{record.principal,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>
...@@ -297,6 +310,9 @@ ...@@ -297,6 +310,9 @@
<if test="remark != null"> <if test="remark != null">
remark = #{remark,jdbcType=VARCHAR}, remark = #{remark,jdbcType=VARCHAR},
</if> </if>
<if test="principal != null">
principal = #{principal,jdbcType=BIGINT},
</if>
</set> </set>
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
...@@ -312,7 +328,8 @@ ...@@ -312,7 +328,8 @@
truckage = #{truckage,jdbcType=DECIMAL}, truckage = #{truckage,jdbcType=DECIMAL},
type = #{type,jdbcType=INTEGER}, type = #{type,jdbcType=INTEGER},
sort = #{sort,jdbcType=VARCHAR}, sort = #{sort,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR} remark = #{remark,jdbcType=VARCHAR},
principal = #{principal,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
</mapper> </mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "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.DepotMapperEx"> <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 id="selectByConditionDepot" parameterType="com.jsh.erp.datasource.entities.DepotExample" resultMap="com.jsh.erp.datasource.mappers.DepotMapper.BaseResultMap">
select * select *
FROM jsh_depot FROM jsh_depot
...@@ -19,7 +23,7 @@ ...@@ -19,7 +23,7 @@
limit #{offset},#{rows} limit #{offset},#{rows}
</if> </if>
</select> </select>
<select id="countsByDepot" resultType="java.lang.Integer"> <select id="countsByDepot" resultType="java.lang.Long">
SELECT SELECT
COUNT(id) COUNT(id)
FROM jsh_depot FROM jsh_depot
...@@ -34,4 +38,25 @@ ...@@ -34,4 +38,25 @@
and remark like '%${remark}%' and remark like '%${remark}%'
</if> </if>
</select> </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> </mapper>
\ No newline at end of file
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
limit #{offset},#{rows} limit #{offset},#{rows}
</if> </if>
</select> </select>
<select id="countsByFunctions" resultType="java.lang.Integer"> <select id="countsByFunctions" resultType="java.lang.Long">
SELECT SELECT
COUNT(id) COUNT(id)
FROM jsh_functions FROM jsh_functions
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
limit #{offset},#{rows} limit #{offset},#{rows}
</if> </if>
</select> </select>
<select id="countsByInOutItem" resultType="java.lang.Integer"> <select id="countsByInOutItem" resultType="java.lang.Long">
SELECT SELECT
COUNT(id) COUNT(id)
FROM jsh_inoutitem FROM jsh_inoutitem
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
limit #{offset},#{rows} limit #{offset},#{rows}
</if> </if>
</select> </select>
<select id="countsByLog" resultType="java.lang.Integer"> <select id="countsByLog" resultType="java.lang.Long">
SELECT SELECT
COUNT(id) COUNT(id)
FROM jsh_log FROM jsh_log
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
limit #{offset},#{rows} limit #{offset},#{rows}
</if> </if>
</select> </select>
<select id="countsByMaterialCategory" resultType="java.lang.Integer"> <select id="countsByMaterialCategory" resultType="java.lang.Long">
SELECT SELECT
COUNT(id) COUNT(id)
FROM jsh_materialcategory FROM jsh_materialcategory
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
</if> </if>
</select> </select>
<select id="countsByMaterial" resultType="java.lang.Integer"> <select id="countsByMaterial" resultType="java.lang.Long">
SELECT SELECT
COUNT(m.id) COUNT(m.id)
FROM jsh_material m FROM jsh_material m
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
limit #{offset},#{rows} limit #{offset},#{rows}
</if> </if>
</select> </select>
<select id="countsByMaterialProperty" resultType="java.lang.Integer"> <select id="countsByMaterialProperty" resultType="java.lang.Long">
SELECT SELECT
COUNT(id) COUNT(id)
FROM jsh_materialproperty FROM jsh_materialproperty
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
limit #{offset},#{rows} limit #{offset},#{rows}
</if> </if>
</select> </select>
<select id="countsByPerson" resultType="java.lang.Integer"> <select id="countsByPerson" resultType="java.lang.Long">
SELECT SELECT
COUNT(id) COUNT(id)
FROM jsh_person FROM jsh_person
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
limit #{offset},#{rows} limit #{offset},#{rows}
</if>; </if>;
</select> </select>
<select id="countsByRole" resultType="java.lang.Integer"> <select id="countsByRole" resultType="java.lang.Long">
SELECT SELECT
COUNT(id) COUNT(id)
FROM jsh_role FROM jsh_role
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
limit #{offset},#{rows} limit #{offset},#{rows}
</if> </if>
</select> </select>
<select id="countSerialNumber" resultType="java.lang.Integer"> <select id="countSerialNumber" resultType="java.lang.Long">
SELECT SELECT
COUNT(ser.id) COUNT(ser.id)
FROM jsh_serial_number ser FROM jsh_serial_number ser
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
limit #{offset},#{rows} limit #{offset},#{rows}
</if> </if>
</select> </select>
<select id="countsBySupplier" resultType="java.lang.Integer"> <select id="countsBySupplier" resultType="java.lang.Long">
SELECT SELECT
COUNT(id) COUNT(id)
FROM jsh_supplier 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