TienChin 渠道管理-渠道搜索

发布时间 2023-09-17 23:36:23作者: BNTang

ChannelController

@PreAuthorize("hasPermission('tienchin:channel:list')")
@GetMapping("/list")
TableDataInfo list(ChannelVO channelVO) {
    startPage();
    List<Channel> list = iChannelService.selectChannelList(channelVO);
    return getDataTable(list);
}

IChannelService

/**
 * 分页查询渠道列表
 *
 * @param channelVO 渠道信息搜索条件
 * @return {@code List<Channel> }
 * @author BNTang
 * @since 2023/09/03 11:16:03
 */
List<Channel> selectChannelList(ChannelVO channelVO);

ChannelServiceImpl

@Override
public List<Channel> selectChannelList(ChannelVO channelVO) {
    return channelMapper.selectChannelList(channelVO);
}

ChannelMapper

/**
 * 分页查询渠道列表
 *
 * @param channelVO 渠道信息搜索条件
 * @return {@code List<Channel> }
 * @author BNTang
 * @since 2023/09/03 11:16:03
 */
List<Channel> selectChannelList(ChannelVO channelVO);

ChannelMapper.xml

...

<if test="channelName != null">
    AND channel_name LIKE CONCAT('%', #{channelName}, '%')
</if>
<if test="status != null">
    AND status = #{status}
</if>
<if test="type != null">
    AND type = #{type}
</if>
<if test="params.beginTime != null and params.endTime != null">
    AND create_time BETWEEN #{params.beginTime} AND #{params.endTime}
</if>