|
|
|
<?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.glxp.api.dao.collect.RelCodeBatchMapper">
|
|
|
|
<resultMap id="BaseResultMap" type="com.glxp.api.entity.collect.RelCodeBatch">
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
<!--@Table udi_wms_ywj.rel_code_batch-->
|
|
|
|
<id column="id" jdbcType="INTEGER" property="id" />
|
|
|
|
<result column="productCode" jdbcType="VARCHAR" property="productCode" />
|
|
|
|
<result column="subTypeNo" jdbcType="VARCHAR" property="subTypeNo" />
|
|
|
|
<result column="cascadeRatio" jdbcType="VARCHAR" property="cascadeRatio" />
|
|
|
|
<result column="packageSpec" jdbcType="VARCHAR" property="packageSpec" />
|
|
|
|
<result column="comment" jdbcType="VARCHAR" property="comment" />
|
|
|
|
<result column="batchNo" jdbcType="VARCHAR" property="batchNo" />
|
|
|
|
<result column="madeDate" jdbcType="TIMESTAMP" property="madeDate" />
|
|
|
|
<result column="validateDate" jdbcType="TIMESTAMP" property="validateDate" />
|
|
|
|
<result column="workShop" jdbcType="VARCHAR" property="workShop" />
|
|
|
|
<result column="lineName" jdbcType="VARCHAR" property="lineName" />
|
|
|
|
<result column="lineManager" jdbcType="VARCHAR" property="lineManager" />
|
|
|
|
<result column="erpId" jdbcType="VARCHAR" property="erpId" />
|
|
|
|
</resultMap>
|
|
|
|
<sql id="Base_Column_List">
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
id, productCode, subTypeNo, `cascadeRatio`, packageSpec, `comment`, batchNo, madeDate,
|
|
|
|
validateDate, workShop, lineName, lineManager, erpId
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
<select id="filterList" parameterType="com.glxp.api.req.collect.RelCodeBatchRequest" resultType="com.glxp.api.res.collect.RelCodeBatchResponse">
|
|
|
|
select
|
|
|
|
a.id,
|
|
|
|
a.productCode,
|
|
|
|
a.subTypeNo,
|
|
|
|
a.cascadeRatio,
|
|
|
|
a.packageSpec,
|
|
|
|
a.comment,
|
|
|
|
a.batchNo,
|
|
|
|
a.madeDate,
|
|
|
|
a.validateDate,
|
|
|
|
a.workShop,
|
|
|
|
a.lineName,
|
|
|
|
a.lineManager,
|
|
|
|
a.erpId,
|
|
|
|
bp.cpmctymc,
|
|
|
|
bp.bhxjsl,
|
|
|
|
bp.packLevel AS packLayer,
|
|
|
|
bp.packUnit
|
|
|
|
from rel_code_batch a
|
|
|
|
LEFT JOIN basic_products bp ON bp.nameCode = a.productCode
|
|
|
|
<where>
|
|
|
|
<if test="productCode != '' and productCode != null">
|
|
|
|
AND a.productCode LIKE concat( #{productCode}, '%')
|
|
|
|
</if>
|
|
|
|
<if test="batchNo != null and batchNo != ''">
|
|
|
|
AND a.batchNo = #{batchNo}
|
|
|
|
</if>
|
|
|
|
<if test="erpId != null and erpId != ''">
|
|
|
|
AND a.erpId = #{erpId}
|
|
|
|
</if>
|
|
|
|
<if test="keyWords != '' and keyWords != null">
|
|
|
|
and (
|
|
|
|
a.productCode LIKE concat( #{keyWords}, '%')
|
|
|
|
or a.subTypeNo LIKE concat( #{keyWords}, '%')
|
|
|
|
or a.packageSpec LIKE concat( #{keyWords}, '%'))
|
|
|
|
</if>
|
|
|
|
<if test="lineName != '' and lineName != null">
|
|
|
|
AND a.lineName LIKE concat('%', #{lineName}, '%')
|
|
|
|
</if>
|
|
|
|
<if test="lineManager != '' and lineManager != null">
|
|
|
|
AND a.lineManager LIKE concat('%', #{lineManager}, '%')
|
|
|
|
</if>
|
|
|
|
<if test="code != '' and code != null">
|
|
|
|
and exists(select 1 from rel_code_detail b where a.id = b.batchIdFk and b.curCode = #{code})
|
|
|
|
</if>
|
|
|
|
<if test="startDate != null and startDate != ''">
|
|
|
|
<![CDATA[ and a.validateDate >= DATE_FORMAT(#{startDate}, '%Y-%m-%d %H:%i:%S') ]]>
|
|
|
|
</if>
|
|
|
|
<if test="endDate != null and endDate != ''">
|
|
|
|
<![CDATA[ and a.validateDate <= DATE_FORMAT(#{endDate}, '%Y-%m-%d %H:%i:%S') ]]>
|
|
|
|
</if>
|
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
</mapper>
|