|
@@ -6,8 +6,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
<resultMap type="com.abi.qms.platform.dao.vo.result.QrPackageVO" id="QrPackageResult">
|
|
|
<result property="id" column="id"/>
|
|
|
+ <result property="materialId" column="material_id"/>
|
|
|
<result property="factoryId" column="factory_id"/>
|
|
|
<result property="boxCodeFormatId" column="box_code_format_id"/>
|
|
|
+ <result property="sapOrderNo" column="sap_order_no"/>
|
|
|
<result property="batchNumber" column="batch_number"/>
|
|
|
<result property="name" column="name"/>
|
|
|
<result property="qrNumber" column="qr_number"/>
|
|
@@ -34,8 +36,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<select id="listQrPackage" resultType="com.abi.qms.platform.dao.vo.result.QrPackageVO">
|
|
|
SELECT
|
|
|
qp.id,
|
|
|
+ qp.material_id,
|
|
|
qp.factory_id,
|
|
|
qp.box_code_format_id,
|
|
|
+ qp.sap_order_no,
|
|
|
qp.batch_number,
|
|
|
qp.name,
|
|
|
qp.qr_number,
|
|
@@ -46,6 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
qp.create_by,
|
|
|
qp.update_time,
|
|
|
qp.update_by,
|
|
|
+ bm.material_name,
|
|
|
bf.factory_name,
|
|
|
bcf.name AS box_code_format_name,
|
|
|
qr.id AS qr_repertory_id,
|
|
@@ -56,39 +61,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
qr_package qp
|
|
|
LEFT JOIN qr_box_code_format bcf ON qp.box_code_format_id = bcf.id
|
|
|
LEFT JOIN qr_repertory qr ON bcf.qr_repertory_id = qr.id
|
|
|
+ LEFT JOIN base_material bm ON qp.material_id = bm.id
|
|
|
LEFT JOIN base_factory bf ON qp.factory_id = bf.id
|
|
|
LEFT JOIN user_info ui ON qp.create_by = ui.id
|
|
|
<where>
|
|
|
qp.is_delete = 0
|
|
|
- <if test="param.batchNumber != null and param.batchNumber != ''">
|
|
|
- AND qp.batch_number LIKE CONCAT('%',#{param.batchNumber},'%')
|
|
|
+ <if test="param.id != null">
|
|
|
+ AND qp.id = #{param.id}
|
|
|
</if>
|
|
|
- <if test="param.qrRepertoryType != null">
|
|
|
- AND qr.type = #{param.qrRepertoryType}
|
|
|
+ <if test="param.materialId != null">
|
|
|
+ AND qp.material_id = #{param.materialId}
|
|
|
+ </if>
|
|
|
+ <if test="param.sapOrderNo != null and param.sapOrderNo != ''">
|
|
|
+ AND qp.sap_order_no like concat('%',#{param.sapOrderNo},'%')
|
|
|
</if>
|
|
|
<if test="param.factoryId != null">
|
|
|
AND qp.factory_id = #{param.factoryId}
|
|
|
</if>
|
|
|
- <if test="param.boxCodeFormatOrQrRepertoryName != null and param.boxCodeFormatOrQrRepertoryName != ''">
|
|
|
- AND ( qr.name LIKE CONCAT('%',#{param.boxCodeFormatOrQrRepertoryName},'%') OR bcf.name LIKE CONCAT('%',#{param.boxCodeFormatOrQrRepertoryName},'%') )
|
|
|
- </if>
|
|
|
- <if test="param.name != null and param.name != ''">
|
|
|
- AND qp.name LIKE CONCAT('%',#{param.name},'%')
|
|
|
- </if>
|
|
|
<if test="param.applyStatus != null">
|
|
|
AND qp.apply_status = #{param.applyStatus}
|
|
|
</if>
|
|
|
- <if test="param.generateStatus != null">
|
|
|
- AND qp.generate_status = #{param.generateStatus}
|
|
|
- </if>
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
<select id="selectQrPackageDetailById" resultMap="QrPackageResult">
|
|
|
SELECT
|
|
|
qp.id,
|
|
|
+ qp.material_id,
|
|
|
qp.factory_id,
|
|
|
qp.box_code_format_id,
|
|
|
+ qp.sap_order_no,
|
|
|
qp.batch_number,
|
|
|
qp.name,
|
|
|
qp.qr_number,
|
|
@@ -99,6 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
qp.create_by,
|
|
|
qp.update_time,
|
|
|
qp.update_by,
|
|
|
+ bm.material_name,
|
|
|
bf.factory_name,
|
|
|
qr.id AS qr_Repertory_id,
|
|
|
qr.name AS qr_repertory_name,
|
|
@@ -109,6 +112,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
qr_package qp
|
|
|
LEFT JOIN qr_box_code_format bcf ON qp.box_code_format_id = bcf.id
|
|
|
LEFT JOIN qr_repertory qr ON bcf.qr_repertory_id = qr.id
|
|
|
+ LEFT JOIN base_material bm ON qp.material_id = bm.id
|
|
|
LEFT JOIN base_factory bf ON qp.factory_id = bf.id
|
|
|
LEFT JOIN qr_package_download_record qpdr ON qpdr.qr_package_id = qp.id
|
|
|
LEFT JOIN user_info ui ON ui.id = qpdr.create_by
|