refactor(wms): 重构产品销售脚本查询接口
-移除 WmsProductSalesScriptMapper 中的 LambdaQueryWrapper 参数 - 添加 WmsProductSalesScriptBo 参数替代原有的查询封装方式 - 更新 XML 文件中的 SQL 查询逻辑,使用动态 SQL 替代自定义 SQL 段 - 简化 WmsProductSalesScriptServiceImpl 中的查询方法
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
package com.klp.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.klp.domain.WmsProductSalesScript;
|
||||
import com.klp.domain.bo.WmsProductSalesScriptBo;
|
||||
import com.klp.domain.vo.WmsProductSalesScriptVo;
|
||||
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
@@ -16,5 +15,5 @@ import org.apache.ibatis.annotations.Param;
|
||||
*/
|
||||
public interface WmsProductSalesScriptMapper extends BaseMapperPlus<WmsProductSalesScriptMapper, WmsProductSalesScript, WmsProductSalesScriptVo> {
|
||||
|
||||
Page<WmsProductSalesScriptVo> selectVoPagePlus(Page<Object> build,@Param("ew") LambdaQueryWrapper<WmsProductSalesScript> lqw);
|
||||
Page<WmsProductSalesScriptVo> selectVoPagePlus(Page<Object> build,@Param("bo") WmsProductSalesScriptBo bo);
|
||||
}
|
||||
|
||||
@@ -55,8 +55,7 @@ public class WmsProductSalesScriptServiceImpl implements IWmsProductSalesScriptS
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<WmsProductSalesScriptVo> queryPageList(WmsProductSalesScriptBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<WmsProductSalesScript> lqw = buildQueryWrapper(bo);
|
||||
Page<WmsProductSalesScriptVo> result = baseMapper.selectVoPagePlus(pageQuery.build(), lqw);
|
||||
Page<WmsProductSalesScriptVo> result = baseMapper.selectVoPagePlus(pageQuery.build(),bo);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
|
||||
@@ -21,8 +21,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<select id="selectVoPagePlus" resultType="com.klp.domain.vo.WmsProductSalesScriptVo">
|
||||
SELECT s.*, p.product_code, p.product_name
|
||||
FROM wms_product_sales_script s
|
||||
LEFT JOIN wms_product p ON s.product_id = p.product_id
|
||||
${ew.customSqlSegment}
|
||||
LEFT JOIN wms_product p ON s.product_id = p.product_id and p.del_flag = 0
|
||||
<where>
|
||||
s.del_flag = 0
|
||||
<if test="bo.scriptId!= null">
|
||||
AND s.script_id = #{bo.scriptId}
|
||||
</if>
|
||||
<if test="bo.productId!= null">
|
||||
AND s.product_id = #{bo.productId}
|
||||
</if>
|
||||
<if test="bo.scriptTitle!= null and bo.scriptTitle!= ''">
|
||||
AND s.script_title LIKE CONCAT('%', #{bo.scriptTitle}, '%')
|
||||
</if>
|
||||
<if test="bo.scriptContent!= null and bo.scriptContent!= ''">
|
||||
AND s.script_content LIKE CONCAT('%', #{bo.scriptContent}, '%')
|
||||
</if>
|
||||
<if test="bo.featurePoint!= null">
|
||||
AND s.feature_point = #{bo.featurePoint}
|
||||
</if>
|
||||
<if test="bo.isEnabled!= null">
|
||||
AND s.is_enabled = #{bo.isEnabled}
|
||||
</if>
|
||||
<if test="bo.keyword!= null and bo.keyword!= ''">
|
||||
AND (s.script_title LIKE CONCAT('%', #{bo.keyword}, '%')
|
||||
OR s.script_content LIKE CONCAT('%', #{bo.keyword}, '%'))
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user