资源表sql 中 规避使用 * 进行查询

This commit is contained in:
wangliwen 2022-06-27 19:42:02 +08:00
parent 46b17e96c2
commit 7288012bf6
1 changed files with 120 additions and 4 deletions

View File

@ -105,7 +105,36 @@
<select id="selectWithAttrs" resultMap="resourceDTO">
SELECT
DISTINCT tdr.*,
DISTINCT tdr.id,
tdr.`type`,
tdr.`name`,
tdr.description,
tdr.link,
tdr.api_method_type,
tdr.api_url,
tdr.group_id,
tdr.dept_id,
tdr.dept_contacts,
tdr.dept_phone,
tdr.share_type,
tdr.share_mode,
tdr.share_condition,
tdr.district_id,
tdr.visits,
tdr.del_flag,
tdr.creator,
tdr.create_date,
tdr.updater,
tdr.update_date,
tdr.note1,
tdr.note2,
tdr.note3,
tdr.note4,
tdr.note5,
tdr.enclosure,
tdr.undercarriage_reason,
tdr.undercarriage_user_name,
tdr.info_list,
IFNULL(taa2.approve_status, '未申请') AS "applyState",
IFNULL(trs.score, 0 ) AS "score",
IFNULL(taa.applyCount, 0 ) AS "applyCount",
@ -193,7 +222,36 @@
<select id="selectMostPopular" resultType="io.renren.modules.resource.dto.ResourceDTO">
SELECT
tdr.*,
tdr.id,
tdr.`type`,
tdr.`name`,
tdr.description,
tdr.link,
tdr.api_method_type,
tdr.api_url,
tdr.group_id,
tdr.dept_id,
tdr.dept_contacts,
tdr.dept_phone,
tdr.share_type,
tdr.share_mode,
tdr.share_condition,
tdr.district_id,
tdr.visits,
tdr.del_flag,
tdr.creator,
tdr.create_date,
tdr.updater,
tdr.update_date,
tdr.note1,
tdr.note2,
tdr.note3,
tdr.note4,
tdr.note5,
tdr.enclosure,
tdr.undercarriage_reason,
tdr.undercarriage_user_name,
tdr.info_list,
IFNULL(trs.score, 0 ) AS "score",
IFNULL(taa.applyCount, 0 ) AS "applyCount",
IFNULL(trc.collectCount, 0) AS "collectCount",
@ -252,7 +310,36 @@
<!-- AND tdr.id = #{id}-->
SELECT
tdr.*,
tdr.id,
tdr.`type`,
tdr.`name`,
tdr.description,
tdr.link,
tdr.api_method_type,
tdr.api_url,
tdr.group_id,
tdr.dept_id,
tdr.dept_contacts,
tdr.dept_phone,
tdr.share_type,
tdr.share_mode,
tdr.share_condition,
tdr.district_id,
tdr.visits,
tdr.del_flag,
tdr.creator,
tdr.create_date,
tdr.updater,
tdr.update_date,
tdr.note1,
tdr.note2,
tdr.note3,
tdr.note4,
tdr.note5,
tdr.enclosure,
tdr.undercarriage_reason,
tdr.undercarriage_user_name,
tdr.info_list,
IFNULL( trs.score, 0 ) AS "score",
IFNULL( taa.applyCount, 0 ) AS "applyCount",
IFNULL( trc.collectCount, 0 ) AS "collectCount",
@ -292,7 +379,36 @@
<select id="selectDTOPage" resultType="io.renren.modules.resource.dto.ResourceDTO">
SELECT
tdr.*,
tdr.id,
tdr.`type`,
tdr.`name`,
tdr.description,
tdr.link,
tdr.api_method_type,
tdr.api_url,
tdr.group_id,
tdr.dept_id,
tdr.dept_contacts,
tdr.dept_phone,
tdr.share_type,
tdr.share_mode,
tdr.share_condition,
tdr.district_id,
tdr.visits,
tdr.del_flag,
tdr.creator,
tdr.create_date,
tdr.updater,
tdr.update_date,
tdr.note1,
tdr.note2,
tdr.note3,
tdr.note4,
tdr.note5,
tdr.enclosure,
tdr.undercarriage_reason,
tdr.undercarriage_user_name,
tdr.info_list,
IFNULL(trs.score, 0 ) AS "score",
IFNULL(taa.applyCount, 0 ) AS "applyCount",
IFNULL(trc.collectCount, 0) AS "collectCount",