Преглед изворни кода

保险代理人列表添加参数type

yanliming пре 5 година
родитељ
комит
bcfb5a587c

+ 2 - 2
picc-admin-server/src/main/java/com/jpsoft/picc/modules/base/controller/InsuranceAgentController.java

@@ -229,11 +229,11 @@ public class InsuranceAgentController {
 
     @ApiOperation(value="所有代理人列表")
     @RequestMapping(value = "list",method = RequestMethod.POST)
-    public MessageResult<List<InsuranceAgent>> list(){
+    public MessageResult<List<InsuranceAgent>> list(String type){
 
         MessageResult<List<InsuranceAgent>> msgResult = new MessageResult<>();
 
-        List<InsuranceAgent> list = insuranceAgentService.list();
+        List<InsuranceAgent> list = insuranceAgentService.listByType(type);
 
         msgResult.setResult(true);
         msgResult.setData(list);

+ 1 - 0
picc-common/src/main/java/com/jpsoft/picc/modules/base/dao/InsuranceAgentDAO.java

@@ -14,5 +14,6 @@ public interface InsuranceAgentDAO {
 	InsuranceAgent get(String id);
 	int delete(String id);
 	List<InsuranceAgent> list();
+	List<InsuranceAgent> listByType(String type);
 	List<InsuranceAgent> search(Map<String, Object> searchParams, List<Sort> sortList);
 }

+ 1 - 0
picc-common/src/main/java/com/jpsoft/picc/modules/base/service/InsuranceAgentService.java

@@ -13,5 +13,6 @@ public interface InsuranceAgentService {
 	int update(InsuranceAgent model);
 	int delete(String id);
 	List<InsuranceAgent> list();
+	List<InsuranceAgent> listByType(String type);
 	Page<InsuranceAgent> pageSearch(Map<String, Object> searchParams, int pageNum, int pageSize, List<Sort> sortList);
 }

+ 5 - 0
picc-common/src/main/java/com/jpsoft/picc/modules/base/service/impl/InsuranceAgentServiceImpl.java

@@ -58,6 +58,11 @@ public class InsuranceAgentServiceImpl implements InsuranceAgentService {
 		// TODO Auto-generated method stub
 		return insuranceAgentDAO.list();
 	}
+
+	@Override
+	public List<InsuranceAgent> listByType(String type){
+		return insuranceAgentDAO.listByType(type);
+	}
 		
 	@Override
 	public Page<InsuranceAgent> pageSearch(Map<String, Object> searchParams, int pageNumber, int pageSize,List<Sort> sortList) {

+ 3 - 0
picc-common/src/main/resources/mapper/base/InsuranceAgent.xml

@@ -80,6 +80,9 @@ id_,name_,status_,type_,del_flag,create_by,create_time,update_by,update_time		fr
 	<select id="list" resultMap="InsuranceAgentMap">
 		select * from base_insurance_agent where del_flag = false
 	</select>
+	<select id="listByType" resultMap="InsuranceAgentMap">
+		select * from base_insurance_agent where del_flag = false and type_=#{0}
+	</select>
 	<select id="search" parameterType="hashmap" resultMap="InsuranceAgentMap">
 		<![CDATA[
 			select * from base_insurance_agent