8 changed files with 168 additions and 6 deletions
@ -0,0 +1,20 @@ |
|||||
|
package com.kms.enterprise.domain.dto; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
@Data |
||||
|
public class CreditDto implements Serializable { |
||||
|
|
||||
|
private String enterpriseId; |
||||
|
|
||||
|
private String enterpriseName; |
||||
|
|
||||
|
private String qualificationCategory; |
||||
|
|
||||
|
private String dynamicCreditScore; |
||||
|
|
||||
|
private String adcd; |
||||
|
|
||||
|
} |
@ -0,0 +1,18 @@ |
|||||
|
package com.kms.enterprise.domain.dto; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
@Data |
||||
|
public class DisclosureDto implements Serializable { |
||||
|
|
||||
|
private String groupId; |
||||
|
|
||||
|
private String qualificationCategory; |
||||
|
|
||||
|
private int pageNum; |
||||
|
|
||||
|
private int pageSize; |
||||
|
|
||||
|
} |
@ -0,0 +1,62 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<!DOCTYPE mapper |
||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.kms.enterprise.mapper.BsSgcYxjdQualificationsMapper"> |
||||
|
|
||||
|
<resultMap type="CreditDto" id="CreditDto"> |
||||
|
<result property="enterpriseId" column="enterprise_id" /> |
||||
|
<result property="enterpriseName" column="enterprise_name" /> |
||||
|
<result property="qualificationCategory" column="qualification_category" /> |
||||
|
<result property="dynamicCreditScore" column="dynamic_credit_score" /> |
||||
|
</resultMap> |
||||
|
|
||||
|
<select id="listByZero" resultMap="CreditDto"> |
||||
|
SELECT |
||||
|
enterprise_id, |
||||
|
enterprise_name, |
||||
|
qualification_category, |
||||
|
dynamic_credit_score |
||||
|
FROM |
||||
|
bs_sgc_yxjd_qualifications q |
||||
|
LEFT JOIN bs_sgc_yxjd_enterprise_info i ON q.enterprise_id = i.id |
||||
|
WHERE |
||||
|
ISNULL( q.parent_id ) |
||||
|
ORDER BY |
||||
|
CAST( q.dynamic_credit_score AS UNSIGNED ) DESC |
||||
|
LIMIT 50 |
||||
|
</select> |
||||
|
|
||||
|
<select id="listByOne" resultMap="CreditDto"> |
||||
|
|
||||
|
SET @num := 0, @type := ''; |
||||
|
|
||||
|
SELECT enterprise_id,enterprise_name,ADCD,dynamic_credit_score, |
||||
|
qualification_category |
||||
|
FROM bs_sgc_yxjd_enterprise_info fo LEFT JOIN (SELECT qualification_category, dynamic_credit_score,enterprise_id |
||||
|
FROM ( |
||||
|
SELECT qualification_category, dynamic_credit_score,enterprise_id, |
||||
|
@num := IF(@type = qualification_category, @num + 1, 1) AS row_number, |
||||
|
@type := qualification_category AS dummy |
||||
|
FROM bs_sgc_yxjd_qualifications WHERE ISNULL( parent_id ) |
||||
|
ORDER BY qualification_category, CAST( dynamic_credit_score AS UNSIGNED ) ASC |
||||
|
) AS t WHERE t.row_number <= 5) res ON fo.id=res.enterprise_id |
||||
|
</select> |
||||
|
<select id="listTwo" resultMap="CreditDto"> |
||||
|
<bind name="pageNum" value="(pageNum-1)*pageSize"></bind> |
||||
|
SELECT |
||||
|
enterprise_id, |
||||
|
enterprise_name, |
||||
|
ADCD, |
||||
|
dynamic_credit_score, |
||||
|
qualification_category |
||||
|
FROM |
||||
|
bs_sgc_yxjd_qualifications q |
||||
|
LEFT JOIN bs_sgc_yxjd_enterprise_info i ON q.enterprise_id = i.id |
||||
|
WHERE |
||||
|
ISNULL( q.parent_id ) |
||||
|
AND q.qualification_category = #{qualificationCategory} |
||||
|
ORDER BY |
||||
|
CAST( dynamic_credit_score AS UNSIGNED ) DESC LIMIT #{pageNum},#{pageSize}; |
||||
|
</select> |
||||
|
</mapper> |
Loading…
Reference in new issue