Commit bcdaa7ac authored by lcl's avatar lcl

u

parent 33dafbda
...@@ -43,6 +43,6 @@ public class CustomerOverviewController extends BaseController { ...@@ -43,6 +43,6 @@ public class CustomerOverviewController extends BaseController {
*/ */
@GetMapping("/credit/level") @GetMapping("/credit/level")
public AjaxResult creditLevel(){ public AjaxResult creditLevel(){
return AjaxResult.success(baseService.cooperationTop(new CustomerSearchDto())); return AjaxResult.success(baseService.creditLevel(new CustomerSearchDto()));
} }
} }
...@@ -10,6 +10,7 @@ import org.apache.ibatis.annotations.Mapper; ...@@ -10,6 +10,7 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
...@@ -35,5 +36,7 @@ public interface CustomerMapper extends BaseMapper<Customer> { ...@@ -35,5 +36,7 @@ public interface CustomerMapper extends BaseMapper<Customer> {
List<CustomerAnalyzeVo> selectCooperationTop(CustomerSearchDto dto); List<CustomerAnalyzeVo> selectCooperationTop(CustomerSearchDto dto);
List<Map<String, Object>> selectCreditLevelGroup(CustomerSearchDto dto);
} }
...@@ -12,8 +12,10 @@ import java.util.Map; ...@@ -12,8 +12,10 @@ import java.util.Map;
*/ */
public interface ICustomerOverviewService { public interface ICustomerOverviewService {
Map<String,Object> statistics(CustomerSearchDto dto); Map<String, Object> statistics(CustomerSearchDto dto);
List<CustomerAnalyzeVo> cooperationTop(CustomerSearchDto dto); List<CustomerAnalyzeVo> cooperationTop(CustomerSearchDto dto);
List<Map<String, Object>> creditLevel(CustomerSearchDto dto);
} }
...@@ -50,4 +50,10 @@ public class CustomerOverviewServiceImpl implements ICustomerOverviewService { ...@@ -50,4 +50,10 @@ public class CustomerOverviewServiceImpl implements ICustomerOverviewService {
return customerMapper.selectCooperationTop(dto); return customerMapper.selectCooperationTop(dto);
} }
@Override
public List<Map<String, Object>> creditLevel(CustomerSearchDto dto) {
dto.setUserId(SecurityUtils.getUserId());
return customerMapper.selectCreditLevelGroup(dto);
}
} }
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
left join ( left join (
select count(status) num,customer_id from business_info where `status` = 2 group by customer_id select count(status) num,customer_id from business_info where `status` = 2 group by customer_id
) bi3 on bi3.customer_id = ct.customer_id ) bi3 on bi3.customer_id = ct.customer_id
where ctu.user_id = #{dto.userId} and ctu.status = #{dto.status} where ctu.user_id = #{userId} and ctu.status = #{status}
<if test="companyName != null and companyName != '' "> and ct.company_name like concat('%',#{companyName},'%')</if> <if test="companyName != null and companyName != '' "> and ct.company_name like concat('%',#{companyName},'%')</if>
<if test="isOn != null "> and ct.is_on = #{isOn}</if> <if test="isOn != null "> and ct.is_on = #{isOn}</if>
<if test="provinceIds != null and provinceIds.size > 0 "> <if test="provinceIds != null and provinceIds.size > 0 ">
...@@ -122,5 +122,15 @@ ...@@ -122,5 +122,15 @@
limit 10 limit 10
</select> </select>
<select id="selectCreditLevelGroup" resultType="java.util.Map">
select
ct.credit_level creditLevel, count(ct.credit_level) customerCount
from customer ct
join customer_user ctu on ct.customer_id = ctu.customer_id
where ctu.user_id = #{userId}
group by ct.credit_level
order by ct.credit_level desc
</select>
</mapper> </mapper>
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