15030600271
2023-11-24 ffc386a33619df27c620f293ed0ec4c3ef17d506
20231124_qiuyh_查询搅拌站入库记录
已修改3个文件
157 ■■■■ 文件已修改
hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/mixingstationstorage/dto/MinXingPlantDto.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/mixingstationstorage/entity/MinXingPlantVo.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/materialsManage/src/main/resources/mapping/MinXingPlantMapper.xml 139 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/mixingstationstorage/dto/MinXingPlantDto.java
@@ -11,9 +11,10 @@
public class MinXingPlantDto {
    private String dictId;//    管片原料类型(字典表)
    private String companyId;//分公司id
    private String supplierId;//供应商ID
    private String supplierName;//供应商ID
    private String startTime;
    private String endTime;
    private Integer pageNum;
    private Integer pageSize;
}
hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/mixingstationstorage/entity/MinXingPlantVo.java
@@ -27,7 +27,7 @@
    private Integer byId;//序号
    @Excel(sort = 1,title = "入库时间")
    private String createDate;//字符串的入库时间
    private Date createDate;//字符串的入库时间
    @Excel(sort = 2,title = "供应商")
    private String supplierName;//供应商名称
@@ -43,4 +43,17 @@
    @Excel(sort = 6,title = "入库人")
    private String username;
    private String id;
    private Integer type;
    private Integer opType;
    private String materialName;
    private double materialValue;
    private double beforeStock;
    private double afterStock;
    private String remark;
    private String pipeId;
    private String pipeNum;
}
hd/pipe/materialsManage/src/main/resources/mapping/MinXingPlantMapper.xml
@@ -1,125 +1,110 @@
<?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.thhy.materials.modules.biz.mixingstationstorage.mapper.MinXingPlantMapper">
  <resultMap id="BaseResultMap" type="com.thhy.materials.modules.biz.mixingstationstorage.entity.MinXingPlantVo">
    <id column="mixing_plant_id" jdbcType="VARCHAR" property="mixingPlantId" />
    <result column="dict_id" jdbcType="VARCHAR" property="dictId" />
    <result column="stock_type" jdbcType="INTEGER" property="stockType" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="change_stock" jdbcType="DOUBLE" property="changeStock" />
    <result column="supplier_id" jdbcType="VARCHAR" property="supplierId" />
    <result column="is_use" jdbcType="INTEGER" property="isUse" />
    <result column="company_id" jdbcType="VARCHAR" property="companyId" />
    <result column="car_name" jdbcType="VARCHAR" property="carName" />
    <result column="pro_id" jdbcType="VARCHAR" property="proId" />
    <result column="create_user" jdbcType="VARCHAR" property="createUser" />
    <result column="by_id" jdbcType="INTEGER" property="byId" />
  </resultMap>
  <insert id="insert" >
    insert into t_minxing_plant
    insert into t_material_stock_record
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="mixingPlantId != null">
        mixing_plant_id,
        <if test="id != null">
            id,
      </if>
      <if test="dictId != null">
        dict_id,
        <if test="type != null">
            type,
      </if>
      <if test="stockType != null">
        stock_type,
        <if test="opType != null">
            op_Type,
      </if>
      <if test="createTime != null">
        create_time,
        <if test="materialName != null">
            material_name,
      </if>
      <if test="changeStock != null">
        change_stock,
        <if test="materialValue != null">
            material_value,
      </if>
      <if test="supplierId != null">
        supplier_id,
        <if test="beforeStock != null">
            before_stock,
      </if>
      <if test="isUse != null">
        is_use,
        <if test="afterStock != null">
            after_stock,
      </if>
      <if test="companyId != null">
        company_id,
        <if test="remark != null">
            remark,
      </if>
      <if test="carName != null">
        car_name,
        <if test="pipeId != null">
            pipe_id,
      </if>
      <if test="proId != null">
        pro_id,
        <if test="pipeNum != null">
            pipe_num,
      </if>
      <if test="createUser != null">
        create_user,
        <if test="createDate != null">
            create_date,
      </if>
      <if test="byId != null">
        by_id,
        <if test="supplierName != null">
            supplier_name,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="mixingPlantId != null">
        #{mixingPlantId},
        <if test="id != null">
            #{id},
      </if>
      <if test="dictId != null">
        #{dictId},
        <if test="type != null">
            #{type},
      </if>
      <if test="stockType != null">
        #{stockType},
        <if test=" != null">
            #{opType},
      </if>
      <if test="createTime != null">
        #{createTime},
        <if test="materialName != null">
            #{materialName},
      </if>
      <if test="changeStock != null">
        #{changeStock},
        <if test="materialValue != null">
            #{materialValue},
      </if>
      <if test="supplierId != null">
        #{supplierId},
        <if test="beforeStock != null">
            #{beforeStock},
      </if>
      <if test="isUse != null">
        #{isUse},
        <if test="afterStock != null">
            #{afterStock},
      </if>
      <if test="companyId != null">
        #{companyId},
        <if test="remark != null">
            #{remark},
      </if>
      <if test="carName != null">
        #{carName},
        <if test="pipeId != null">
            #{pipeId},
      </if>
      <if test="proId != null">
        #{proId},
        <if test="pipeNum != null">
            #{pipeNum},
      </if>
      <if test="createUser != null">
        #{createUser},
        <if test="createDate != null">
            #{createDate},
      </if>
      <if test="byId != null">
        #{byId},
        <if test="supplierName != null">
            #{supplierName},
      </if>
    </trim>
  </insert>
  <select id="selectAllList" parameterType="com.thhy.materials.modules.biz.mixingstationstorage.dto.MinXingPlantDto" resultType="com.thhy.materials.modules.biz.mixingstationstorage.entity.MinXingPlantVo">
    SELECT
            DATE_FORMAT(a.create_time, '%Y-%m-%d %H:%i:%S') createDate,
            c.supplier_name supplierName,
          DATE_FORMAT(a.create_date, '%Y-%m-%d %H:%i:%S') createDate,
            b.dict_name dictName,
            a.change_stock changeStock,
          a.material_value changeStock,
            d.real_name username,
            '吨' unit
    FROM t_minxing_plant a
                 LEFT JOIN sys_dict b ON b.dict_id = a.dict_id
                 LEFT JOIN sys_supplier c ON c.id = a.supplier_id
          '吨' unit,
          a.supplier_name supplierName
      FROM t_material_stock_record a
      LEFT JOIN sys_dict b ON b.dict_id = a.material_name
                 LEFT JOIN sys_users d ON d.user_id = a.create_user
    WHERE a.is_use = 1 and company_id = #{companyId}
      where
      a.op_type =1  and a.company_id = #{companyId}
    <if test="dictId != null and dictId != ''">
      AND a.dict_id = #{dictId}
          AND a.material_name = #{dictId}
    </if>
    <if test="supplierId != null and supplierId != ''">
      AND a.supplier_id = #{supplierId}
      <if test="supplierName != null and supplierName != ''">
          AND a.supplier_name regexp #{supplierName}
    </if>
    <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
      AND a.create_time BETWEEN #{startTime} AND #{endTime}
          AND a.create_date BETWEEN #{startTime} AND #{endTime}
    </if>
    order by a.create_time desc
      order by a.create_date desc
  </select>
  <!--  库存管理 -->