表重命名:biz_document-history->biz_doc_history

master
toesbieya 6 years ago
parent c7a6d6784f
commit 6c7599acfc
  1. 12
      java/my.sql
  2. 6
      java/src/main/resources/mapper/BizDocumentHistory.xml
  3. 54
      java/src/main/resources/mapper/BizStock.xml

@ -18,10 +18,10 @@ SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for biz_document_history
-- Table structure for biz_do_history
-- ----------------------------
DROP TABLE IF EXISTS `biz_document_history`;
CREATE TABLE `biz_document_history` (
DROP TABLE IF EXISTS `biz_do_history`;
CREATE TABLE `biz_do_history` (
`id` int(20) NOT NULL AUTO_INCREMENT COMMENT '单据状态变更记录表',
`pid` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '单据ID',
`type` int(11) NOT NULL COMMENT '变更类型,0撤回,1提交,2通过,3驳回',
@ -37,10 +37,10 @@ CREATE TABLE `biz_document_history` (
) ENGINE = InnoDB AUTO_INCREMENT = 31 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of biz_document_history
-- Records of biz_do_history
-- ----------------------------
INSERT INTO `biz_document_history` VALUES (29, 'CGDD202006190001', 1, 1, 'admin', 0, 1, 1592537930953, NULL);
INSERT INTO `biz_document_history` VALUES (30, 'CGDD202006190001', 2, 1, 'admin', 1, 2, 1592537934419, NULL);
INSERT INTO `biz_do_history` VALUES (29, 'CGDD202006190001', 1, 1, 'admin', 0, 1, 1592537930953, NULL);
INSERT INTO `biz_do_history` VALUES (30, 'CGDD202006190001', 2, 1, 'admin', 1, 2, 1592537934419, NULL);
-- ----------------------------
-- Table structure for biz_purchase_inbound

@ -3,14 +3,14 @@
<mapper namespace="com.toesbieya.my.mapper.BizDocumentHistoryMapper">
<select id="getByPid" resultType="com.toesbieya.my.model.entity.BizDocumentHistory">
select *
from biz_document_history
from biz_do_history
where pid = #{pid}
order by id desc
</select>
<select id="search" resultType="com.toesbieya.my.model.entity.BizDocumentHistory"
parameterType="com.toesbieya.my.model.vo.search.DocumentHistorySearch">
select *
from biz_document_history
from biz_do_history
where 1
<if test="pid!=null and pid!=''">and pid=#{pid}</if>
<if test="uid!=null and uid!=''">and uid in (${uid})</if>
@ -20,7 +20,7 @@
</select>
<insert id="insert" parameterType="com.toesbieya.my.model.entity.BizDocumentHistory">
insert into biz_document_history (pid, type, uid, uname, status_before, status_after, time, info)
insert into biz_do_history (pid, type, uid, uname, status_before, status_after, time, info)
VALUES (#{pid}, #{type}, #{uid}, #{uname}, #{status_before}, #{status_after}, #{time}, #{info})
</insert>
</mapper>

@ -2,16 +2,38 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.toesbieya.my.mapper.BizStockMapper">
<sql id="searchCondition">
<if test="id!=null">and id=#{id}</if>
<if test="ids!=null and ids!=''">and id in (${ids})</if>
<if test="cid!=null">and cid=#{cid}</if>
<if test="cids!=null and cids!=''">and cid in (${cids})</if>
<if test="cgddid!=null and cgddid!=''">and cgddid=#{cgddid}</if>
<if test="cgddids!=null and cgddids!=''">and cgddid in (${cgddids})</if>
<if test="cgrkid!=null and cgrkid!=''">and cgrkid=#{cgrkid}</if>
<if test="cgrkids!=null and cgrkids!=''">and cgrkid in (${cgrkids})</if>
<if test="startTime!=null">and ctime <![CDATA[ >= ]]> #{startTime}</if>
<if test="endTime!=null">and ctime <![CDATA[ <= ]]> #{endTime}</if>
where 1
<if test="id != null">
and id=#{id}
</if>
<if test="ids != null and ids != ''">
and id in (${ids})
</if>
<if test="cid != null">
and cid=#{cid}
</if>
<if test="cids != null and cids != ''">
and cid in (${cids})
</if>
<if test="cgddid != null and cgddid != ''">
and cgddid=#{cgddid}
</if>
<if test="cgddids != null and cgddids != ''">
and cgddid in (${cgddids})
</if>
<if test="cgrkid != null and cgrkid != ''">
and cgrkid=#{cgrkid}
</if>
<if test="cgrkids != null and cgrkids != ''">
and cgrkid in (${cgrkids})
</if>
<if test="startTime != null">
and ctime <![CDATA[ >= ]]> #{startTime}
</if>
<if test="endTime != null">
and ctime <![CDATA[ <= ]]> #{endTime}
</if>
and num > 0
</sql>
<select id="search" parameterType="com.toesbieya.my.model.vo.search.StockSearch"
@ -21,9 +43,7 @@
sum(num) total_num,
sum(num * price) total_price
from biz_stock
where 1
<include refid="searchCondition"/>
and num >0
group by cid
</select>
@ -43,7 +63,13 @@
<select id="export" parameterType="com.toesbieya.my.model.vo.search.StockSearch"
resultType="com.toesbieya.my.model.vo.export.StockExport">
select a.cid,a.cname,a.total_num,a.total_price,b.cgddid,b.cgrkid,b.price cg_price,
select a.cid,
a.cname,
a.total_num,
a.total_price,
b.cgddid,
b.cgrkid,
b.price cg_price,
from_unixtime(b.ctime / 1000, '%Y-%m-%d %H:%m:%s') ctime,
c.num rk_num,
d.num cg_num
@ -53,9 +79,7 @@
sum(num) total_num,
sum(num * price) total_price
from biz_stock
where 1
<include refid="searchCondition"/>
and num > 0
group by cid
) a
join biz_stock b using (cid)

Loading…
Cancel
Save