Commit 0c5f4ada authored by Administrator's avatar Administrator

添加了groupList的实体,service,Impl,在SpecialCard的xml增加了查找特殊证件表的方法

parent 5bed5387
...@@ -47,6 +47,9 @@ public class UserApi { ...@@ -47,6 +47,9 @@ public class UserApi {
private CountyListService countyListService; private CountyListService countyListService;
@Autowired @Autowired
private CardBodyService cardBodyService; private CardBodyService cardBodyService;
@Autowired
private GroupListService groupListService;
// @Autowired // @Autowired
// private ReadCountyListXMLService readCountyListXMLService; // private ReadCountyListXMLService readCountyListXMLService;
// @Autowired // @Autowired
...@@ -388,8 +391,8 @@ public class UserApi { ...@@ -388,8 +391,8 @@ public class UserApi {
*/ */
@RequestMapping("getGroupListByTaskListId") @RequestMapping("getGroupListByTaskListId")
// @RequiresPermissions("userInfo.add")//权限管理; // @RequiresPermissions("userInfo.add")//权限管理;
public String getGroupListByTaskListId(@RequestParam("taskListID") String tasklistid, HttpServletResponse resp) { public String getGroupListByTaskListId(@RequestParam("taskListId") String taskListId, HttpServletResponse resp) {
List<GroupNoEntity> groupNoEntity = groupNoService.findGroupListByTaskListID(tasklistid); List<GroupListEntity> groupNoEntity = groupListService.findGroupListByTaskListId(taskListId);
YXJSONResponse yxjsonResponse = new YXJSONResponse(); YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8"); resp.setCharacterEncoding("UTF-8");
yxjsonResponse.outPutSuccess(groupNoEntity); yxjsonResponse.outPutSuccess(groupNoEntity);
...@@ -406,7 +409,7 @@ public class UserApi { ...@@ -406,7 +409,7 @@ public class UserApi {
@RequestMapping("getGroupNoByTaskStateId") @RequestMapping("getGroupNoByTaskStateId")
// @RequiresPermissions("userInfo.add")//权限管理; // @RequiresPermissions("userInfo.add")//权限管理;
public String findGroupListByTaskStateId(@RequestParam("taskStateId") String taskStateId, HttpServletResponse resp) { public String findGroupListByTaskStateId(@RequestParam("taskStateId") String taskStateId, HttpServletResponse resp) {
List<GroupNoEntity> groupNoEntity = groupNoService.findGroupListByTaskStateId(taskStateId); List<GroupListEntity> groupNoEntity = groupListService.findGroupListByTaskStateId(taskStateId);
YXJSONResponse yxjsonResponse = new YXJSONResponse(); YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8"); resp.setCharacterEncoding("UTF-8");
yxjsonResponse.outPutSuccess(groupNoEntity); yxjsonResponse.outPutSuccess(groupNoEntity);
...@@ -423,7 +426,7 @@ public class UserApi { ...@@ -423,7 +426,7 @@ public class UserApi {
@RequestMapping("getGroupNoByCardType") @RequestMapping("getGroupNoByCardType")
// @RequiresPermissions("userInfo.add")//权限管理; // @RequiresPermissions("userInfo.add")//权限管理;
public String getGroupListByCardType(@RequestParam("cardType") String cardType, HttpServletResponse resp) { public String getGroupListByCardType(@RequestParam("cardType") String cardType, HttpServletResponse resp) {
List<GroupNoEntity> groupNoEntity = groupNoService.findGroupListByCardType(cardType); List<GroupListEntity> groupNoEntity = groupListService.findGroupListByCardType(cardType);
YXJSONResponse yxjsonResponse = new YXJSONResponse(); YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8"); resp.setCharacterEncoding("UTF-8");
yxjsonResponse.outPutSuccess(groupNoEntity); yxjsonResponse.outPutSuccess(groupNoEntity);
......
package com.yxproject.start.entity;
/**
* Created by Administrator on 2018/12/18.
*/
import javax.persistence.*;
import java.io.Serializable;
import java.sql.Time;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
@Entity
@Table(name = "TYPE_LIST", schema = "DAHAI")
public class GroupListEntity implements Serializable {
private long groupNo;
private long validCount;
private long invalidCount;
private long specialCardCount;
@Transient
private List<SpecialCardEntity> specialCardList = new ArrayList <SpecialCardEntity>();
@Id
@Column(name = "groupNo", nullable = false, precision = 0)
public long getGroupNo() {
return groupNo;
}
public void setGroupNo(long groupNo) {
this.groupNo = groupNo;
}
@Basic
@Column(name = "validCount", nullable = true, precision = 0)
public long getValidCount() {
return validCount;
}
public void setValidCount(long validCount) {
this.validCount = validCount;
}
@Basic
@Column(name = "invalidCount", nullable = true, precision = 0)
public long getInvalidCount() {
return invalidCount;
}
public void setInvalidCount(long invalidCount) {
this.invalidCount = invalidCount;
}
@Basic
@Column(name = "specialCardCount", nullable = true, precision = 0)
public long getSpecialCardCount() {
return specialCardCount;
}
public void setSpecialCardCount(long specialCardCount) {
this.specialCardCount = specialCardCount;
}
@Transient
public List <SpecialCardEntity > getSpecialCardList() {
return specialCardList;
}
public void setSpecialCardList( List <SpecialCardEntity> specialCardList ) {
this.specialCardList = specialCardList;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
GroupListEntity that = (GroupListEntity) o;
return groupNo == that.groupNo &&
validCount == that.validCount &&
invalidCount == that.invalidCount &&
specialCardCount == that.specialCardCount;
}
@Override
public int hashCode() {
return Objects.hash(groupNo, validCount,invalidCount,specialCardCount);
}
}
...@@ -27,7 +27,7 @@ public class TypeListEntity { ...@@ -27,7 +27,7 @@ public class TypeListEntity {
} }
@Basic @Basic
@Column(name = "typeCount", nullable = false, precision = 0) @Column(name = "typeCount", nullable = true, precision = 0)
public long getTypeCount() { public long getTypeCount() {
return typeCount; return typeCount;
} }
...@@ -36,7 +36,7 @@ public class TypeListEntity { ...@@ -36,7 +36,7 @@ public class TypeListEntity {
} }
@Basic @Basic
@Column(name = "typeName", nullable = false, precision = 0) @Column(name = "typeName", nullable = true, precision = 0)
public String getTypeName() { public String getTypeName() {
return typeName; return typeName;
} }
......
package com.yxproject.start.mapper; package com.yxproject.start.mapper;
import com.yxproject.start.entity.GroupListEntity;
import com.yxproject.start.entity.GroupNoEntity; import com.yxproject.start.entity.GroupNoEntity;
import com.yxproject.start.entity.SpecialCardEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List; import java.util.List;
...@@ -18,8 +20,9 @@ public interface GroupNoMapper { ...@@ -18,8 +20,9 @@ public interface GroupNoMapper {
public int findGroupNoCountByTaskId(String task_Id); public int findGroupNoCountByTaskId(String task_Id);
public List<Map<String,Object>> findSpecialCountyList(String task_Id); public List<Map<String,Object>> findSpecialCountyList(String task_Id);
public List<Map<String,Object>> findNormalCountyList(String task_Id); public List<Map<String,Object>> findNormalCountyList(String task_Id);
public List<GroupNoEntity> findGroupListByTaskListID(String tasklistID); public List<GroupListEntity> findGroupListByTaskListId( String taskListId);
public List<GroupNoEntity> findGroupListByTaskStateId(String taskStateId); public List<GroupListEntity> findGroupListByTaskStateId(String taskStateId);
public List<GroupNoEntity> findGroupListByCardType(String cardType); public List<GroupListEntity> findGroupListByCardType( String cardType);
} }
...@@ -14,5 +14,6 @@ public interface SpecialCardMapper { ...@@ -14,5 +14,6 @@ public interface SpecialCardMapper {
public void saveSpecialCardEntity(SpecialCardEntity specialCardEntity); public void saveSpecialCardEntity(SpecialCardEntity specialCardEntity);
public void updateSpecialCardEntity(SpecialCardEntity specialCardEntity); public void updateSpecialCardEntity(SpecialCardEntity specialCardEntity);
public List<SpecialCardEntity> findSpecialCardEntityByGroupNo(String groupNo); public List<SpecialCardEntity> findSpecialCardEntityByGroupNo(String groupNo);
public List <SpecialCardEntity> findSpecialCardList( String groupNo);
} }
package com.yxproject.start.service;
import com.yxproject.start.entity.GroupListEntity;
import java.util.List;
/**
* Created by Administrator on 2018/12/18.
*/
public interface GroupListService {
public List<GroupListEntity> findGroupListByTaskListId( String taskListId);
public List<GroupListEntity> findGroupListByTaskStateId(String taskStateId);
public List<GroupListEntity> findGroupListByCardType(String cardType);
}
package com.yxproject.start.service; package com.yxproject.start.service;
import com.yxproject.start.entity.GroupListEntity;
import com.yxproject.start.entity.GroupNoEntity; import com.yxproject.start.entity.GroupNoEntity;
import java.util.List; import java.util.List;
...@@ -10,8 +11,6 @@ import java.util.Map; ...@@ -10,8 +11,6 @@ import java.util.Map;
*/ */
public interface GroupNoService { public interface GroupNoService {
public List<Map<String, Object>> findCountyInfoList(String taskID); public List<Map<String, Object>> findCountyInfoList(String taskID);
public List<GroupNoEntity> findGroupListByTaskListID(String tasklistID);
public List<GroupNoEntity> findGroupListByTaskStateId(String taskStateId);
public List<GroupNoEntity> findGroupListByCardType(String cardType);
} }
package com.yxproject.start.service.impl;
import com.yxproject.start.entity.GroupListEntity;
import com.yxproject.start.entity.SpecialCardEntity;
import com.yxproject.start.mapper.GroupNoMapper;
import com.yxproject.start.mapper.SpecialCardMapper;
import com.yxproject.start.service.GroupListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Created by Administrator on 2018/12/18.
*/
@Service
public class GroupListServiceImpl implements GroupListService {
@Autowired
public GroupNoMapper groupNoMapper;
@Autowired
public SpecialCardMapper specialCardMapper;
@Override
public List<GroupListEntity> findGroupListByTaskListId( String taskListId) {
List <GroupListEntity> groupList=groupNoMapper.findGroupListByTaskListId(taskListId);
for ( GroupListEntity groupListEntity:groupList) {
List <SpecialCardEntity> specialCardEntities=specialCardMapper.findSpecialCardList(groupListEntity.getGroupNo()+"");
groupListEntity.setSpecialCardList(specialCardEntities);
}
return groupList;
}
@Override
public List <GroupListEntity> findGroupListByTaskStateId(String taskStateId) {
List<GroupListEntity> byTaskStateId = groupNoMapper.findGroupListByTaskStateId(taskStateId);
for ( GroupListEntity groupListEntity:byTaskStateId) {
List <SpecialCardEntity> specialCardEntities=specialCardMapper.findSpecialCardList(groupListEntity.getGroupNo()+"");
groupListEntity.setSpecialCardList(specialCardEntities);
}
return byTaskStateId;
}
@Override
public List <GroupListEntity> findGroupListByCardType( String cardType ) {
List<GroupListEntity> byCardType = groupNoMapper.findGroupListByCardType(cardType);
for ( GroupListEntity groupListEntity:byCardType) {
List <SpecialCardEntity> specialCardEntities=specialCardMapper.findSpecialCardList(groupListEntity.getGroupNo()+"");
groupListEntity.setSpecialCardList(specialCardEntities);
}
return byCardType;
}
}
package com.yxproject.start.service.impl; package com.yxproject.start.service.impl;
import com.yxproject.start.entity.GroupListEntity;
import com.yxproject.start.entity.GroupNoEntity; import com.yxproject.start.entity.GroupNoEntity;
import com.yxproject.start.entity.SpecialCardEntity;
import com.yxproject.start.mapper.GroupNoMapper; import com.yxproject.start.mapper.GroupNoMapper;
import com.yxproject.start.service.GroupNoService; import com.yxproject.start.service.GroupNoService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -30,22 +32,6 @@ public class GroupNoServiceImpl implements GroupNoService { ...@@ -30,22 +32,6 @@ public class GroupNoServiceImpl implements GroupNoService {
return list; return list;
} }
@Override
public List<GroupNoEntity> findGroupListByTaskListID( String tasklistid) {
List<GroupNoEntity> byTaskListID = groupNoMapper.findGroupListByTaskListID(tasklistid);
return byTaskListID;
}
@Override
public List <GroupNoEntity> findGroupListByTaskStateId(String taskStateId) {
List<GroupNoEntity> TaskStateId = groupNoMapper.findGroupListByTaskStateId(taskStateId);
return TaskStateId;
}
@Override
public List <GroupNoEntity> findGroupListByCardType( String cardType ) {
List<GroupNoEntity> CardType = groupNoMapper.findGroupListByCardType(cardType);
return CardType;
}
} }
...@@ -43,28 +43,27 @@ ...@@ -43,28 +43,27 @@
SELECT * FROM TABLE(find_normal_county_list.GET_county_infos(#{task_Id})) SELECT * FROM TABLE(find_normal_county_list.GET_county_infos(#{task_Id}))
</select> </select>
<select id="findGroupListByTaskListID" resultType="com.yxproject.start.entity.GroupNoEntity" parameterType="String"> <select id="findGroupListByTaskListId" resultType="com.yxproject.start.entity.GroupListEntity" parameterType="String">
select GROUP_NO as groupNo,sum(VALID_COUNT) as validCount,sum(INVALID_COUNT) as invalidCount,sum(SPECIAL_CARD_COUNT) as specialCardCount,COUNT(GROUP_NO) from TASK select GROUP_NO as groupNo,sum(VALID_COUNT) as validCount,sum(INVALID_COUNT) as invalidCount,sum(SPECIAL_CARD_COUNT) as specialCardCount from TASK
left join (select sum(VALID_COUNT),sum(INVALID_COUNT),sum(SPECIAL_CARD_COUNT),COUNT(GROUP_NO),TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,VALID_COUNT,INVALID_COUNT from GROUP_NO left join (select sum(VALID_COUNT),sum(INVALID_COUNT),sum(SPECIAL_CARD_COUNT),COUNT(GROUP_NO),TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,VALID_COUNT,INVALID_COUNT from GROUP_NO group by TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,VALID_COUNT,INVALID_COUNT ) GROUP_NO on GROUP_NO.TASK_ID = TASK.TASK_ID
group by TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,VALID_COUNT,INVALID_COUNT ) GROUP_NO on GROUP_NO.TASK_ID = TASK.TASK_ID
where TASK.TASK_ID=#{task_Id} where TASK.TASK_ID=#{task_Id}
group by GROUP_NO group by GROUP_NO
</select> </select>
<select id="findGroupListByTaskStateId" resultType="com.yxproject.start.entity.GroupNoEntity" parameterType="String"> <select id="findGroupListByTaskStateId" resultType="com.yxproject.start.entity.GroupListEntity" parameterType="String">
select GROUP_NO as groupNo,sum(VALID_COUNT) as validCount,sum(INVALID_COUNT) as invalidCount,sum(SPECIAL_CARD_COUNT) as specialCardCount,COUNT(GROUP_NO) from TASK select GROUP_NO as groupNo,sum(VALID_COUNT) as validCount,sum(INVALID_COUNT) as invalidCount,sum(SPECIAL_CARD_COUNT) as specialCardCount from TASK
left join (select sum(VALID_COUNT),sum(INVALID_COUNT),sum(SPECIAL_CARD_COUNT),COUNT(GROUP_NO),TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,VALID_COUNT,INVALID_COUNT from GROUP_NO left join (select sum(VALID_COUNT),sum(INVALID_COUNT),sum(SPECIAL_CARD_COUNT),COUNT(GROUP_NO),TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,VALID_COUNT,INVALID_COUNT from GROUP_NO group by TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,VALID_COUNT,INVALID_COUNT ) GROUP_NO on GROUP_NO.TASK_ID = TASK.TASK_ID
group by TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,VALID_COUNT,INVALID_COUNT ) GROUP_NO on GROUP_NO.TASK_ID = TASK.TASK_ID
where TASK.TASK_STATE_ID=#{task_State_Id} where TASK.TASK_STATE_ID=#{task_State_Id}
group by GROUP_NO group by GROUP_NO
</select> </select>
<select id="findGroupListByCardType" resultType="com.yxproject.start.entity.GroupNoEntity" parameterType="String"> <select id="findGroupListByCardType" resultType="com.yxproject.start.entity.GroupListEntity" parameterType="String">
select GROUP_NO as groupNo,sum(VALID_COUNT) as validCount,sum(INVALID_COUNT) as invalidCount,sum(SPECIAL_CARD_COUNT) as specialCardCount,COUNT(GROUP_NO) from TASK select GROUP_NO as groupNo,sum(VALID_COUNT) as validCount,sum(INVALID_COUNT) as invalidCount,sum(SPECIAL_CARD_COUNT) as specialCardCount from TASK
left join (select sum(VALID_COUNT),sum(INVALID_COUNT),sum(SPECIAL_CARD_COUNT),COUNT(GROUP_NO),TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,VALID_COUNT,INVALID_COUNT from GROUP_NO left join (select sum(VALID_COUNT),sum(INVALID_COUNT),sum(SPECIAL_CARD_COUNT),COUNT(GROUP_NO),TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,VALID_COUNT,INVALID_COUNT from GROUP_NO group by TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,VALID_COUNT,INVALID_COUNT ) GROUP_NO on GROUP_NO.TASK_ID = TASK.TASK_ID
group by TASK_ID,GROUP_NO,SPECIAL_CARD_COUNT,VALID_COUNT,INVALID_COUNT ) GROUP_NO on GROUP_NO.TASK_ID = TASK.TASK_ID
where TASK.CARD_TYPE=#{card_type} where TASK.CARD_TYPE=#{card_type}
group by GROUP_NO group by GROUP_NO
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -30,4 +30,8 @@ ...@@ -30,4 +30,8 @@
select * from SPECIAL_CARD where GROUP_NO =#{group_No} select * from SPECIAL_CARD where GROUP_NO =#{group_No}
</select> </select>
<select id="findSpecialCardList" resultType="com.yxproject.start.entity.SpecialCardEntity" parameterType="String">
SELECT * FROM SPECIAL_CARD LEFT JOIN GROUP_NO ON GROUP_NO.GROUP_NO = SPECIAL_CARD.GROUP_NO WHERE GROUP_NO.GROUP_NO=#{group_No}
</select>
</mapper> </mapper>
\ No newline at end of file
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