一、前端 vue 页面的实现
<elx-table ref="table" :url="url" :columns="columns" :initParams="initParams" :searchParams="searchParams"> </elx-table>
***********************************************
data() { return { url: "/loan/batchTaskStatusAction.do?_md=selectForPage", columns: [ { prop: "batchNo", label: "批次号" }, { prop: "taskCode", label: "任务编码" }, { prop: "trandate", label: "交易日期" }, { prop: "clickType", label: "触发类型" }, { prop: "status", label: "状态" }, { prop: "startTime", label: "开始时间" }, { prop: "endTime", label: "结束时间" }, { prop: "errorMsg", label: "错误信息" }], initParams: {}, searchParams: {}, } },
二、后台代码的实现
public class BatchTaskStatusAction extends QueryTemplateAction { @Autowired private TaskStatusService taskStatusService; /** * 方法功能: selectForPage * 方法描述: 搜索所有的页面 * 作者: yangzhu * 日期: 2018-08-18 */ public Result selectForPage(Context context) { TaskStatus taskStatus = ContextUtils.getBean(TaskStatus.class, context); PageBounds pageBounds = ContextUtils.getPageBounds(context); PageList<TaskStatus> taskStatusPageList = taskStatusService.selectForPage(taskStatus, pageBounds); return Result.success(new PageVo<>(taskStatusPageList), "查询成功!"); } }
*************************************************************************
public interface TaskStatusService { PageList<TaskStatus> selectForPage(TaskStatus taskStatus, PageBounds pager); }
*********************************************************
@Service public class TaskStatusServiceImpl implements TaskStatusService { @Resource private TaskStatusMapper taskStatusMapper; @Override public PageList<TaskStatus> selectForPage(TaskStatus taskStatus, PageBounds pager) { return taskStatusMapper.selectForPage(taskStatus,pager); } }
***************************************************
/** * yangzhu */ public interface TaskStatusMapper { PageList<TaskStatus> selectForPage(TaskStatus taskStatus, PageBounds pager); }
************************************************
<select id="selectForPage" resultMap="BaseResultMap" parameterType="com.csii.loan.common.model.batch.TaskStatus"> SELECT <include refid="Base_Column_List"/> FROM batch_task_status <where> <if test="batchNo != null"> and batch_no = #{batchNo,jdbcType=VARCHAR} </if> <if test="taskCode != null"> and task_code = #{taskCode,jdbcType=VARCHAR} </if> <if test="trandate != null"> and trandate = #{trandate,jdbcType=VARCHAR} </if> <if test="clickType != null"> and click_type = #{clickType,jdbcType=VARCHAR} </if> </where> </select>
****************************************************************************