|
@ -3,36 +3,46 @@ |
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|
|
<mapper namespace="com.ruoyi.purchase.mapper.PurchasePlanChildMapper"> |
|
|
<mapper namespace="com.ruoyi.purchase.mapper.PurchasePlanChildMapper"> |
|
|
|
|
|
|
|
|
<resultMap type="PurchasePlanChild" id="PurchasePlanChildResult"> |
|
|
<resultMap type="PurchasePlanChild" id="PurchasePlanChildResult"> |
|
|
<result property="purchasePlanChildId" column="purchase_plan_child_id" /> |
|
|
<result property="purchasePlanChildId" column="purchase_plan_child_id" /> |
|
|
<result property="purchasePlanCode" column="purchase_plan_code" /> |
|
|
<result property="purchasePlanCode" column="purchase_plan_code" /> |
|
|
<result property="materialId" column="material_id" /> |
|
|
<result property="materialId" column="material_id" /> |
|
|
<result property="materialCode" column="material_code" /> |
|
|
<result property="materialCode" column="material_code" /> |
|
|
<result property="materialName" column="material_name" /> |
|
|
<result property="materialName" column="material_name" /> |
|
|
<result property="materialType" column="material_type" /> |
|
|
<result property="materialType" column="material_type" /> |
|
|
<result property="processMethod" column="process_method" /> |
|
|
<result property="processMethod" column="process_method" /> |
|
|
<result property="brand" column="brand" /> |
|
|
<result property="brand" column="brand" /> |
|
|
<result property="photoUrl" column="photoUrl" /> |
|
|
<result property="photoUrl" column="photoUrl" /> |
|
|
<result property="describe" column="describe" /> |
|
|
<result property="describe" column="describe" /> |
|
|
<result property="materialNum" column="material_num" /> |
|
|
<result property="materialNum" column="material_num" /> |
|
|
<result property="materialSole" column="material_sole" /> |
|
|
<result property="materialSole" column="material_sole" /> |
|
|
<result property="materialRmb" column="material_rmb" /> |
|
|
<result property="materialRmb" column="material_rmb" /> |
|
|
<result property="materialNormb" column="material_noRmb" /> |
|
|
<result property="materialNoRmb" column="material_noRmb" /> |
|
|
<result property="createBy" column="create_by" /> |
|
|
<result property="supplierCode" column="supplier_code" /> |
|
|
<result property="createTime" column="create_time" /> |
|
|
<result property="supplierName" column="supplier_name" /> |
|
|
<result property="updateBy" column="update_by" /> |
|
|
<result property="createBy" column="create_by" /> |
|
|
<result property="updateTime" column="update_time" /> |
|
|
<result property="createTime" column="create_time" /> |
|
|
<result property="remark" column="remark" /> |
|
|
<result property="updateBy" column="update_by" /> |
|
|
<result property="useStatus" column="use_status" /> |
|
|
<result property="updateTime" column="update_time" /> |
|
|
<result property="auditStatus" column="audit_status" /> |
|
|
<result property="remark" column="remark" /> |
|
|
<result property="delFlag" column="del_flag" /> |
|
|
<result property="useStatus" column="use_status" /> |
|
|
|
|
|
<result property="auditStatus" column="audit_status" /> |
|
|
|
|
|
<result property="delFlag" column="del_flag" /> |
|
|
|
|
|
</resultMap> |
|
|
|
|
|
<resultMap id="supplier" type="PurchaseQuoteChild"> |
|
|
|
|
|
<result property="supplierCode" column="supplier_code"/> |
|
|
|
|
|
<result property="supplierName" column="supplier_name"/> |
|
|
|
|
|
<result property="materialCode" column="material_code"/> |
|
|
|
|
|
<result property="materialName" column="material_name"/> |
|
|
|
|
|
<result property="materialNum" column="material_num"/> |
|
|
|
|
|
<result property="materialSole" column="material_sole"/> |
|
|
|
|
|
<result property="materialRmb" column="material_rmb"/> |
|
|
|
|
|
<result property="materialNoRmb" column="material_noRmb"/> |
|
|
</resultMap> |
|
|
</resultMap> |
|
|
|
|
|
|
|
|
<sql id="selectPurchasePlanChildVo"> |
|
|
<sql id="selectPurchasePlanChildVo"> |
|
|
select purchase_plan_child_id, purchase_plan_code, material_id, |
|
|
select purchase_plan_child_id, purchase_plan_code, material_id, |
|
|
material_code, material_name, material_type, process_method, brand, |
|
|
material_code, material_name, material_type, process_method, brand, |
|
|
photoUrl, `describe`, material_num, material_sole, material_rmb, |
|
|
photoUrl, `describe`, material_num, material_sole, material_rmb,supplier_code,supplier_name, |
|
|
material_noRmb, create_by, create_time, update_by, update_time, remark, |
|
|
material_noRmb, create_by, create_time, update_by, update_time, remark, |
|
|
use_status, audit_status, del_flag from purchase_plan_child |
|
|
use_status, audit_status, del_flag from purchase_plan_child |
|
|
</sql> |
|
|
</sql> |
|
@ -81,7 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
<if test="materialNum != null">material_num,</if> |
|
|
<if test="materialNum != null">material_num,</if> |
|
|
<if test="materialSole != null">material_sole,</if> |
|
|
<if test="materialSole != null">material_sole,</if> |
|
|
<if test="materialRmb != null">material_rmb,</if> |
|
|
<if test="materialRmb != null">material_rmb,</if> |
|
|
<if test="materialNormb != null">material_noRmb,</if> |
|
|
<if test="materialNoRmb != null">material_noRmb,</if> |
|
|
<if test="createBy != null">create_by,</if> |
|
|
<if test="createBy != null">create_by,</if> |
|
|
<if test="createTime != null">create_time,</if> |
|
|
<if test="createTime != null">create_time,</if> |
|
|
<if test="updateBy != null">update_by,</if> |
|
|
<if test="updateBy != null">update_by,</if> |
|
@ -104,7 +114,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
<if test="materialNum != null">#{materialNum},</if> |
|
|
<if test="materialNum != null">#{materialNum},</if> |
|
|
<if test="materialSole != null">#{materialSole},</if> |
|
|
<if test="materialSole != null">#{materialSole},</if> |
|
|
<if test="materialRmb != null">#{materialRmb},</if> |
|
|
<if test="materialRmb != null">#{materialRmb},</if> |
|
|
<if test="materialNormb != null">#{materialNormb},</if> |
|
|
<if test="materialNoRmb != null">#{materialNormb},</if> |
|
|
<if test="createBy != null">#{createBy},</if> |
|
|
<if test="createBy != null">#{createBy},</if> |
|
|
<if test="createTime != null">#{createTime},</if> |
|
|
<if test="createTime != null">#{createTime},</if> |
|
|
<if test="updateBy != null">#{updateBy},</if> |
|
|
<if test="updateBy != null">#{updateBy},</if> |
|
@ -131,7 +141,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
<if test="materialNum != null">material_num = #{materialNum},</if> |
|
|
<if test="materialNum != null">material_num = #{materialNum},</if> |
|
|
<if test="materialSole != null">material_sole = #{materialSole},</if> |
|
|
<if test="materialSole != null">material_sole = #{materialSole},</if> |
|
|
<if test="materialRmb != null">material_rmb = #{materialRmb},</if> |
|
|
<if test="materialRmb != null">material_rmb = #{materialRmb},</if> |
|
|
<if test="materialNormb != null">material_noRmb = #{materialNormb},</if> |
|
|
<if test="materialNoRmb != null">material_noRmb = #{materialNoRmb},</if> |
|
|
<if test="createBy != null">create_by = #{createBy},</if> |
|
|
<if test="createBy != null">create_by = #{createBy},</if> |
|
|
<if test="createTime != null">create_time = #{createTime},</if> |
|
|
<if test="createTime != null">create_time = #{createTime},</if> |
|
|
<if test="updateBy != null">update_by = #{updateBy},</if> |
|
|
<if test="updateBy != null">update_by = #{updateBy},</if> |
|
@ -162,5 +172,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
<update id="restorePurchasePlanChildById" parameterType="Long"> |
|
|
<update id="restorePurchasePlanChildById" parameterType="Long"> |
|
|
update purchase_plan_child set del_flag = '0' where purchase_plan_child_id = #{purchasePlanChildId} |
|
|
update purchase_plan_child set del_flag = '0' where purchase_plan_child_id = #{purchasePlanChildId} |
|
|
</update> |
|
|
</update> |
|
|
|
|
|
<select id="getPurchasePlanChildByPlanCodes" parameterType="String" resultMap="PurchasePlanChildResult"> |
|
|
|
|
|
SELECT |
|
|
|
|
|
plan.material_code, |
|
|
|
|
|
GROUP_CONCAT(DISTINCT planOrder.correlation_code ORDER BY planOrder.correlation_code) AS combined_correlation_codes, |
|
|
|
|
|
GROUP_CONCAT(DISTINCT quote.supplier_code ORDER BY quote.supplier_code) AS combined_supplier_codes, |
|
|
|
|
|
plan.material_code, |
|
|
|
|
|
plan.material_name, |
|
|
|
|
|
plan.material_type, |
|
|
|
|
|
plan.process_method, |
|
|
|
|
|
plan.brand, |
|
|
|
|
|
plan.photoUrl, |
|
|
|
|
|
plan.material_num, |
|
|
|
|
|
quote.material_noRmb, |
|
|
|
|
|
quote.material_rmb, |
|
|
|
|
|
quote.supplier_code, |
|
|
|
|
|
quote.supplier_name |
|
|
|
|
|
FROM |
|
|
|
|
|
purchase_plan_child AS plan |
|
|
|
|
|
LEFT JOIN purchase_plan AS planOrder |
|
|
|
|
|
ON plan.purchase_plan_code = planOrder.purchase_plan_code |
|
|
|
|
|
AND planOrder.del_flag = '0' |
|
|
|
|
|
LEFT JOIN purchase_quote_child AS quote |
|
|
|
|
|
ON plan.material_code = quote.material_code |
|
|
|
|
|
AND quote.del_flag = '0' |
|
|
|
|
|
WHERE |
|
|
|
|
|
plan.purchase_plan_code IN |
|
|
|
|
|
<foreach item="purchasePlanCode" collection="array" open="(" separator="," close=")"> |
|
|
|
|
|
#{purchasePlanCode} |
|
|
|
|
|
</foreach> |
|
|
|
|
|
AND plan.del_flag = '0' |
|
|
|
|
|
GROUP BY |
|
|
|
|
|
plan.material_code; |
|
|
|
|
|
</select> |
|
|
</mapper> |
|
|
</mapper> |