|
@@ -1,35 +1,35 @@
|
|
|
<?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">
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.abi.qms.platform.dao.mapper.QrPackageMapper">
|
|
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
|
<resultMap id="BaseResultMap" type="com.abi.qms.platform.dao.entity.QrPackage">
|
|
|
- <id column="ID" property="id" />
|
|
|
- <result column="MATERIAL_ID" property="materialId" />
|
|
|
- <result column="FACTORY_COVER_ID" property="factoryCoverId" />
|
|
|
- <result column="FACTORY_BEER_ID" property="factoryBeerId" />
|
|
|
- <result column="STANDBY_RATIO" property="standbyRatio" />
|
|
|
- <result column="BOX_CODE_FORMAT_ID" property="boxCodeFormatId" />
|
|
|
- <result column="SAP_ORDER_NO" property="sapOrderNo" />
|
|
|
- <result column="QR_NUMBER" property="qrNumber" />
|
|
|
- <result column="APPLY_STATUS" property="applyStatus" />
|
|
|
- <result column="GENERATE_STATUS" property="generateStatus" />
|
|
|
- <result column="GENERATE_TIME" property="generateTime" />
|
|
|
- <result column="REASON_APPLY" property="reasonApply" />
|
|
|
- <result column="DOWNLOAD_PATH" property="downloadPath" />
|
|
|
- <result column="IS_DOWNLOAD" property="isDownload" />
|
|
|
- <result column="DOWNLOAD_TIME" property="downloadTime" />
|
|
|
- <result column="CREATE_TIME" property="createTime" />
|
|
|
- <result column="CREATE_BY" property="createBy" />
|
|
|
- <result column="UPDATE_TIME" property="updateTime" />
|
|
|
- <result column="UPDATE_BY" property="updateBy" />
|
|
|
- <result column="IS_DELETE" property="isDelete" />
|
|
|
- <result column="ZIP_PASSWORD" property="zipPassword" />
|
|
|
- <result column="QR_TYPE" property="qrType" />
|
|
|
- <result column="FACTORY_COVER_LEVEL_TWO_ID" property="factoryCoverLevelTwoId" />
|
|
|
- <result column="INVALID" property="invalid" />
|
|
|
+ <id column="ID" property="id"/>
|
|
|
+ <result column="MATERIAL_ID" property="materialId"/>
|
|
|
+ <result column="FACTORY_COVER_ID" property="factoryCoverId"/>
|
|
|
+ <result column="FACTORY_BEER_ID" property="factoryBeerId"/>
|
|
|
+ <result column="STANDBY_RATIO" property="standbyRatio"/>
|
|
|
+ <result column="BOX_CODE_FORMAT_ID" property="boxCodeFormatId"/>
|
|
|
+ <result column="SAP_ORDER_NO" property="sapOrderNo"/>
|
|
|
+ <result column="QR_NUMBER" property="qrNumber"/>
|
|
|
+ <result column="APPLY_STATUS" property="applyStatus"/>
|
|
|
+ <result column="GENERATE_STATUS" property="generateStatus"/>
|
|
|
+ <result column="GENERATE_TIME" property="generateTime"/>
|
|
|
+ <result column="REASON_APPLY" property="reasonApply"/>
|
|
|
+ <result column="DOWNLOAD_PATH" property="downloadPath"/>
|
|
|
+ <result column="IS_DOWNLOAD" property="isDownload"/>
|
|
|
+ <result column="DOWNLOAD_TIME" property="downloadTime"/>
|
|
|
+ <result column="CREATE_TIME" property="createTime"/>
|
|
|
+ <result column="CREATE_BY" property="createBy"/>
|
|
|
+ <result column="UPDATE_TIME" property="updateTime"/>
|
|
|
+ <result column="UPDATE_BY" property="updateBy"/>
|
|
|
+ <result column="IS_DELETE" property="isDelete"/>
|
|
|
+ <result column="ZIP_PASSWORD" property="zipPassword"/>
|
|
|
+ <result column="QR_TYPE" property="qrType"/>
|
|
|
+ <result column="FACTORY_COVER_LEVEL_TWO_ID" property="factoryCoverLevelTwoId"/>
|
|
|
+ <result column="INVALID" property="invalid"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<resultMap type="com.abi.qms.platform.dao.vo.result.QrPackageVO" id="QrPackageResult">
|
|
@@ -68,12 +68,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="qrRepertoryType" column="qr_repertory_type"/>
|
|
|
<result property="boxCodeFormatName" column="box_code_format_name"/>
|
|
|
<!-- 码包下载记录 -->
|
|
|
- <collection property="qrPackageDownloadRecordList" javaType="java.util.List" ofType="com.abi.qms.platform.dao.vo.result.QrPackageDownloadRecordVO">
|
|
|
+ <collection property="qrPackageDownloadRecordList" javaType="java.util.List"
|
|
|
+ ofType="com.abi.qms.platform.dao.vo.result.QrPackageDownloadRecordVO">
|
|
|
<result property="createTime" column="download_time"/>
|
|
|
<result property="createByName" column="download_user_name"/>
|
|
|
</collection>
|
|
|
<!-- 码包批次列表 -->
|
|
|
- <collection property="qrPackageBatchVOList" javaType="java.util.List" ofType="com.abi.qms.platform.dao.vo.result.QrPackageBatchVO">
|
|
|
+ <collection property="qrPackageBatchVOList" javaType="java.util.List"
|
|
|
+ ofType="com.abi.qms.platform.dao.vo.result.QrPackageBatchVO">
|
|
|
<result property="id" column="batch_id"/>
|
|
|
<result property="packageId" column="package_id"/>
|
|
|
<result property="batchNumber" column="batch_number"/>
|
|
@@ -83,24 +85,24 @@ 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_cover_id,
|
|
|
- qp.box_code_format_id,
|
|
|
- qp.sap_order_no,
|
|
|
- qp.qr_number,
|
|
|
- qp.apply_status,
|
|
|
- qp.is_download,
|
|
|
- qp.create_time,
|
|
|
- qp.create_by,
|
|
|
- qp.qr_type,
|
|
|
- bm.material_name,
|
|
|
- bf.factory_name AS factory_cover_name,
|
|
|
- bcf.name AS box_code_format_name,
|
|
|
- ui.user_name AS create_by_name,
|
|
|
- qp.invalid
|
|
|
+ qp.id,
|
|
|
+ qp.material_id,
|
|
|
+ qp.factory_cover_id,
|
|
|
+ qp.box_code_format_id,
|
|
|
+ qp.sap_order_no,
|
|
|
+ qp.qr_number,
|
|
|
+ qp.apply_status,
|
|
|
+ qp.is_download,
|
|
|
+ qp.create_time,
|
|
|
+ qp.create_by,
|
|
|
+ qp.qr_type,
|
|
|
+ bm.material_name,
|
|
|
+ bf.factory_name AS factory_cover_name,
|
|
|
+ bcf.name AS box_code_format_name,
|
|
|
+ ui.user_name AS create_by_name,
|
|
|
+ qp.invalid
|
|
|
FROM
|
|
|
- qr_package qp
|
|
|
+ qr_package qp
|
|
|
LEFT JOIN qr_box_code_format bcf ON qp.box_code_format_id = bcf.id
|
|
|
LEFT JOIN base_material bm ON qp.material_id = bm.id
|
|
|
LEFT JOIN base_factory bf ON qp.factory_cover_id = bf.id
|
|
@@ -120,7 +122,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
AND qp.sap_order_no like concat('%',#{param.sapOrderNo},'%')
|
|
|
</if>
|
|
|
<if test="param.factoryCoverId != null">
|
|
|
- AND (qp.factory_cover_id = #{param.factoryCoverId} or qp.factory_cover_level_two_id = #{param.factoryCoverId})
|
|
|
+ AND (qp.factory_cover_id = #{param.factoryCoverId} or qp.factory_cover_level_two_id =
|
|
|
+ #{param.factoryCoverId})
|
|
|
</if>
|
|
|
<if test="param.applyStatus != null">
|
|
|
AND qp.apply_status = #{param.applyStatus}
|
|
@@ -199,85 +202,102 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
qp.id = #{id}
|
|
|
</select>
|
|
|
|
|
|
+ <select id="listWxQrPackage" resultType="com.abi.qms.platform.dao.vo.result.QrPackageWxVO">
|
|
|
+ select qp.id as packageId,qbm.index_begin,qbm.index_end,qbm.active_status,ba.active_name,bm.material_name
|
|
|
+ from qr_package qp
|
|
|
+ inner join base_material bm on bm.id=qp.material_id
|
|
|
+ inner join qr_box_mapping qbm on qp.id=qbm.package_id
|
|
|
+ inner join base_active_qr_package_mapping baqpm on baqpm.qr_package_id=qp.id
|
|
|
+ inner join base_active ba on ba.id=baqpm.active_id
|
|
|
+ <where>
|
|
|
+ <if test="req.queryParam != null and req.queryParam != ''">
|
|
|
+ AND (qp.id like binary concat('%',#{req.queryParam},'%')
|
|
|
+ or ba.active_name like binary concat('%',#{req.queryParam},'%')
|
|
|
+ or bm.material_name like binary concat('%',#{req.queryParam},'%'))
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by qp.create_time desc
|
|
|
+ </select>
|
|
|
+
|
|
|
<!--6.03已废弃-->
|
|
|
<!--通过码活动id查询关联码包列表-->
|
|
|
-<!-- <select id="listPackageById" resultType="com.abi.qms.platform.dao.vo.result.ActivePackageVO">-->
|
|
|
-<!-- select-->
|
|
|
-<!-- qp.id as packageId,-->
|
|
|
-<!-- qp.qr_type,-->
|
|
|
-<!-- bb.brand_name,-->
|
|
|
-<!-- bb.parent_brand_name,-->
|
|
|
-<!-- qp.qr_number-->
|
|
|
-<!-- from qr_package qp-->
|
|
|
-<!-- inner join base_material bm on bm.id=qp.material_id-->
|
|
|
-<!-- inner join base_brand bb on bb.brand_code=bs.sub_brand_code-->
|
|
|
-<!-- left join base_active_qr_package_mapping baqpm on baqpm.qr_package_id=qp.id-->
|
|
|
-<!-- left join base_active ba on ba.id = baqpm.active_id-->
|
|
|
-<!-- where ba.id = #{id}-->
|
|
|
-<!-- </select>-->
|
|
|
+ <!-- <select id="listPackageById" resultType="com.abi.qms.platform.dao.vo.result.ActivePackageVO">-->
|
|
|
+ <!-- select-->
|
|
|
+ <!-- qp.id as packageId,-->
|
|
|
+ <!-- qp.qr_type,-->
|
|
|
+ <!-- bb.brand_name,-->
|
|
|
+ <!-- bb.parent_brand_name,-->
|
|
|
+ <!-- qp.qr_number-->
|
|
|
+ <!-- from qr_package qp-->
|
|
|
+ <!-- inner join base_material bm on bm.id=qp.material_id-->
|
|
|
+ <!-- inner join base_brand bb on bb.brand_code=bs.sub_brand_code-->
|
|
|
+ <!-- left join base_active_qr_package_mapping baqpm on baqpm.qr_package_id=qp.id-->
|
|
|
+ <!-- left join base_active ba on ba.id = baqpm.active_id-->
|
|
|
+ <!-- where ba.id = #{id}-->
|
|
|
+ <!-- </select>-->
|
|
|
|
|
|
|
|
|
<!--6.03已废弃-->
|
|
|
<!--<!–通过品牌code查询关联码包列表–>-->
|
|
|
<!--<select id="listPackageByBrandCode" resultType="com.abi.qms.platform.dao.vo.result.PackageActiveSearchVO">-->
|
|
|
- <!--select-->
|
|
|
- <!--qp.id as packageId,-->
|
|
|
- <!--qp.qr_type,-->
|
|
|
- <!--bs.sku_name,-->
|
|
|
- <!--bb.brand_name,-->
|
|
|
- <!--bb.parent_brand_name,-->
|
|
|
- <!--qp.qr_number,-->
|
|
|
- <!--ba.active_name,-->
|
|
|
- <!--(CASE WHEN ba.active_name IS NULL THEN '0' ELSE '1' END) AS is_join_active-->
|
|
|
- <!--from qr_package qp-->
|
|
|
- <!--inner join base_material bm on bm.id=qp.material_id-->
|
|
|
- <!--inner join base_sku bs on bs.id=bm.sku_id-->
|
|
|
- <!--inner join base_brand bb on bb.brand_code=bs.sub_brand_code-->
|
|
|
- <!--left join base_active_qr_package_mapping baqpm on baqpm.qr_package_id=qp.id-->
|
|
|
- <!--left join base_active ba on ba.id = baqpm.active_id-->
|
|
|
- <!--where-->
|
|
|
- <!--bb.brand_code IN(-->
|
|
|
- <!--<foreach collection="param.brandCodeList" separator="," item="item">-->
|
|
|
- <!--#{item}-->
|
|
|
- <!--</foreach>-->
|
|
|
- <!--)-->
|
|
|
- <!--and qp.apply_status = 1-->
|
|
|
- <!--<if test="param.activeId != null">-->
|
|
|
- <!--AND ba.id is null or ba.id != #{param.activeId}-->
|
|
|
- <!--</if>-->
|
|
|
- <!--<if test="param.packageId != null">-->
|
|
|
- <!--AND qp.id = {param.packageId}-->
|
|
|
- <!--</if>-->
|
|
|
- <!--<if test="param.skuName != null and param.skuName != ''">-->
|
|
|
- <!--AND bs.sku_name like concat('%',#{param.skuName},'%')-->
|
|
|
- <!--</if>-->
|
|
|
- <!--<if test="param.qrType != null">-->
|
|
|
- <!--AND qp.qr_type = #{param.qrType}-->
|
|
|
- <!--</if>-->
|
|
|
- <!--and qp.qr_type = 2-->
|
|
|
- <!--and bb.is_delete = 0-->
|
|
|
- <!--order by qp.generate_time desc-->
|
|
|
+ <!--select-->
|
|
|
+ <!--qp.id as packageId,-->
|
|
|
+ <!--qp.qr_type,-->
|
|
|
+ <!--bs.sku_name,-->
|
|
|
+ <!--bb.brand_name,-->
|
|
|
+ <!--bb.parent_brand_name,-->
|
|
|
+ <!--qp.qr_number,-->
|
|
|
+ <!--ba.active_name,-->
|
|
|
+ <!--(CASE WHEN ba.active_name IS NULL THEN '0' ELSE '1' END) AS is_join_active-->
|
|
|
+ <!--from qr_package qp-->
|
|
|
+ <!--inner join base_material bm on bm.id=qp.material_id-->
|
|
|
+ <!--inner join base_sku bs on bs.id=bm.sku_id-->
|
|
|
+ <!--inner join base_brand bb on bb.brand_code=bs.sub_brand_code-->
|
|
|
+ <!--left join base_active_qr_package_mapping baqpm on baqpm.qr_package_id=qp.id-->
|
|
|
+ <!--left join base_active ba on ba.id = baqpm.active_id-->
|
|
|
+ <!--where-->
|
|
|
+ <!--bb.brand_code IN(-->
|
|
|
+ <!--<foreach collection="param.brandCodeList" separator="," item="item">-->
|
|
|
+ <!--#{item}-->
|
|
|
+ <!--</foreach>-->
|
|
|
+ <!--)-->
|
|
|
+ <!--and qp.apply_status = 1-->
|
|
|
+ <!--<if test="param.activeId != null">-->
|
|
|
+ <!--AND ba.id is null or ba.id != #{param.activeId}-->
|
|
|
+ <!--</if>-->
|
|
|
+ <!--<if test="param.packageId != null">-->
|
|
|
+ <!--AND qp.id = {param.packageId}-->
|
|
|
+ <!--</if>-->
|
|
|
+ <!--<if test="param.skuName != null and param.skuName != ''">-->
|
|
|
+ <!--AND bs.sku_name like concat('%',#{param.skuName},'%')-->
|
|
|
+ <!--</if>-->
|
|
|
+ <!--<if test="param.qrType != null">-->
|
|
|
+ <!--AND qp.qr_type = #{param.qrType}-->
|
|
|
+ <!--</if>-->
|
|
|
+ <!--and qp.qr_type = 2-->
|
|
|
+ <!--and bb.is_delete = 0-->
|
|
|
+ <!--order by qp.generate_time desc-->
|
|
|
<!--</select>-->
|
|
|
|
|
|
<!--<!–通过码活动id查询关联码包列表–>-->
|
|
|
<!--<select id="listPackageByActiveApplyId" resultType="com.abi.qms.platform.dao.vo.result.ActiveModifyApplyPackageVO">-->
|
|
|
- <!--select-->
|
|
|
- <!--qp.id as packageId,-->
|
|
|
- <!--qp.qr_type,-->
|
|
|
- <!--bs.sku_name,-->
|
|
|
- <!--bb.brand_name,-->
|
|
|
- <!--bb.parent_brand_name,-->
|
|
|
- <!--qp.qr_number,-->
|
|
|
- <!--IFNULL(bamaqpm.modify_type, 3) modify_type-->
|
|
|
- <!--from qr_package qp-->
|
|
|
- <!--inner join base_material bm on bm.id=qp.material_id-->
|
|
|
- <!--inner join base_sku bs on bs.id=bm.sku_id-->
|
|
|
- <!--inner join base_brand bb on bb.brand_code=bs.sub_brand_code-->
|
|
|
- <!--left join base_active_qr_package_mapping baqpm on baqpm.qr_package_id=qp.id-->
|
|
|
- <!--left join base_active ba on ba.id = baqpm.active_id-->
|
|
|
- <!--left join base_active_modify_apply bama on bama.active_id = ba.id and bama.is_delete = 0-->
|
|
|
- <!--left join base_active_modify_apply_qr_package_mapping bamaqpm on bamaqpm.apply_id=bama.id and bamaqpm.qr_package_id = qp.id and bamaqpm.is_delete = 0-->
|
|
|
- <!--where ba.id = #{activeId}-->
|
|
|
- <!--ORDER BY modify_type ASC-->
|
|
|
+ <!--select-->
|
|
|
+ <!--qp.id as packageId,-->
|
|
|
+ <!--qp.qr_type,-->
|
|
|
+ <!--bs.sku_name,-->
|
|
|
+ <!--bb.brand_name,-->
|
|
|
+ <!--bb.parent_brand_name,-->
|
|
|
+ <!--qp.qr_number,-->
|
|
|
+ <!--IFNULL(bamaqpm.modify_type, 3) modify_type-->
|
|
|
+ <!--from qr_package qp-->
|
|
|
+ <!--inner join base_material bm on bm.id=qp.material_id-->
|
|
|
+ <!--inner join base_sku bs on bs.id=bm.sku_id-->
|
|
|
+ <!--inner join base_brand bb on bb.brand_code=bs.sub_brand_code-->
|
|
|
+ <!--left join base_active_qr_package_mapping baqpm on baqpm.qr_package_id=qp.id-->
|
|
|
+ <!--left join base_active ba on ba.id = baqpm.active_id-->
|
|
|
+ <!--left join base_active_modify_apply bama on bama.active_id = ba.id and bama.is_delete = 0-->
|
|
|
+ <!--left join base_active_modify_apply_qr_package_mapping bamaqpm on bamaqpm.apply_id=bama.id and bamaqpm.qr_package_id = qp.id and bamaqpm.is_delete = 0-->
|
|
|
+ <!--where ba.id = #{activeId}-->
|
|
|
+ <!--ORDER BY modify_type ASC-->
|
|
|
<!--</select>-->
|
|
|
</mapper>
|