|
@@ -1,130 +1,169 @@
|
|
|
<?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.zkqy.business.mapper.ProductWarehousingRecordMapper">
|
|
|
-
|
|
|
+
|
|
|
<resultMap type="com.zkqy.business.domain.ProductWarehousingRecord" id="ProductWarehousingRecordResult">
|
|
|
- <result property="id" column="id" />
|
|
|
- <result property="qrCode" column="qr_code" />
|
|
|
- <result property="qrCodeId" column="qr_code_id" />
|
|
|
- <result property="lotNum" column="lot_num" />
|
|
|
- <result property="productId" column="product_id" />
|
|
|
- <result property="levels" column="levels" />
|
|
|
- <result property="canisterNum" column="canister_num" />
|
|
|
- <result property="boxNum" column="box_num" />
|
|
|
- <result property="suttle" column="suttle" />
|
|
|
- <result property="productionDate" column="production_date" />
|
|
|
- <result property="machineTool" column="machine_tool" />
|
|
|
- <result property="grossWeight" column="gross_weight" />
|
|
|
- <result property="packaging" column="packaging" />
|
|
|
- <result property="workShifts" column="work_shifts" />
|
|
|
- <result property="foreignTradeNumber" column="foreign_trade_number" />
|
|
|
- <result property="canisterWeight" column="canister_weight" />
|
|
|
- <result property="boxWeight" column="box_weight" />
|
|
|
- <result property="tubeColor" column="tube_color" />
|
|
|
- <result property="comPort" column="com_port" />
|
|
|
- <result property="printFormat" column="print_format" />
|
|
|
- <result property="packagingType" column="packaging_type" />
|
|
|
- <result property="storageLocation" column="storage_location" />
|
|
|
- <result property="warehouseregionId" column="warehouseregion_id" />
|
|
|
- <result property="remark" column="remark" />
|
|
|
- <result property="delFlag" column="del_flag" />
|
|
|
- <result property="createBy" column="create_by" />
|
|
|
- <result property="createById" column="create_by_id" />
|
|
|
- <result property="createTime" column="create_time" />
|
|
|
- <result property="updateBy" column="update_by" />
|
|
|
- <result property="updateById" column="update_by_id" />
|
|
|
- <result property="updateTime" column="update_time" />
|
|
|
- <result property="warehousingTime" column="warehousing_time" />
|
|
|
- <result property="depositor" column="depositor" />
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="qrCode" column="qr_code"/>
|
|
|
+ <result property="qrCodeId" column="qr_code_id"/>
|
|
|
+ <result property="lotNum" column="lot_num"/>
|
|
|
+ <result property="productId" column="product_id"/>
|
|
|
+ <result property="levels" column="levels"/>
|
|
|
+ <result property="canisterNum" column="canister_num"/>
|
|
|
+ <result property="boxNum" column="box_num"/>
|
|
|
+ <result property="suttle" column="suttle"/>
|
|
|
+ <result property="productionDate" column="production_date"/>
|
|
|
+ <result property="machineTool" column="machine_tool"/>
|
|
|
+ <result property="grossWeight" column="gross_weight"/>
|
|
|
+ <result property="packaging" column="packaging"/>
|
|
|
+ <result property="workShifts" column="work_shifts"/>
|
|
|
+ <result property="foreignTradeNumber" column="foreign_trade_number"/>
|
|
|
+ <result property="canisterWeight" column="canister_weight"/>
|
|
|
+ <result property="boxWeight" column="box_weight"/>
|
|
|
+ <result property="tubeColor" column="tube_color"/>
|
|
|
+ <result property="comPort" column="com_port"/>
|
|
|
+ <result property="printFormat" column="print_format"/>
|
|
|
+ <result property="packagingType" column="packaging_type"/>
|
|
|
+ <result property="storageLocation" column="storage_location"/>
|
|
|
+ <result property="warehouseregionId" column="warehouseregion_id"/>
|
|
|
+ <result property="remark" column="remark"/>
|
|
|
+ <result property="delFlag" column="del_flag"/>
|
|
|
+ <result property="createBy" column="create_by"/>
|
|
|
+ <result property="createById" column="create_by_id"/>
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
+ <result property="updateBy" column="update_by"/>
|
|
|
+ <result property="updateById" column="update_by_id"/>
|
|
|
+ <result property="updateTime" column="update_time"/>
|
|
|
+ <result property="warehousingTime" column="warehousing_time"/>
|
|
|
+ <result property="depositor" column="depositor"/>
|
|
|
<result property="warehouseId" column="warehouse_id"/>
|
|
|
<result property="productColour" column="product_colour"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<resultMap type="com.zkqy.business.domain.vo.ProductCodeListVO" id="ProductCodeListResultVO">
|
|
|
- <result property="id" column="id" />
|
|
|
- <result property="qrCode" column="qr_code" />
|
|
|
- <result property="lotNum" column="lot_num" />
|
|
|
- <result property="productId" column="product_id" />
|
|
|
- <result property="levels" column="levels" />
|
|
|
- <result property="canisterNum" column="canister_num" />
|
|
|
- <result property="boxNum" column="box_num" />
|
|
|
- <result property="suttle" column="suttle" />
|
|
|
- <result property="productionDate" column="production_date" />
|
|
|
- <result property="machineTool" column="machine_tool" />
|
|
|
- <result property="grossWeight" column="gross_weight" />
|
|
|
- <result property="packaging" column="packaging" />
|
|
|
- <result property="workShifts" column="work_shifts" />
|
|
|
- <result property="foreignTradeNumber" column="foreign_trade_number" />
|
|
|
- <result property="canisterWeight" column="canister_weight" />
|
|
|
- <result property="boxWeight" column="box_weight" />
|
|
|
- <result property="tubeColor" column="tube_color" />
|
|
|
- <result property="comPort" column="com_port" />
|
|
|
- <result property="printFormat" column="print_format" />
|
|
|
- <result property="packagingType" column="packaging_type" />
|
|
|
- <result property="storageLocation" column="storage_location" />
|
|
|
- <result property="warehouseregionId" column="warehouseregion_id" />
|
|
|
- <result property="remark" column="remark" />
|
|
|
- <result property="delFlag" column="del_flag" />
|
|
|
- <result property="createBy" column="create_by" />
|
|
|
- <result property="createById" column="create_by_id" />
|
|
|
- <result property="createTime" column="create_time" />
|
|
|
- <result property="updateBy" column="update_by" />
|
|
|
- <result property="updateById" column="update_by_id" />
|
|
|
- <result property="updateTime" column="update_time" />
|
|
|
- <result property="productName" column="product_name" />
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="qrCode" column="qr_code"/>
|
|
|
+ <result property="lotNum" column="lot_num"/>
|
|
|
+ <result property="productId" column="product_id"/>
|
|
|
+ <result property="levels" column="levels"/>
|
|
|
+ <result property="canisterNum" column="canister_num"/>
|
|
|
+ <result property="boxNum" column="box_num"/>
|
|
|
+ <result property="suttle" column="suttle"/>
|
|
|
+ <result property="productionDate" column="production_date"/>
|
|
|
+ <result property="machineTool" column="machine_tool"/>
|
|
|
+ <result property="grossWeight" column="gross_weight"/>
|
|
|
+ <result property="packaging" column="packaging"/>
|
|
|
+ <result property="workShifts" column="work_shifts"/>
|
|
|
+ <result property="foreignTradeNumber" column="foreign_trade_number"/>
|
|
|
+ <result property="canisterWeight" column="canister_weight"/>
|
|
|
+ <result property="boxWeight" column="box_weight"/>
|
|
|
+ <result property="tubeColor" column="tube_color"/>
|
|
|
+ <result property="comPort" column="com_port"/>
|
|
|
+ <result property="printFormat" column="print_format"/>
|
|
|
+ <result property="packagingType" column="packaging_type"/>
|
|
|
+ <result property="storageLocation" column="storage_location"/>
|
|
|
+ <result property="warehouseregionId" column="warehouseregion_id"/>
|
|
|
+ <result property="remark" column="remark"/>
|
|
|
+ <result property="delFlag" column="del_flag"/>
|
|
|
+ <result property="createBy" column="create_by"/>
|
|
|
+ <result property="createById" column="create_by_id"/>
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
+ <result property="updateBy" column="update_by"/>
|
|
|
+ <result property="updateById" column="update_by_id"/>
|
|
|
+ <result property="updateTime" column="update_time"/>
|
|
|
+ <result property="productName" column="product_name"/>
|
|
|
<result property="productColor" column="product_color"/>
|
|
|
<result property="productSpecifications" column="product_specifications"/>
|
|
|
<result property="totalCanisterNum" column="total_canister_num"/>
|
|
|
<result property="totalBoxNum" column="total_box_num"/>
|
|
|
<result property="totalSuttle" column="total_suttle"/>
|
|
|
<result property="totalGrossWeight" column="total_gross_weight"/>
|
|
|
- <result property="warehousingTime" column="warehousing_time" />
|
|
|
- <result property="depositor" column="depositor" />
|
|
|
+ <result property="warehousingTime" column="warehousing_time"/>
|
|
|
+ <result property="depositor" column="depositor"/>
|
|
|
<result property="warehouseId" column="warehouse_id"/>
|
|
|
<result property="productColour" column="product_colour"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectProductWarehousingRecordVo">
|
|
|
- select id, qr_code, qr_code_id, lot_num, product_id, levels, canister_num, box_num, suttle, production_date, machine_tool, gross_weight, packaging, work_shifts, foreign_trade_number, canister_weight, box_weight, tube_color, com_port, print_format, packaging_type, storage_location, warehouseregion_id, remark, del_flag, create_by, create_by_id, create_time, update_by, update_by_id, update_time, warehousing_time, depositor,warehouse_id,product_colour from {DBNAME}.product_warehousing_record
|
|
|
+ select id,
|
|
|
+ qr_code,
|
|
|
+ qr_code_id,
|
|
|
+ lot_num,
|
|
|
+ product_id,
|
|
|
+ levels,
|
|
|
+ canister_num,
|
|
|
+ box_num,
|
|
|
+ suttle,
|
|
|
+ production_date,
|
|
|
+ machine_tool,
|
|
|
+ gross_weight,
|
|
|
+ packaging,
|
|
|
+ work_shifts,
|
|
|
+ foreign_trade_number,
|
|
|
+ canister_weight,
|
|
|
+ box_weight,
|
|
|
+ tube_color,
|
|
|
+ com_port,
|
|
|
+ print_format,
|
|
|
+ packaging_type,
|
|
|
+ storage_location,
|
|
|
+ warehouseregion_id,
|
|
|
+ remark,
|
|
|
+ del_flag,
|
|
|
+ create_by,
|
|
|
+ create_by_id,
|
|
|
+ create_time,
|
|
|
+ update_by,
|
|
|
+ update_by_id,
|
|
|
+ update_time,
|
|
|
+ warehousing_time,
|
|
|
+ depositor,
|
|
|
+ warehouse_id,
|
|
|
+ product_colour
|
|
|
+ from {DBNAME}.product_warehousing_record
|
|
|
</sql>
|
|
|
|
|
|
- <select id="selectProductWarehousingRecordList" parameterType="com.zkqy.business.domain.ProductWarehousingRecord" resultMap="ProductWarehousingRecordResult">
|
|
|
+ <select id="selectProductWarehousingRecordList" parameterType="com.zkqy.business.domain.ProductWarehousingRecord"
|
|
|
+ resultMap="ProductWarehousingRecordResult">
|
|
|
<include refid="selectProductWarehousingRecordVo"/>
|
|
|
where del_flag = '0'
|
|
|
- <if test="qrCode != null and qrCode != ''"> and qr_code = #{qrCode}</if>
|
|
|
- <if test="qrCodeId != null and qrCodeId != ''"> and qr_code_id = #{qrCodeId}</if>
|
|
|
- <if test="lotNum != null and lotNum != ''"> and lot_num = #{lotNum}</if>
|
|
|
- <if test="productId != null "> and product_id = #{productId}</if>
|
|
|
- <if test="levels != null and levels != ''"> and levels = #{levels}</if>
|
|
|
- <if test="canisterNum != null "> and canister_num = #{canisterNum}</if>
|
|
|
- <if test="boxNum != null "> and box_num = #{boxNum}</if>
|
|
|
- <if test="suttle != null "> and suttle = #{suttle}</if>
|
|
|
- <if test="productionDate != null "> and production_date = #{productionDate}</if>
|
|
|
- <if test="machineTool != null and machineTool != ''"> and machine_tool = #{machineTool}</if>
|
|
|
- <if test="grossWeight != null "> and gross_weight = #{grossWeight}</if>
|
|
|
- <if test="packaging != null and packaging != ''"> and packaging = #{packaging}</if>
|
|
|
- <if test="workShifts != null and workShifts != ''"> and work_shifts = #{workShifts}</if>
|
|
|
- <if test="foreignTradeNumber != null and foreignTradeNumber != ''"> and foreign_trade_number = #{foreignTradeNumber}</if>
|
|
|
- <if test="canisterWeight != null "> and canister_weight = #{canisterWeight}</if>
|
|
|
- <if test="boxWeight != null "> and box_weight = #{boxWeight}</if>
|
|
|
- <if test="tubeColor != null and tubeColor != ''"> and tube_color = #{tubeColor}</if>
|
|
|
- <if test="comPort != null and comPort != ''"> and com_port = #{comPort}</if>
|
|
|
- <if test="printFormat != null and printFormat != ''"> and print_format = #{printFormat}</if>
|
|
|
- <if test="packagingType != null and packagingType != ''"> and packaging_type = #{packagingType}</if>
|
|
|
- <if test="storageLocation != null and storageLocation != ''"> and storage_location = #{storageLocation}</if>
|
|
|
- <if test="warehouseregionId != null "> and warehouseregion_id = #{warehouseregionId}</if>
|
|
|
- <if test="warehousingTime != null "> and warehousing_time = #{warehousingTime}</if>
|
|
|
- <if test="depositor != null and depositor != ''"> and depositor = #{depositor}</if>
|
|
|
+ <if test="qrCode != null and qrCode != ''">and qr_code = #{qrCode}</if>
|
|
|
+ <if test="qrCodeId != null and qrCodeId != ''">and qr_code_id = #{qrCodeId}</if>
|
|
|
+ <if test="lotNum != null and lotNum != ''">and lot_num = #{lotNum}</if>
|
|
|
+ <if test="productId != null ">and product_id = #{productId}</if>
|
|
|
+ <if test="levels != null and levels != ''">and levels = #{levels}</if>
|
|
|
+ <if test="canisterNum != null ">and canister_num = #{canisterNum}</if>
|
|
|
+ <if test="boxNum != null ">and box_num = #{boxNum}</if>
|
|
|
+ <if test="suttle != null ">and suttle = #{suttle}</if>
|
|
|
+ <if test="productionDate != null ">and production_date = #{productionDate}</if>
|
|
|
+ <if test="machineTool != null and machineTool != ''">and machine_tool = #{machineTool}</if>
|
|
|
+ <if test="grossWeight != null ">and gross_weight = #{grossWeight}</if>
|
|
|
+ <if test="packaging != null and packaging != ''">and packaging = #{packaging}</if>
|
|
|
+ <if test="workShifts != null and workShifts != ''">and work_shifts = #{workShifts}</if>
|
|
|
+ <if test="foreignTradeNumber != null and foreignTradeNumber != ''">and foreign_trade_number =
|
|
|
+ #{foreignTradeNumber}
|
|
|
+ </if>
|
|
|
+ <if test="canisterWeight != null ">and canister_weight = #{canisterWeight}</if>
|
|
|
+ <if test="boxWeight != null ">and box_weight = #{boxWeight}</if>
|
|
|
+ <if test="tubeColor != null and tubeColor != ''">and tube_color = #{tubeColor}</if>
|
|
|
+ <if test="comPort != null and comPort != ''">and com_port = #{comPort}</if>
|
|
|
+ <if test="printFormat != null and printFormat != ''">and print_format = #{printFormat}</if>
|
|
|
+ <if test="packagingType != null and packagingType != ''">and packaging_type = #{packagingType}</if>
|
|
|
+ <if test="storageLocation != null and storageLocation != ''">and storage_location = #{storageLocation}</if>
|
|
|
+ <if test="warehouseregionId != null ">and warehouseregion_id = #{warehouseregionId}</if>
|
|
|
+ <if test="warehousingTime != null ">and warehousing_time = #{warehousingTime}</if>
|
|
|
+ <if test="depositor != null and depositor != ''">and depositor = #{depositor}</if>
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectProductWarehousingRecordById" parameterType="Long" resultMap="ProductWarehousingRecordResult">
|
|
|
<include refid="selectProductWarehousingRecordVo"/>
|
|
|
where id = #{id}
|
|
|
</select>
|
|
|
-
|
|
|
- <insert id="insertProductWarehousingRecord" parameterType="com.zkqy.business.domain.ProductWarehousingRecord" useGeneratedKeys="true" keyProperty="id">
|
|
|
+
|
|
|
+ <insert id="insertProductWarehousingRecord" parameterType="com.zkqy.business.domain.ProductWarehousingRecord"
|
|
|
+ useGeneratedKeys="true" keyProperty="id">
|
|
|
insert into {DBNAME}.product_warehousing_record
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
<if test="qrCode != null">qr_code,</if>
|
|
@@ -158,7 +197,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="warehouseId != null">warehouse_id,</if>
|
|
|
<if test="productColour">product_colour,</if>
|
|
|
del_flag
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="qrCode != null">#{qrCode},</if>
|
|
|
<if test="qrCodeId != null">#{qrCodeId},</if>
|
|
@@ -191,7 +230,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="warehouseId != null">#{warehouseId},</if>
|
|
|
<if test="productColour">#{productColour},</if>
|
|
|
'0'
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
</insert>
|
|
|
|
|
|
<update id="updateProductWarehousingRecord" parameterType="com.zkqy.business.domain.ProductWarehousingRecord">
|
|
@@ -236,7 +275,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</update>
|
|
|
|
|
|
<delete id="deleteProductWarehousingRecordById" parameterType="Long">
|
|
|
- update {DBNAME}.product_warehousing_record set del_flag = '2' where id = #{id}
|
|
|
+ update {DBNAME}.product_warehousing_record
|
|
|
+ set del_flag = '2'
|
|
|
+ where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteProductWarehousingRecordByQrCode" parameterType="String">
|
|
|
+ update {DBNAME}.product_warehousing_record
|
|
|
+ set del_flag = '2'
|
|
|
+ where qr_code = #{qrCode}
|
|
|
+ and qr_code_id = #{qrCodeId}
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteProductWarehousingRecordByIds" parameterType="String">
|
|
@@ -246,22 +294,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</foreach>
|
|
|
</delete>
|
|
|
|
|
|
- <select id="selectList" parameterType="com.zkqy.business.domain.vo.ProductCodeListVO" resultMap="ProductCodeListResultVO">
|
|
|
+ <select id="selectList" parameterType="com.zkqy.business.domain.vo.ProductCodeListVO"
|
|
|
+ resultMap="ProductCodeListResultVO">
|
|
|
SELECT
|
|
|
- r.*,
|
|
|
- p.product_name,
|
|
|
- p.product_specifications,
|
|
|
- r.product_colour as product_color
|
|
|
+ r.*,
|
|
|
+ p.product_name,
|
|
|
+ p.product_specifications,
|
|
|
+ r.product_colour as product_color
|
|
|
FROM
|
|
|
{DBNAME}.product_warehousing_record r
|
|
|
- LEFT JOIN {DBNAME}.production p ON r.product_id = p.id
|
|
|
+ LEFT JOIN {DBNAME}.production p ON r.product_id = p.id
|
|
|
WHERE
|
|
|
- r.del_flag = '0'
|
|
|
- <if test="qrCode != null and qrCode != ''">and r.qr_code like concat('%', #{qrCode}, '%')</if>
|
|
|
- <if test="lotNum != null and lotNum != ''"> and r.lot_num like concat('%', #{lotNum}, '%')</if>
|
|
|
- <if test="productionDate != null"> and r.production_date = #{productionDate}</if>
|
|
|
- <if test="warehousingTime != null "> and r.warehousing_time = #{warehousingTime}</if>
|
|
|
- <if test="depositor != null and depositor != ''"> and r.depositor like concat('%', #{depositor}, '%')</if>
|
|
|
+ r.del_flag = '0'
|
|
|
+ <if test="qrCode != null and qrCode != ''">and r.qr_code like concat('%', #{qrCode}, '%')</if>
|
|
|
+ <if test="lotNum != null and lotNum != ''">and r.lot_num like concat('%', #{lotNum}, '%')</if>
|
|
|
+ <if test="productionDate != null">and r.production_date = #{productionDate}</if>
|
|
|
+ <if test="warehousingTime != null ">and r.warehousing_time = #{warehousingTime}</if>
|
|
|
+ <if test="depositor != null and depositor != ''">and r.depositor like concat('%', #{depositor}, '%')</if>
|
|
|
order by r.id desc
|
|
|
</select>
|
|
|
|
|
@@ -278,51 +327,51 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
<select id="productionStatistics" resultType="map">
|
|
|
SELECT
|
|
|
- a.*
|
|
|
+ a.*
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ p.id,
|
|
|
+ p.product_name as name,
|
|
|
+ p.product_specifications as spec,
|
|
|
+ -- pr.levels,
|
|
|
+ TRUNCATE(sum( pr.suttle ),2) as suttle,
|
|
|
+ <if test="timeType == 'days'">
|
|
|
+ DATE( pr.warehousing_time ) AS days,
|
|
|
+ </if>
|
|
|
+ <if test="timeType == 'months'">
|
|
|
+ DATE_FORMAT( pr.warehousing_time, '%Y-%m' ) AS months,
|
|
|
+ </if>
|
|
|
+ <if test="timeType == 'quarters'">
|
|
|
+ CONCAT(YEAR ( pr.warehousing_time ),'-',QUARTER ( pr.warehousing_time )) AS quarters,
|
|
|
+ </if>
|
|
|
+ <if test="timeType == 'years'">
|
|
|
+ YEAR ( pr.warehousing_time ) AS years,
|
|
|
+ </if>
|
|
|
+ pr.product_colour as productColour
|
|
|
FROM
|
|
|
- (
|
|
|
- SELECT
|
|
|
- p.id,
|
|
|
- p.product_name as name,
|
|
|
- p.product_specifications as spec,
|
|
|
--- pr.levels,
|
|
|
- TRUNCATE(sum( pr.suttle ),2) as suttle,
|
|
|
- <if test="timeType == 'days'">
|
|
|
- DATE( pr.warehousing_time ) AS days,
|
|
|
- </if>
|
|
|
- <if test="timeType == 'months'">
|
|
|
- DATE_FORMAT( pr.warehousing_time, '%Y-%m' ) AS months,
|
|
|
- </if>
|
|
|
- <if test="timeType == 'quarters'">
|
|
|
- CONCAT(YEAR ( pr.warehousing_time ),'-',QUARTER ( pr.warehousing_time )) AS quarters,
|
|
|
- </if>
|
|
|
- <if test="timeType == 'years'">
|
|
|
- YEAR ( pr.warehousing_time ) AS years,
|
|
|
- </if>
|
|
|
- pr.product_colour as productColour
|
|
|
- FROM
|
|
|
- {DBNAME}.product_warehousing_record pr
|
|
|
- LEFT JOIN {DBNAME}.production p ON pr.product_id = p.id
|
|
|
+ {DBNAME}.product_warehousing_record pr
|
|
|
+ LEFT JOIN {DBNAME}.production p ON pr.product_id = p.id
|
|
|
WHERE
|
|
|
- pr.del_flag = '0'
|
|
|
+ pr.del_flag = '0'
|
|
|
GROUP BY
|
|
|
- pr.product_id,
|
|
|
--- pr.levels,
|
|
|
- pr.product_colour
|
|
|
- ) AS a
|
|
|
+ pr.product_id,
|
|
|
+ -- pr.levels,
|
|
|
+ pr.product_colour
|
|
|
+ ) AS a
|
|
|
WHERE
|
|
|
- <if test="timeType == 'days'">
|
|
|
- days = #{timeParam}
|
|
|
- </if>
|
|
|
- <if test="timeType == 'months'">
|
|
|
- months = #{timeParam}
|
|
|
- </if>
|
|
|
- <if test="timeType == 'quarters'">
|
|
|
- quarters = #{timeParam}
|
|
|
- </if>
|
|
|
- <if test="timeType == 'years'">
|
|
|
- years = #{timeParam}
|
|
|
- </if>
|
|
|
+ <if test="timeType == 'days'">
|
|
|
+ days = #{timeParam}
|
|
|
+ </if>
|
|
|
+ <if test="timeType == 'months'">
|
|
|
+ months = #{timeParam}
|
|
|
+ </if>
|
|
|
+ <if test="timeType == 'quarters'">
|
|
|
+ quarters = #{timeParam}
|
|
|
+ </if>
|
|
|
+ <if test="timeType == 'years'">
|
|
|
+ years = #{timeParam}
|
|
|
+ </if>
|
|
|
</select>
|
|
|
|
|
|
</mapper>
|