zoukankan      html  css  js  c++  java
  • 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;
          });
        },
    

      

  • 相关阅读:
    Day3-B-Round Marriage CodeForces-981F
    Day3-A-Problem H. Monster Hunter HDU6326
    Day3-G
    Day3-I-Squares POJ2002
    Day3-M-Cable master POJ1064
    Day3-N
    Day3-O-Median POJ3579
    Day3-P
    Day3-L-Cup HDU2289
    LeetCode "Majority Element"
  • 原文地址:https://www.cnblogs.com/dayspring/p/13954553.html
Copyright © 2011-2022 走看看