|
|
@ -20,6 +20,19 @@ |
|
|
|
<result property="enterpriseId" column="enterprise_id"/> |
|
|
|
</resultMap> |
|
|
|
|
|
|
|
<resultMap id="BsSgcYxjdQualifications" type="BsSgcYxjdQualifications"> |
|
|
|
<id column="id" property="id"/> |
|
|
|
<result property="enterpriseName" column="enterprise_name"/> |
|
|
|
<result property="enterpriseId" column="enterprise_id"/> |
|
|
|
<result property="qualificationCategory" column="qualification_category"/> |
|
|
|
<result property="level" column="level"/> |
|
|
|
<result property="professionalCategory" column="professional_category"/> |
|
|
|
<result property="certificateNo" column="certificate_no"/> |
|
|
|
<result property="issuedBy" column="issued_by"/> |
|
|
|
<result property="issuanceDate" column="issuance_date"/> |
|
|
|
<result property="validityPeriod" column="validity_period"/> |
|
|
|
</resultMap> |
|
|
|
|
|
|
|
<select id="listByZero" resultMap="CreditDto"> |
|
|
|
SELECT |
|
|
|
enterprise_id, |
|
|
@ -39,18 +52,27 @@ |
|
|
|
|
|
|
|
<select id="listByOne" resultMap="CreditDto"> |
|
|
|
|
|
|
|
SET @num := 0, @type := ''; |
|
|
|
SET |
|
|
|
@num := 0, @type := ''; |
|
|
|
|
|
|
|
SELECT enterprise_id,enterprise_name,ADCD,dynamic_credit_score, |
|
|
|
qualification_category,legal_representative |
|
|
|
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, |
|
|
|
SELECT enterprise_id, |
|
|
|
enterprise_name, |
|
|
|
ADCD, |
|
|
|
dynamic_credit_score, |
|
|
|
qualification_category, |
|
|
|
legal_representative |
|
|
|
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 |
|
|
|
FROM bs_sgc_yxjd_qualifications |
|
|
|
WHERE ISNULL( parent_id ) |
|
|
|
GROUP BY enterprise_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> |
|
|
@ -75,7 +97,7 @@ |
|
|
|
AND q.qualification_category = #{qualificationCategory} |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
|
|
|
|
GROUP BY enterprise_id |
|
|
|
ORDER BY |
|
|
|
CAST( dynamic_credit_score AS UNSIGNED ) DESC LIMIT #{pageNum},#{pageSize}; |
|
|
|
</select> |
|
|
@ -102,6 +124,7 @@ |
|
|
|
AND q.qualification_category = #{qualificationCategory} |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
GROUP BY enterprise_id |
|
|
|
ORDER BY |
|
|
|
CAST( dynamic_credit_score AS UNSIGNED ) DESC LIMIT #{pageNum},#{pageSize}; |
|
|
|
</select> |
|
|
@ -130,4 +153,16 @@ |
|
|
|
</where> |
|
|
|
order by q.create_time desc LIMIT #{pageNum},#{pageSize}; |
|
|
|
</select> |
|
|
|
<select id="selectList1" resultMap="BsSgcYxjdQualifications"> |
|
|
|
select i.enterprise_name,q.* |
|
|
|
|
|
|
|
from bs_sgc_yxjd_qualifications q |
|
|
|
left join bs_sgc_yxjd_enterprise_info i on q.enterprise_id = i.id |
|
|
|
<where> |
|
|
|
<if test="eid!=null and eid!=''"> |
|
|
|
and q.enterprise_id=#{eid} |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
|
|
|
|
</select> |
|
|
|
</mapper> |
|
|
|