Commit 7d9aa4d2 authored by frank.xa.zhang's avatar frank.xa.zhang

fixed SQL issue

parent a391b98a
...@@ -156,9 +156,9 @@ public class TemplateController extends BaseController { ...@@ -156,9 +156,9 @@ public class TemplateController extends BaseController {
} }
@RequestMapping(value = "getGroupTemplateByGroupId", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "getGroupTemplateByGroupID", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody public @ResponseBody
OperationResultDto<List<TemplateByGroupDto>> getGroupTemplateByGroupId(@RequestParam Long templateGroupId, @RequestParam String projectId) { OperationResultDto<List<TemplateByGroupDto>> getGroupTemplateByGroupId(@RequestParam(name="templateGroupID") Long templateGroupId, @RequestParam(name="projectID") String projectId) {
OperationResultDto resultDto = new OperationResultDto(); OperationResultDto resultDto = new OperationResultDto();
if (templateGroupId == null || templateGroupId.equals("undefined") || StringUtils.isBlank(projectId) || projectId.equals("undefined")) { if (templateGroupId == null || templateGroupId.equals("undefined") || StringUtils.isBlank(projectId) || projectId.equals("undefined")) {
resultDto.setResult(false); resultDto.setResult(false);
......
...@@ -238,7 +238,9 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ ...@@ -238,7 +238,9 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ
TemplateExample example = new TemplateExample(); TemplateExample example = new TemplateExample();
List<Long> ids = new ArrayList<>(); List<Long> ids = new ArrayList<>();
ids.add(templateGroupId); ids.add(templateGroupId);
if(!bspl.equals(null)) {
ids.add(bspl); ids.add(bspl);
}
example.createCriteria().andTemplateGroupIdIn(ids); example.createCriteria().andTemplateGroupIdIn(ids);
example.setOrderByClause(" order_index"); example.setOrderByClause(" order_index");
List<Template> templates = templateMapper.selectByExample(example); List<Template> templates = templateMapper.selectByExample(example);
......
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
A.NAME, A.NAME,
A.CODE A.CODE
FROM FROM
TAX_ADMIN.TEMPLATE A TEMPLATE A
WHERE WHERE
A.TEMPLATE_GROUP_ID = #{templateGroupID,jdbcType=VARCHAR} A.TEMPLATE_GROUP_ID = #{templateGroupID,jdbcType=VARCHAR}
AND A.IS_ACTIVE_ASSOCIATION = 1 AND A.IS_ACTIVE_ASSOCIATION = 1
...@@ -137,7 +137,7 @@ ...@@ -137,7 +137,7 @@
B.PERIOD, B.PERIOD,
B.TEMPLATE_ID B.TEMPLATE_ID
FROM FROM
REPORT b PERIOD_REPORT b
WHERE WHERE
b.PERIOD = #{period,jdbcType=INTEGER} b.PERIOD = #{period,jdbcType=INTEGER}
AND B.PROJECT_ID = #{projectId,jdbcType=VARCHAR} AND B.PROJECT_ID = #{projectId,jdbcType=VARCHAR}
......
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