|
|
@ -36,30 +36,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<result property="remark" column="remark" /> |
|
|
|
<result property="useStatus" column="use_status" /> |
|
|
|
<result property="auditStatus" column="audit_status" /> |
|
|
|
<result property="bomId" column="bom_id" /> |
|
|
|
</resultMap> |
|
|
|
|
|
|
|
<sql id="selectSysSalesOrderChild"> |
|
|
|
select id, quoteId, materialId, materialCode, materialName, materialType, processMethod, brand, photoUrl,,unit, `describe`, |
|
|
|
countTax, usdTax, materialNum,materialSole, materialRmb, materialNoRmb, materialNoUsd, materialUsd, materialUsdSum, |
|
|
|
materialNoUsdSum, materialNoRmbSum, materialRmbSum,out_bound_quantity, un_bound_quantity, create_by, create_time, update_by, |
|
|
|
update_time, remark, use_status,audit_status from sys_sales_order_child |
|
|
|
select a.id, a.quoteId, a.materialId, a.materialCode, a.materialName, a.materialType, a.processMethod, a.brand, a.photoUrl,a.unit, a.`describe`, |
|
|
|
a.countTax, a.usdTax, a.materialNum,a.materialSole, a.materialRmb, a.materialNoRmb, a.materialNoUsd, a.materialUsd, a.materialUsdSum, |
|
|
|
a.materialNoUsdSum, a.materialNoRmbSum, a.materialRmbSum,a.out_bound_quantity, a.un_bound_quantity, a.create_by, a.create_time, a.update_by, |
|
|
|
a.update_time, a.remark, a.use_status,a.audit_status |
|
|
|
,b.id as bom_id |
|
|
|
from sys_sales_order_child a |
|
|
|
left join erp_bom b |
|
|
|
on a.materialCode = b.material_no |
|
|
|
</sql> |
|
|
|
<select id="selectSysSalesOrderChildList" parameterType="SysSalesOrderChild" resultMap="SysSalesOrderChildResult"> |
|
|
|
<include refid="selectSysSalesOrderChild"/> |
|
|
|
<where> |
|
|
|
<if test="quoteId != null and quoteId !='' "> and quoteId = #{quoteId}</if> |
|
|
|
<if test="materialId != null "> and materialId = #{materialId}</if> |
|
|
|
<if test="materialCode != null and materialCode != ''"> and materialCode like concat('%', #{#{materialCode}}, '%')</if> |
|
|
|
<if test="materialName != null and materialName != ''"> and materialName like concat('%', #{materialName}, '%')</if> |
|
|
|
<if test="quoteId != null and quoteId !='' "> and a.quoteId = #{quoteId}</if> |
|
|
|
<if test="materialId != null "> and a.materialId = #{materialId}</if> |
|
|
|
<if test="materialCode != null and materialCode != ''"> and a.materialCode like concat('%', #{#{materialCode}}, '%')</if> |
|
|
|
<if test="materialName != null and materialName != ''"> and a.materialName like concat('%', #{materialName}, '%')</if> |
|
|
|
</where> |
|
|
|
</select> |
|
|
|
<select id="selectSysSalesOrderChildById" parameterType="Long" resultMap="SysSalesOrderChildResult"> |
|
|
|
<include refid="selectSysSalesOrderChild"/> |
|
|
|
where id = #{id} |
|
|
|
where a.id = #{id} |
|
|
|
</select> |
|
|
|
<select id="selectSysSalesOrderChildByQuoteId" parameterType="String" resultMap="SysSalesOrderChildResult"> |
|
|
|
<include refid="selectSysSalesOrderChild"/> |
|
|
|
where quoteId = #{quoteId} |
|
|
|
where a.quoteId = #{quoteId} |
|
|
|
</select> |
|
|
|
<insert id="insertSysSalesOrderChild" parameterType="SysSalesOrderChild" useGeneratedKeys="true" keyProperty="id"> |
|
|
|
insert into sys_sales_order_child |
|
|
|