each用法、mybatis传递多个参数方法
来源:互联网 发布:主角创造人工智能小说 编辑:程序博客网 时间:2024/06/05 07:57
//获取当前月份
var yearMonth = date.getFullYear()+"-"+(date.getMonth()+1);
//select动态显示
var html = "<option value='-1'>请选择</option>";
$.each(data, function(i, trObj){
html += "<option value='"+trObj.id+"'>"+trObj.name+"</option>";
});
if(level ==2)
{
$("#entryDeptBuEdit").empty();
$('#entryDeptBuEdit').append(html);
$("#sensitive_bu").empty();
$('#sensitive_bu').append(html);
}
//多个查询条件的mybatis方法
//1.map方法
//service层
@Override
public BoleRecommend checkIdCardEffective(String idCard) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM");
String currentDate = format.format(new Date());
Map<String, String> map = new HashMap<String, String>();
map.put("idCard",idCard);
map.put("date",currentDate);
BoleRecommend bole = boleRecomDao.checkIdCardEffective(map);
return bole;
}
//Dao层
public BoleRecommend checkIdCardEffective(Map<String, String> map);
//mapper.xml层
<select id="checkIdCardEffective" resultMap="boleRecommendBean" parameterType ="map">
select * from bole_recommend_t where yearmonth=#{date} and ID_num = #{idCard}
</select>
//2.注解方法
@RequestMapping(value = "/getWebsiteByChannel")
public void getWebsiteByChannel(String recruitChannel,String year ,String month, HttpServletResponse response) {
JsonArray jo = channelAnalysisService.getWebsiteByChannel(recruitChannel, year, month);
try {
response.getWriter().print(jo.toString());
} catch (IOException e) {
e.printStackTrace();
}
}
@Override
public JsonArray getWebsiteByChannel(String recruitChannel, String year, String month) {
JsonArray ja = new JsonArray();
List<ChannelAnalysis> list = channelAnalysisMapper.getWebsiteByChannel(recruitChannel, year, month);
for (int i = 0; i < list.size(); i++) {
JsonObject jo = new JsonObject();
jo.addProperty("year", list.get(i).getYear());
jo.addProperty("month", list.get(i).getMonth());
jo.addProperty("recruitWebsite", list.get(i).getRecruitWebsite());
jo.addProperty("channelMonthNum", list.get(i).getChannelMonthNum());
ja.add(jo);
}
return ja;
}
public List<ChannelAnalysis> getRecruitWebsiteByCenter(@Param("recruitCenter")String recruitCenter,@Param("year")String year,@Param("month")String month);
<select id="getRecruitWebsiteByCenter" resultMap="ChannelAnalysisBean" >
select
*
from
recruite_channel_show_t
where
recruit_website IS null AND recruit_center=#{recruitCenter} AND year=#{year} AND month=#{month}
</select>
- each用法、mybatis传递多个参数方法
- MyBatis传递多个参数的方法
- MyBatis传递多个参数的方法
- Mybatis传递多个参数
- Mybatis传递多个参数
- Mybatis传递多个参数
- mybatis传递多个参数
- mybatis传递多个参数
- Mybatis传递多个参数
- Mybatis传递多个参数
- MyBatis传递多个参数,
- Mybatis传递多个参数
- Mybatis传递多个参数
- MyBatis传递多个参数
- mybatis 传递多个参数
- mybatis传递多个参数
- mybatis传递多个参数
- mybatis 传递多个参数 --解决mybatis查询使用多个参数方法--javabean传统方法和map方法
- docker相关产品情况
- Person search 学习 二
- BZOJ2005 能量汇集 【gcd求和】
- Android UI Libs之android-stackblur模糊照片
- CentOS Git配置
- each用法、mybatis传递多个参数方法
- Java反射机制操作对象赋值
- 职业规划---菜鸟级
- FL Studio12汉化版教程之如何将音轨转录为波形文件
- 动画大全:nineoldandroids
- 定时任务命令crontab
- C++11之initialization_list
- 两边横线,中间标题
- python 多个字符串合并操作"a" 'b' "c"="a"+'b'+"c"=abc