mybatis报错org.apache.ibatis.binding.BindingException:

Integerid=Integer.valueOf(String.valueOf(map.get("id")));inttype=Integer.valueOf(Stri... Integer id = Integer.valueOf(String.valueOf(map.get("id"))); int type = Integer.valueOf(String.valueOf(map.get("type")));
meetingService.deletemeeting(type, id);

2018-08-02 09:27:48.245 INFO 请求参数:{type=3, id=58}
2018-08-02 09:27:49.358 INFO {dataSource-1} inited
-------------------id:58; type:3
2018-08-02 09:27:50.228 INFO 请求异常:nested exception is org.apache.ibatis.binding.BindingException: Parameter 'id' not found. Available parameters are [arg1, arg0, param1, param2]
2018-08-02 09:27:50.355 INFO 127.0.0.1 2801 /aspire-meeting-test/meetingsummary/meeting/delete { "type" : 3, "id" : 58} {"respStatus":"1","respDesc":"请求失败","data":"请求接口发生异常"}

mybatis的sql
<update id="deletemeeting" parameterType="java.lang.Integer" >
UPDATE meeting SET status = 0 WHERE id=#{id} and type=#{type}
</update>
这个语句缺报上面的错,
各位大神,什么原因?有什么方法解决吗
展开
 我来答
很多游戏
高粉答主

2019-11-16 · 游戏精通者,攻略技能点满
很多游戏
采纳数:91 获赞数:387018

向TA提问 私信TA
展开全部

原因:缺少xml文件造成的。

1、在pom.xml build标签内加入 resources配置,不过滤配置文件即可,首先输入代码:

 <build>

<!--将mapper文件打包进去-->

<resources>

<resource>

                <!--指定根目录 到源文件夹 一般如下-->

<directory>src/main/java</directory>

2、然后输入下方的代码:

<includes>

<include>**/*.properties</include>

<include>**/*.xml</include>

</includes>

<filtering>false</filtering>

</resource>

</resources>

</build>

3、然后重新编译,出现xml文件,运行正常。

鲁东孙漂流记
2018-08-02 · TA获得超过513个赞
知道小有建树答主
回答量:892
采纳率:85%
帮助的人:136万
展开全部
import android.os.Bundle;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.google.gson.reflect.TypeToken;
import com.lingnet.app.tv.R;
import com.lingnet.app.tv.adapter.LeftTypeListAdapter;
import com.lingnet.app.tv.adapter.TopTypeListAdapter;
import com.lingnet.app.tv.adapter.VenueAdapter;
import com.lingnet.app.tv.bean.BaseBean;
import com.lingnet.app.tv.constant.Const;
import com.lingnet.app.tv.constant.RequestType;
import com.lingnet.app.tv.view.SpacesItemDecoration;
import com.yanzhenjie.recyclerview.swipe.SwipeItemClickListener;
import com.yanzhenjie.recyclerview.swipe.SwipeMenuRecyclerView;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import butterknife.BindView;
import butterknife.ButterKnife;
import retrofit2.Call;

/**
 */
public class TvWisdomVenueFragment extends BaseFragment {

    @BindView(R.id.recyclerview_navi_left)
    RecyclerView recyclerViewLeft;
    @BindView(R.id.recyclerview_navi_top)
    RecyclerView recyclerViewTop;
    TopTypeListAdapter mTopTypeListAdapter;
    LeftTypeListAdapter mLeftTypeListAdapter;

    @BindView(R.id.recyclerview)
    SwipeMenuRecyclerView recyclerView;
    VenueAdapter venueAdapter;

    int currentPage = 0;
    String categoryId = "";


    public TvWisdomVenueFragment() {
        // Required empty public constructor
    }

    /**
     */
    public static TvWisdomVenueFragment newInstance() {
        TvWisdomVenueFragment fragment = new TvWisdomVenueFragment();
        return fragment;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (getArguments() != null) {
        }
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View v = inflater.inflate(R.layout.fragment_tv_wisdom_venue, container, false);
        ButterKnife.bind(this, v);
        initRecyclerViewRecommand();
        sendTypeRequest();
        return v;
    }

    private void initRecyclerViewRecommand() {

        HashMap<String, Integer> stringIntegerHashMap = new HashMap<>();
        stringIntegerHashMap.put(SpacesItemDecoration.TOP_DECORATION, 0);//top间距
        stringIntegerHashMap.put(SpacesItemDecoration.BOTTOM_DECORATION, 0);//底部间距
        stringIntegerHashMap.put(SpacesItemDecoration.LEFT_DECORATION, 0);//左间距
        stringIntegerHashMap.put(SpacesItemDecoration.RIGHT_DECORATION, 0);//右间距
        SpacesItemDecoration itemDecoration = new SpacesItemDecoration(stringIntegerHashMap);


        final GridLayoutManager  mGridLayoutManager=new GridLayoutManager(mActivity,2);
        recyclerView.setLayoutManager(mGridLayoutManager);
        recyclerView.setHasFixedSize(true);
        recyclerView.setItemAnimator(null);
        recyclerView.setNestedScrollingEnabled(false);
//        recyclerView.addItemDecoration(new DefaultItemDecoration(ContextCompat.getColor(mActivity, R
//                .color.divider)));
        recyclerView.setSwipeItemClickListener(new SwipeItemClickListener() {
            @Override
            public void onItemClick(View itemView, int position) {
                Map<String, String> data = venueAdapter.dataList.get(position);
                Bundle bundle = new Bundle();
                bundle.putString("id", data.get("id"));
                startNextActivity(bundle, ChanggDetailActivity.class);
            }
        });
//        recyclerView.useDefaultLoadMore();
//        recyclerView.setLoadMoreListener(mLoadMoreListener);
        venueAdapter = new VenueAdapter(mActivity);
        venueAdapter.setHasStableIds(true);
        recyclerView.setAdapter(venueAdapter);
        recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
            @Override
            public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
                super.onScrollStateChanged(recyclerView, newState);
                if(newState == RecyclerView.SCROLL_STATE_IDLE){
                    int lastVisiblePosition = mGridLayoutManager.findLastVisibleItemPosition();
                    if(lastVisiblePosition >= mGridLayoutManager.getItemCount() - 1){
                        currentPage++;
                        sendRequest();
//                        System.out.println("====自动加载");
                    }
                }
            }
        });
        //
        recyclerViewLeft.setLayoutManager(new LinearLayoutManager(mActivity));
        recyclerViewLeft.setHasFixedSize(true);
        recyclerViewLeft.setNestedScrollingEnabled(false);
        recyclerView.addItemDecoration(itemDecoration);
        mLeftTypeListAdapter = new LeftTypeListAdapter(mActivity);
        mLeftTypeListAdapter.setmIOnLeftClicListener(new LeftTypeListAdapter.IOnLeftClicListener() {
            @Override
            public void onLeftClick(int post) {
                mLeftTypeListAdapter.setSelectPos(post);
                mLeftTypeListAdapter.notifyDataSetChanged();

                Map<String, String> data = mLeftTypeListAdapter.dataList.get(post);
                categoryId = data.get("name");
                onRefresh();
            }
        });
        recyclerViewLeft.setAdapter(mLeftTypeListAdapter);
        //
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(mActivity, LinearLayoutManager.HORIZONTAL,
                false);
        recyclerViewTop.setLayoutManager(linearLayoutManager);
        recyclerViewTop.setHasFixedSize(true);
        recyclerViewTop.setNestedScrollingEnabled(false);

        mTopTypeListAdapter = new TopTypeListAdapter(mActivity);
        recyclerViewTop.setAdapter(mTopTypeListAdapter);
    }

    /**
     * 加载更多。
     */
    private SwipeMenuRecyclerView.LoadMoreListener mLoadMoreListener = new SwipeMenuRecyclerView.LoadMoreListener() {
        @Override
        public void onLoadMore() {
            currentPage++;
            sendRequest();
        }
    };

    private void onRefresh() {
        venueAdapter.notifyDataSetChanged(null);//先清空数据
        currentPage = 0;
        sendRequest();
    }

    private void sendTypeRequest() {
        Call<BaseBean> call = client.venueCategoryzh();
        sendRequest(call, RequestType.venueCategoryzh, false);
    }

    private void sendRequest() {
        Map<String, String> params = new HashMap<>();
        params.put("pageSize", "" + Const.PAGESIZE);
        params.put("pageIndex", "" + currentPage);
        params.put("categoryId", categoryId);
        Call<BaseBean> call = client.venueList(params);
        sendRequest(call, RequestType.venueList, true);
    }

    @Override
    public void requestCallBack(String dataJson, RequestType type) {
        switch (type) {
            case venueCategoryzh:
                Map<String, String[]> data = mGson.fromJson(dataJson, new TypeToken<Map<String, String[]>>() {
                }.getType());
                String[] types = data.get("name");
                if (types != null && types.length > 0) {
                    categoryId = types[0];
                    List<Map<String, String>> dataList = new ArrayList<>();
                    for (String s : types) {
                        Map<String, String> temp = new HashMap<>();
                        temp.put("name", s);
                        dataList.add(temp);
                    }
                    mLeftTypeListAdapter.setSelectPos(0);
                    mLeftTypeListAdapter.notifyDataSetChanged(dataList);
                }
                sendRequest();
                break;
            case venueList:
                List<HashMap<String, String>> dataList = mGson.fromJson(dataJson, new
                        TypeToken<List<HashMap<String, String>>>() {
                        }.getType());
                venueAdapter.notifyDataSetChanged(dataList);

                recyclerView.loadMoreFinish((dataList == null || dataList.size() == 0), true);
                break;
        }
    }

    @Override
    public void requestFailed(String error, RequestType type) {
        recyclerView.loadMoreError(0, "请求网络失败");
    }

}
追问
我想知道,你的那个解答和我提问的有关系吗?
本回答被网友采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式