• MyBatis 查询集合中的数据


    dao 


    List<KdTaskEntity> queryByIds(Long[] idslist);

    xml

    <select id="queryByIds" resultType="io.renren.modules.generator.entity.KdTaskEntity">
    select * from kd_task where id in 
    <foreach item="taskId" collection="array" open="(" separator="," close=")">
    #{taskId}
    </foreach> 
    </select>
    

    control

    	@RequestMapping("/queryAllByIds")	
    	public R queryAllByIds(@RequestBody Long[] ids) {
    	
    		Collection<KdTaskEntity> taskList = kdTaskService.listByIds(Arrays.asList(ids));
    		return R.ok().put("List", taskList);
    
    	}
    

    js

     getSameDataList_post() {
          //debugger;;
          this.dataListLoading = true;
          this.$http({
            url: this.$http.adornUrl(
              "/generator/kdtask/queryAllByIds"
            ),      
            method: "post",
            data: this.$http.adornData(this.taskIdsArray, false)
            // params: this.$http.adornParams({
            //   // ids: this.taskIdsArray,
            //   data: this.$http.adornData(this.taskIdsArray, false)
            // }),
          }).then(({ data }) => {
            if (data && data.code === 0) {
              this.dataList = data.List;         
            } else {
              this.totalPage = 0;
            }
            this.dataListLoading = false;
          });
        },
    

      

  • 相关阅读:
    圣杯布局(定宽与自适应)
    【转载】jQuery插件开发精品教程,让你的jQuery提升一个台阶
    DOM 事件深入浅出(一)
    匿名类型
    类和结构
    C#预处理器指令
    Main()方法
    枚举
    预定义数据类型
    C#语言
  • 原文地址:https://www.cnblogs.com/dayspring/p/13954553.html
Copyright © 2020-2023  润新知