js:
function getAgingVolumeList(){
$.ajax({
url:ctxPath+'/storeValueController/getAgingVolumeList.shtml',
dataType:'json',
type:'post',
async:true,
success:function(data){
var list =data.list;
if(list.length>0){
var arr=[];
arr.push('<option value="" >请选择</option>');
for(var i=0;i<list.length;i++){
var obj=list[i];
arr.push('<option value="'+obj.CODE+'" data-name="'+obj.NAME+'" >'+obj.CODEVALUE+'-'+obj.NAME+'</option>');
}
$("#sxj").html(arr.join(''));
QJ_layuiform.render();
}
return '';
}
});
};
controller:
@ResponseBody
@RequestMapping(value = "/getAgingVolumeList")
JSONObject getAgingVolumeList(HttpServletRequest request, HttpServletResponse response) {
JSONObject json = new JSONObject();
Map<String, String> reqMap = buildRequestParameterToMap(request);
try {
json=storeValueService.getAgingVolumeList(request,reqMap);
} catch (Exception e) {
json.put("code","9999");
json.put("msg", "获取教师属性程序出错,请联系管理员");
e.printStackTrace();
}
return json;
}
dao:
List<?> getAgingVolumeList(Map<String, String> params);
service:
//获取时效卡数据
public JSONObject getAgingVolumeList(HttpServletRequest request,Map<String, String> params) {
JSONObject json = new JSONObject();
List<?> teacherScheduTeacherList =new ArrayList<>();
teacherScheduTeacherList = storeValueDao.getAgingVolumeList(params);
json.put("list", teacherScheduTeacherList);
return json;
}
sql:
<!-- 获取时效卷数据 -->
<select id="getAgingVolumeList" parameterType="hashmap"
resultType="hashmap">
SELECT CONCAT(REC_ID, '') AS CODE,
CONCAT(F_CODE, '') AS
CODEVALUE,
F_NAME AS NAME
FROM t_cg_coupon
WHERE REC_STATUS = '1'
</select>