邱宇豪
2023-11-27 b1c00ede50ba51a46b1cfbcdf129f1e68b228e6c
hd/pipe/materialsManage/src/main/resources/mapping/SuMaterialWarehouseMapper.xml
@@ -4,8 +4,14 @@
  <insert id="insertAndUpdate">
    insert ignore into t_su_material_warehouse_record
    insert into t_su_material_warehouse_record
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="nameOfOrigin != null">
        name_of_origin,
      </if>
      <if test="tableNum != null">
        table_num,
      </if>
@@ -47,6 +53,12 @@
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="nameOfOrigin != null">
        #{nameOfOrigin,jdbcType=VARCHAR},
      </if>
      <if test="tableNum != null">
        #{tableNum,jdbcType=INTEGER},
      </if>
@@ -89,6 +101,9 @@
    </trim>
    on duplicate key update
    <trim suffixOverrides=",">
      <if test="nameOfOrigin != null">
        name_of_origin = #{nameOfOrigin,jdbcType=VARCHAR},
      </if>
      <if test="tableNum != null">
        table_num = #{tableNum,jdbcType=INTEGER},
      </if>
@@ -117,7 +132,7 @@
        update_user= #{updateUser,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null">
        update_time #{updateTime,jdbcType=TIMESTAMP},
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="companyId != null">
        company_id = #{companyId,jdbcType=VARCHAR},
@@ -132,14 +147,15 @@
  </insert>
  <delete id="delete">
    update t_su_material_warehouse set isUse = 0 where id = #{id,jdbcType=VARCHAR}
    update t_su_material_warehouse_record set is_use = 0 where id = #{id,jdbcType=VARCHAR}
  </delete>
  <select id="selectPageList" resultType="com.thhy.materials.modules.biz.suMaterialWarehouse.entity.SuMaterialWarehouseEntity">
    SELECT
            t.id                AS id,
            t.name_of_origin    AS nameOfOrigin,
            t.table_num         AS tableNum,
            sd.dict_name        AS materialName,
            t.material_name        AS materialName,
            t.incoming_quantity AS incomingQuantity,
            t.create_time       AS createTime,
            t.status            AS status,
@@ -155,15 +171,25 @@
    LEFT JOIN sys_users su1 on su1.user_id = t.update_user
    LEFT JOIN sys_dict sd on sd.dict_id = t.material_name
    where t.is_use = 1 and t.company_id = #{companyId}
    order by
      <if test="tableNum != null and tableNum !=''">
          and t.table_num = #{tableNum}
      </if>
      <if test="type != null and type !=''">
          and t.type = #{type}
      </if>
      <if test="startTime != null and endTime != null">
          and t.create_time between #{startTime} and  #{endTime}
      </if>
    order by t.create_time desc
  </select>
  <select id="selectInfo" resultType="com.thhy.materials.modules.biz.suMaterialWarehouse.entity.SuMaterialWarehouseEntity">
    SELECT
            t.id                AS id,
            t.name_of_origin    AS nameOfOrigin,
            t.table_num         AS tableNum,
            sd.dict_name        AS materialName,
            t.material_name        AS materialName,
            t.incoming_quantity AS incomingQuantity,
            t.create_time       AS createTime,
            t.status            AS status,
@@ -186,7 +212,8 @@
            t.id                AS id,
            t.table_num         AS tableNum,
            sd.dict_name        AS materialName,
            t.name_of_origin    AS nameOfOrigin,
            t.material_name        AS materialName,
            t.incoming_quantity AS incomingQuantity,
            t.create_time       AS createTime,
            t.status            AS status,