feat:预炸
This commit is contained in:
@@ -2,6 +2,8 @@ package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.dto.pre.fry.DailyFryCountDTO;
|
||||
import com.cool.store.dto.pre.fry.PreFryRecordQueryDTO;
|
||||
import com.cool.store.dto.pre.fry.PreFryRecordsDTO;
|
||||
import com.cool.store.entity.PreFryRecordsDO;
|
||||
import com.cool.store.mapper.PreFryRecordsMapper;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
@@ -75,6 +77,9 @@ public class PreFryRecordsDAO {
|
||||
}
|
||||
|
||||
|
||||
public List<PreFryRecordsDTO> selectByQueryDTO(PreFryRecordQueryDTO dto) {
|
||||
return preFryRecordsMapper.selectByQueryDTO(dto);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.dto.pre.fry.DailyFryCountDTO;
|
||||
import com.cool.store.dto.pre.fry.PreFryRecordQueryDTO;
|
||||
import com.cool.store.dto.pre.fry.PreFryRecordsDTO;
|
||||
import com.cool.store.entity.PreFryRecordsDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
@@ -22,6 +24,11 @@ public interface PreFryRecordsMapper extends Mapper<PreFryRecordsDO> {
|
||||
@Param("queryDate") String queryDate);
|
||||
|
||||
|
||||
List<DailyFryCountDTO> selectDailyFryCountInCurrentMonth(
|
||||
@Param("storeCode") String storeCode,@Param("time") Long time);
|
||||
List<DailyFryCountDTO> selectDailyFryCountInCurrentMonth(@Param("storeCode") String storeCode,@Param("time") Long time);
|
||||
|
||||
|
||||
List<PreFryRecordsDTO> selectByQueryDTO(@Param("query") PreFryRecordQueryDTO dto);
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -14,6 +14,8 @@
|
||||
<result column="latest_sale_time" jdbcType="TIMESTAMP" property="latestSaleTime" />
|
||||
<result column="current_stage" jdbcType="TINYINT" property="currentStage" />
|
||||
<result column="current_apply_type" jdbcType="TINYINT" property="currentApplyType" />
|
||||
<result column="violation_flag" jdbcType="TINYINT" property="violationFlag" />
|
||||
<result column="violation_reason" jdbcType="TINYINT" property="violationReason" />
|
||||
<result column="created_time" jdbcType="TIMESTAMP" property="createdTime" />
|
||||
<result column="updated_time" jdbcType="TIMESTAMP" property="updatedTime" />
|
||||
</resultMap>
|
||||
@@ -67,6 +69,53 @@
|
||||
ORDER BY fry_date
|
||||
</select>
|
||||
|
||||
<select id="selectByQueryDTO" resultType="com.cool.store.dto.pre.fry.PreFryRecordsDTO">
|
||||
SELECT
|
||||
a.id as id,
|
||||
a.record_code as recordCode,
|
||||
a.current_stage as currentStage,
|
||||
a.fry_date as fryDate,
|
||||
a.violation_flag as violationFlag,
|
||||
a.violation_reason as violationReason,
|
||||
b.product_name as productName,
|
||||
b.product_code as productCode,
|
||||
c.store_name as storeName,
|
||||
c.store_num as storeNum
|
||||
FROM xfsg_pre_fry_records a
|
||||
LEFT JOIN xfsg_pre_fried_products b ON a.product_id = b.id
|
||||
LEFT JOIN store_5558ce7a3aa84e3590392fcaa8697ffb c ON a.store_code = c.store_num
|
||||
<where>
|
||||
<if test="query.recordCode != null and query.recordCode != ''">
|
||||
AND a.record_code LIKE CONCAT('%', #{query.recordCode}, '%')
|
||||
</if>
|
||||
<if test="query.storeCode != null and query.storeCode != ''">
|
||||
AND a.store_code LIKE CONCAT('%', #{query.storeCode}, '%')
|
||||
</if>
|
||||
<if test="query.storeName != null and query.storeName != ''">
|
||||
AND c.store_name LIKE CONCAT('%', #{query.storeName}, '%')
|
||||
</if>
|
||||
<if test="query.productCode != null and query.productCode != ''">
|
||||
AND b.product_code LIKE CONCAT('%', #{query.productCode}, '%')
|
||||
</if>
|
||||
<if test="query.productName != null and query.productName != ''">
|
||||
AND b.product_name LIKE CONCAT('%', #{query.productName}, '%')
|
||||
</if>
|
||||
<if test="query.currentStage != null">
|
||||
AND a.current_stage = #{query.currentStage}
|
||||
</if>
|
||||
<if test="query.fryStartDate != null and query.fryEndDate != null">
|
||||
AND a.fry_date BETWEEN #{query.fryStartDate} AND #{query.fryEndDate}
|
||||
</if>
|
||||
<if test="query.violationFlag != null">
|
||||
AND a.violation_flag = #{query.violationFlag}
|
||||
</if>
|
||||
<if test="query.violationReason != null">
|
||||
AND a.violation_reason = #{query.violationReason}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY a.fry_date DESC
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user