新增自定义库存明细汇总
							parent
							
								
									4508e48438
								
							
						
					
					
						commit
						5fad9e2835
					
				| @ -0,0 +1,24 @@ | ||||
| package com.glxp.api.dao.inout; | ||||
| 
 | ||||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||||
| import com.glxp.api.entity.inout.IoStatDayEntity; | ||||
| import com.glxp.api.entity.inout.IoStatDetailEntity; | ||||
| import com.glxp.api.req.inout.FilterStatDataDetailRequest; | ||||
| import org.apache.ibatis.annotations.Mapper; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| @Mapper | ||||
| public interface IoStatDetailMapper extends BaseMapper<IoStatDetailEntity> { | ||||
| 
 | ||||
|     /** | ||||
|      * 查询日汇总数据列表 | ||||
|      * | ||||
|      * @param statDataDetailRequest | ||||
|      * @return | ||||
|      */ | ||||
|     List<IoStatDetailEntity> filterList(FilterStatDataDetailRequest statDataDetailRequest); | ||||
| 
 | ||||
|     List<IoStatDetailEntity> filterListByRecordKey(String recordKey); | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,156 @@ | ||||
| package com.glxp.api.entity.inout; | ||||
| 
 | ||||
| import com.baomidou.mybatisplus.annotation.IdType; | ||||
| import com.baomidou.mybatisplus.annotation.TableField; | ||||
| import com.baomidou.mybatisplus.annotation.TableId; | ||||
| import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import java.io.Serializable; | ||||
| import java.math.BigDecimal; | ||||
| import java.util.Date; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| @ApiModel(value = "com-glxp-api-entity-inout-IoStatDetail") | ||||
| @Data | ||||
| @TableName(value = "io_stat_detail") | ||||
| public class IoStatDetailEntity implements Serializable { | ||||
|     @TableId(value = "id", type = IdType.INPUT) | ||||
|     @ApiModelProperty(value = "") | ||||
|     private Integer id; | ||||
| 
 | ||||
|     /** | ||||
|      * 汇总记录号 | ||||
|      */ | ||||
|     @TableField(value = "recordKeyFk") | ||||
|     @ApiModelProperty(value = "汇总记录号") | ||||
|     private String recordKeyFk; | ||||
| 
 | ||||
|     /** | ||||
|      * 物资编码主键 | ||||
|      */ | ||||
|     @TableField(value = "relIdFk") | ||||
|     @ApiModelProperty(value = "物资编码主键") | ||||
|     private String relIdFk; | ||||
| 
 | ||||
|     /** | ||||
|      * 产品DI | ||||
|      */ | ||||
|     @TableField(value = "nameCode") | ||||
|     @ApiModelProperty(value = "产品DI") | ||||
|     private String nameCode; | ||||
| 
 | ||||
|     /** | ||||
|      * 产品名称 | ||||
|      */ | ||||
|     @TableField(value = "productName") | ||||
|     @ApiModelProperty(value = "产品名称") | ||||
|     private String productName; | ||||
| 
 | ||||
|     /** | ||||
|      * 规格型号 | ||||
|      */ | ||||
|     @TableField(value = "ggxh") | ||||
|     @ApiModelProperty(value = "规格型号") | ||||
|     private String ggxh; | ||||
| 
 | ||||
|     /** | ||||
|      * 批次号 | ||||
|      */ | ||||
|     @TableField(value = "batchNo") | ||||
|     @ApiModelProperty(value = "批次号") | ||||
|     private Integer batchNo; | ||||
| 
 | ||||
|     /** | ||||
|      * 入库数量 | ||||
|      */ | ||||
|     @TableField(value = "inCount") | ||||
|     @ApiModelProperty(value = "入库数量") | ||||
|     private String inCount; | ||||
| 
 | ||||
|     /** | ||||
|      * 入库价格 | ||||
|      */ | ||||
|     @TableField(value = "inPrice") | ||||
|     @ApiModelProperty(value = "入库价格") | ||||
|     private BigDecimal inPrice; | ||||
| 
 | ||||
|     /** | ||||
|      * 入库金额 | ||||
|      */ | ||||
|     @TableField(value = "inAmount") | ||||
|     @ApiModelProperty(value = "入库金额") | ||||
|     private String inAmount; | ||||
| 
 | ||||
|     /** | ||||
|      * 出库数量 | ||||
|      */ | ||||
|     @TableField(value = "outCount") | ||||
|     @ApiModelProperty(value = "出库数量") | ||||
|     private String outCount; | ||||
| 
 | ||||
|     /** | ||||
|      * 出库价格 | ||||
|      */ | ||||
|     @TableField(value = "outPrice") | ||||
|     @ApiModelProperty(value = "出库价格") | ||||
|     private BigDecimal outPrice; | ||||
| 
 | ||||
|     /** | ||||
|      * 出库金额 | ||||
|      */ | ||||
|     @TableField(value = "outAmount") | ||||
|     @ApiModelProperty(value = "出库金额") | ||||
|     private String outAmount; | ||||
| 
 | ||||
|     /** | ||||
|      * 结余数量 | ||||
|      */ | ||||
|     @TableField(value = "balanceCount") | ||||
|     @ApiModelProperty(value = "结余数量") | ||||
|     private String balanceCount; | ||||
| 
 | ||||
|     /** | ||||
|      * 结余价格 | ||||
|      */ | ||||
|     @TableField(value = "balancePrice") | ||||
|     @ApiModelProperty(value = "结余价格") | ||||
|     private BigDecimal balancePrice; | ||||
| 
 | ||||
|     /** | ||||
|      * 结余金额 | ||||
|      */ | ||||
|     @TableField(value = "balanceAmount") | ||||
|     @ApiModelProperty(value = "结余金额") | ||||
|     private String balanceAmount; | ||||
| 
 | ||||
|     /** | ||||
|      * 备注 | ||||
|      */ | ||||
|     @TableField(value = "remark") | ||||
|     @ApiModelProperty(value = "备注") | ||||
|     private String remark; | ||||
| 
 | ||||
|     /** | ||||
|      * 更新时间 | ||||
|      */ | ||||
|     @TableField(value = "updateTime") | ||||
|     @ApiModelProperty(value = "更新时间") | ||||
|     private Date updateTime; | ||||
| 
 | ||||
|     /** | ||||
|      * 部门 | ||||
|      */ | ||||
|     @TableField(value = "deptCode") | ||||
|     @ApiModelProperty(value = "部门") | ||||
|     private String deptCode; | ||||
| 
 | ||||
|     /** | ||||
|      * 仓库 | ||||
|      */ | ||||
|     @TableField(value = "invCode") | ||||
|     @ApiModelProperty(value = "仓库") | ||||
|     private String invCode; | ||||
| 
 | ||||
|     private static final long serialVersionUID = 1L; | ||||
| } | ||||
| @ -0,0 +1,36 @@ | ||||
| package com.glxp.api.service.inout; | ||||
| 
 | ||||
| import com.github.pagehelper.PageHelper; | ||||
| import com.glxp.api.entity.inout.IoStatDayEntity; | ||||
| import com.glxp.api.entity.inout.IoStatDetailEntity; | ||||
| import com.glxp.api.req.inout.FilterStatDataDetailRequest; | ||||
| import org.springframework.stereotype.Service; | ||||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||||
| import com.glxp.api.dao.inout.IoStatDetailMapper; | ||||
| 
 | ||||
| import javax.annotation.Resource; | ||||
| import java.util.Collections; | ||||
| import java.util.List; | ||||
| 
 | ||||
| @Service | ||||
| public class IoStatDetailService extends ServiceImpl<IoStatDetailMapper, IoStatDetailEntity> { | ||||
| 
 | ||||
|     @Resource | ||||
|     IoStatDetailMapper statDetailMapper; | ||||
| 
 | ||||
|     public List<IoStatDetailEntity> filterList(FilterStatDataDetailRequest statDataDetailRequest) { | ||||
|         if (null == statDataDetailRequest) { | ||||
|             return Collections.emptyList(); | ||||
|         } | ||||
|         if (null != statDataDetailRequest.getPage() && null != statDataDetailRequest.getLimit()) { | ||||
|             PageHelper.offsetPage((statDataDetailRequest.getPage() - 1) * statDataDetailRequest.getLimit(), statDataDetailRequest.getLimit()); | ||||
|         } | ||||
|         return statDetailMapper.filterList(statDataDetailRequest); | ||||
|     } | ||||
| 
 | ||||
|     public List<IoStatDetailEntity> filterListByRecordKey(String recordKey) { | ||||
|         return statDetailMapper.filterListByRecordKey(recordKey); | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| @ -0,0 +1,59 @@ | ||||
| <?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.glxp.api.dao.inout.IoStatDetailMapper"> | ||||
|     <resultMap id="BaseResultMap" type="com.glxp.api.entity.inout.IoStatDetailEntity"> | ||||
|         <!--@mbg.generated--> | ||||
|         <!--@Table io_stat_detail--> | ||||
|         <id column="id" jdbcType="INTEGER" property="id"/> | ||||
|         <result column="recordKeyFk" jdbcType="VARCHAR" property="recordKeyFk"/> | ||||
|         <result column="relIdFk" jdbcType="VARCHAR" property="relIdFk"/> | ||||
|         <result column="nameCode" jdbcType="VARCHAR" property="nameCode"/> | ||||
|         <result column="productName" jdbcType="VARCHAR" property="productName"/> | ||||
|         <result column="ggxh" jdbcType="VARCHAR" property="ggxh"/> | ||||
|         <result column="batchNo" jdbcType="INTEGER" property="batchNo"/> | ||||
|         <result column="inCount" jdbcType="VARCHAR" property="inCount"/> | ||||
|         <result column="inPrice" jdbcType="DECIMAL" property="inPrice"/> | ||||
|         <result column="inAmount" jdbcType="VARCHAR" property="inAmount"/> | ||||
|         <result column="outCount" jdbcType="VARCHAR" property="outCount"/> | ||||
|         <result column="outPrice" jdbcType="DECIMAL" property="outPrice"/> | ||||
|         <result column="outAmount" jdbcType="VARCHAR" property="outAmount"/> | ||||
|         <result column="balanceCount" jdbcType="VARCHAR" property="balanceCount"/> | ||||
|         <result column="balancePrice" jdbcType="DECIMAL" property="balancePrice"/> | ||||
|         <result column="balanceAmount" jdbcType="VARCHAR" property="balanceAmount"/> | ||||
|         <result column="remark" jdbcType="VARCHAR" property="remark"/> | ||||
|         <result column="updateTime" jdbcType="TIMESTAMP" property="updateTime"/> | ||||
|         <result column="deptCode" jdbcType="VARCHAR" property="deptCode"/> | ||||
|         <result column="invCode" jdbcType="VARCHAR" property="invCode"/> | ||||
|     </resultMap> | ||||
|     <sql id="Base_Column_List"> | ||||
|         <!--@mbg.generated--> | ||||
|         id, recordKeyFk, relIdFk, nameCode, productName, ggxh, batchNo, inCount, inPrice, | ||||
|         inAmount, outCount, outPrice, outAmount, balanceCount, balancePrice, balanceAmount, | ||||
|         remark, updateTime, deptCode, invCode | ||||
|     </sql> | ||||
| 
 | ||||
|     <select id="filterList" resultType="com.glxp.api.entity.inout.IoStatDetailEntity"> | ||||
|         select *, (SELECT NAME FROM auth_dept WHERE io_stat_detail.deptCode = auth_dept.CODE) deptName | ||||
|         from io_stat_detail | ||||
|         <where> | ||||
|             <if test="recordKey != null and recordKey != ''"> | ||||
|                 AND recordKeyFk = #{recordKey} | ||||
|             </if> | ||||
|             <if test="batchNo != null and batchNo != ''"> | ||||
|                 AND batchNo like concat('%', #{batchNo}, '%') | ||||
|             </if> | ||||
|             <if test="productName != null and productName != ''"> | ||||
|                 AND productName like concat('%', #{productName}, '%') | ||||
|             </if> | ||||
|             <if test="ggxh != null and ggxh != ''"> | ||||
|                 AND ggxh like concat('%', #{ggxh}, '%') | ||||
|             </if> | ||||
|         </where> | ||||
|     </select> | ||||
| 
 | ||||
|     <select id="filterListByRecordKey" resultType="com.glxp.api.entity.inout.IoStatDetailEntity"> | ||||
|         select *, (SELECT NAME FROM auth_dept WHERE io_stat_detail.deptCode = auth_dept.CODE) deptName | ||||
|         from io_stat_detail | ||||
|         where recordKeyFk = #{recordKey} | ||||
|     </select> | ||||
| </mapper> | ||||
					Loading…
					
					
				
		Reference in New Issue