集成oms服务模块
This commit is contained in:
@@ -0,0 +1,140 @@
|
||||
<?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.mhd.oms.domain.goods.repository.mapper.GoodsMapper">
|
||||
|
||||
<resultMap type="com.mhd.oms.domain.goods.repository.po.GoodsPO" id="GoodsResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="topOrganizationId" column="top_organization_id" />
|
||||
<result property="organizationId" column="organization_id" />
|
||||
<result property="organizationName" column="organization_name" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="orderId" column="order_id" />
|
||||
<result property="goodsNo" column="goods_no" />
|
||||
<result property="goodsName" column="goods_name" />
|
||||
<result property="packingSize" column="packing_size" />
|
||||
<result property="supportUnitId" column="support_unit_id" />
|
||||
<result property="supportUnit" column="support_unit" />
|
||||
<result property="supportUnitQuantity" column="support_unit_quantity" />
|
||||
<result property="materialUnitEa" column="material_unit_ea" />
|
||||
<result property="materialUnitEaQuantity" column="material_unit_ea_quantity" />
|
||||
<result property="unitPrice" column="unit_price" />
|
||||
<result property="taxUnitPrice" column="tax_unit_price" />
|
||||
<result property="taxRate" column="tax_rate" />
|
||||
<result property="taxes" column="taxes" />
|
||||
<result property="amount" column="amount" />
|
||||
<result property="taxAmount" column="tax_amount" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
<sql id="selectGoodsPo">
|
||||
select
|
||||
a.id,
|
||||
a.goods_name,
|
||||
a.goods_no,
|
||||
a.packing_size,
|
||||
a.support_unit_id,
|
||||
a.support_unit,
|
||||
a.support_unit_quantity,
|
||||
a.material_unit_ea,
|
||||
a.material_unit_ea_quantity,
|
||||
a.create_by,
|
||||
a.create_time,
|
||||
a.update_by,
|
||||
a.update_time,
|
||||
a.top_organization_id,
|
||||
a.organization_id,
|
||||
a.organization_name,
|
||||
a.del_flag,
|
||||
a.order_id,
|
||||
a.unit_price,
|
||||
a.tax_unit_price,
|
||||
a.tax_rate,
|
||||
a.taxes,
|
||||
a.amount,
|
||||
a.tax_amount,
|
||||
sum(case task.task_status when 2 then task.plan_num else 0 end) completeNum, -- 物料完成数量
|
||||
1234567890 stockUsableNum,
|
||||
a.remark
|
||||
FROM
|
||||
oms_goods a
|
||||
left join oms_task_order task on a.id = task.goods_id and task.del_flag = 1 -- 作业任务(未删除)
|
||||
left join oms_scm_order scm on a.order_id = scm.order_id and scm.del_flag = 1 -- 供应链订单(未删除)
|
||||
</sql>
|
||||
|
||||
<sql id="selectGoodsPo1">
|
||||
<where>
|
||||
a.del_flag = 1
|
||||
<if test="topOrganizationId != null ">
|
||||
and a.top_organization_id = #{topOrganizationId}
|
||||
</if>
|
||||
<if test="organizationId != null ">
|
||||
and a.organization_id = #{organizationId}
|
||||
</if>
|
||||
<if test="organizationName != null and organizationName != ''">
|
||||
and a.organization_name like concat('%', #{organizationName}, '%')
|
||||
</if>
|
||||
<if test="orderId != null ">
|
||||
and a.order_id = #{orderId}
|
||||
</if>
|
||||
<if test="goodsNo != null and goodsNo != ''">
|
||||
and a.goods_no = #{goodsNo}
|
||||
</if>
|
||||
<if test="goodsName != null and goodsName != ''">
|
||||
and a.goods_name like concat('%', #{goodsName}, '%')
|
||||
</if>
|
||||
<if test="packingSize != null and packingSize != ''">
|
||||
and a.packing_size = #{packingSize}
|
||||
</if>
|
||||
<if test="supportUnitId != null and supportUnitId != ''">
|
||||
and a.support_unit_id = #{supportUnitId}
|
||||
</if>
|
||||
<if test="supportUnit != null and supportUnit != ''">
|
||||
and a.support_unit = #{supportUnit}
|
||||
</if>
|
||||
<if test="materialUnitEa != null and materialUnitEa != ''">
|
||||
and a.material_unit_ea = #{materialUnitEa}
|
||||
</if>
|
||||
<if test="unitPrice != null ">
|
||||
and a.unit_price = #{unitPrice}
|
||||
</if>
|
||||
<if test="taxUnitPrice != null ">
|
||||
and a.tax_unit_price = #{taxUnitPrice}
|
||||
</if>
|
||||
<if test="taxRate != null ">
|
||||
and a.tax_rate = #{taxRate}
|
||||
</if>
|
||||
<if test="taxes != null ">
|
||||
and a.taxes = #{taxes}
|
||||
</if>
|
||||
<if test="amount != null ">
|
||||
and a.amount = #{amount}
|
||||
</if>
|
||||
<if test="taxAmount != null ">
|
||||
and a.tax_amount = #{taxAmount}
|
||||
</if>
|
||||
<if test="scmId != null ">
|
||||
and scm.id = #{scmId}
|
||||
</if>
|
||||
<if test="idList != null">
|
||||
and a.id in
|
||||
<foreach collection="idList" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<select id="queryList" parameterType="com.mhd.oms.domain.goods.repository.todo.GoodsDO" resultMap="GoodsResult">
|
||||
<include refid="selectGoodsPo"/>
|
||||
<include refid="selectGoodsPo1"/>
|
||||
GROUP BY
|
||||
a.id
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user