Commit 7b154f6a authored by Quxl's avatar Quxl

x

parent 13f416d5
package com.egolm.film.api.service;
import java.util.List;
import java.util.Map;
public interface CinemaService {
List<Map<String, Object>> getCinemaListForSelected(String keyword);
}
package com.egolm.film.api.service.impl;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.egolm.common.StringUtil;
import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.film.api.service.CinemaService;
import com.egolm.film.util.SqlWhere;
@Service
public class CinemaServiceImpl implements CinemaService {
@Autowired
JdbcTemplate jdbcTemplate;
@Override
public List<Map<String, Object>> getCinemaListForSelected(String keyword) {
SqlWhere where = new SqlWhere().lk(new String[] {"cinema_no", "cinema_name", "cinema_en_name"}, keyword);
String sql = ""
+ "select "
+ "cinema_no, "
+ "cinema_name, "
+ "cinema_en_name, "
+ "cinema_address, "
+ "cinema_en_address, "
+ "telphone "
+ "from "
+ "fc_cinema " + StringUtil.join(" and ", " where ", " ", " ", where.getStringList())
+ "group by "
+ "cinema_no, "
+ "cinema_name, "
+ "cinema_en_name, "
+ "cinema_address, "
+ "cinema_en_address, "
+ "telphone "
;
return jdbcTemplate.queryForList(sql, where.getObjectArray());
}
}
package com.egolm.film.api.web.admin;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import com.egolm.common.bean.Rjx;
import com.egolm.film.api.service.CinemaService;
import com.egolm.film.bean.Fc_cinema;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@Api
@RestController
@RequestMapping({"/admin/cinema"})
public class CinemaController {
@Autowired
CinemaService service;
@ResponseBody
@PostMapping("save")
@ApiOperation("保存影院影厅")
public Object save(Fc_cinema cinema) {
return Rjx.jsonOk();
}
@ResponseBody
@PostMapping("getCinemaListForSelected")
@ApiOperation("查询影院列表")
public Object getCinemaListForSelected(String keyword) {
List<Map<String, Object>> list = service.getCinemaListForSelected(keyword);
return Rjx.jsonOk().setData(list);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment