| | |
| | | <?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> |
| | | <if test="dictId != null"> |
| | | dict_id, |
| | | </if> |
| | | <if test="stockType != null"> |
| | | stock_type, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | create_time, |
| | | </if> |
| | | <if test="changeStock != null"> |
| | | change_stock, |
| | | </if> |
| | | <if test="supplierId != null"> |
| | | supplier_id, |
| | | </if> |
| | | <if test="isUse != null"> |
| | | is_use, |
| | | </if> |
| | | <if test="companyId != null"> |
| | | company_id, |
| | | </if> |
| | | <if test="carName != null"> |
| | | car_name, |
| | | </if> |
| | | <if test="proId != null"> |
| | | pro_id, |
| | | </if> |
| | | <if test="createUser != null"> |
| | | create_user, |
| | | </if> |
| | | <if test="byId != null"> |
| | | by_id, |
| | | </if> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="type != null"> |
| | | type, |
| | | </if> |
| | | <if test="opType != null"> |
| | | op_Type, |
| | | </if> |
| | | <if test="materialName != null"> |
| | | material_name, |
| | | </if> |
| | | <if test="materialValue != null"> |
| | | material_value, |
| | | </if> |
| | | <if test="beforeStock != null"> |
| | | before_stock, |
| | | </if> |
| | | <if test="afterStock != null"> |
| | | after_stock, |
| | | </if> |
| | | <if test="remark != null"> |
| | | remark, |
| | | </if> |
| | | <if test="pipeId != null"> |
| | | pipe_id, |
| | | </if> |
| | | <if test="pipeNum != null"> |
| | | pipe_num, |
| | | </if> |
| | | <if test="createDate != null"> |
| | | create_date, |
| | | </if> |
| | | <if test="supplierName != null"> |
| | | supplier_name, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="mixingPlantId != null"> |
| | | #{mixingPlantId}, |
| | | </if> |
| | | <if test="dictId != null"> |
| | | #{dictId}, |
| | | </if> |
| | | <if test="stockType != null"> |
| | | #{stockType}, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | #{createTime}, |
| | | </if> |
| | | <if test="changeStock != null"> |
| | | #{changeStock}, |
| | | </if> |
| | | <if test="supplierId != null"> |
| | | #{supplierId}, |
| | | </if> |
| | | <if test="isUse != null"> |
| | | #{isUse}, |
| | | </if> |
| | | <if test="companyId != null"> |
| | | #{companyId}, |
| | | </if> |
| | | <if test="carName != null"> |
| | | #{carName}, |
| | | </if> |
| | | <if test="proId != null"> |
| | | #{proId}, |
| | | </if> |
| | | <if test="createUser != null"> |
| | | #{createUser}, |
| | | </if> |
| | | <if test="byId != null"> |
| | | #{byId}, |
| | | </if> |
| | | <if test="id != null"> |
| | | #{id}, |
| | | </if> |
| | | <if test="type != null"> |
| | | #{type}, |
| | | </if> |
| | | <if test=" != null"> |
| | | #{opType}, |
| | | </if> |
| | | <if test="materialName != null"> |
| | | #{materialName}, |
| | | </if> |
| | | <if test="materialValue != null"> |
| | | #{materialValue}, |
| | | </if> |
| | | <if test="beforeStock != null"> |
| | | #{beforeStock}, |
| | | </if> |
| | | <if test="afterStock != null"> |
| | | #{afterStock}, |
| | | </if> |
| | | <if test="remark != null"> |
| | | #{remark}, |
| | | </if> |
| | | <if test="pipeId != null"> |
| | | #{pipeId}, |
| | | </if> |
| | | <if test="pipeNum != null"> |
| | | #{pipeNum}, |
| | | </if> |
| | | <if test="createDate != null"> |
| | | #{createDate}, |
| | | </if> |
| | | <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, |
| | | b.dict_name dictName, |
| | | a.change_stock 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 |
| | | LEFT JOIN sys_users d ON d.user_id = a.create_user |
| | | WHERE a.is_use = 1 and company_id = #{companyId} |
| | | <if test="dictId != null and dictId != ''"> |
| | | AND a.dict_id = #{dictId} |
| | | </if> |
| | | <if test="supplierId != null and supplierId != ''"> |
| | | AND a.supplier_id = #{supplierId} |
| | | </if> |
| | | <if test="startTime != null and startTime != '' and endTime != null and endTime != ''"> |
| | | AND a.create_time BETWEEN #{startTime} AND #{endTime} |
| | | </if> |
| | | order by a.create_time desc |
| | | SELECT |
| | | DATE_FORMAT(a.create_date, '%Y-%m-%d %H:%i:%S') createDate, |
| | | b.dict_name dictName, |
| | | a.material_value changeStock, |
| | | d.real_name username, |
| | | '吨' 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.op_type =1 and a.company_id = #{companyId} |
| | | <if test="dictId != null and dictId != ''"> |
| | | AND a.material_name = #{dictId} |
| | | </if> |
| | | <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_date BETWEEN #{startTime} AND #{endTime} |
| | | </if> |
| | | order by a.create_date desc |
| | | </select> |
| | | |
| | | <!-- 库存管理 --> |