MYSQL多表关联分组查询统计数量<resultMap id="baseAmount" type="***.***VO">大一python基础编程题答案
<result column="id" property="id"/>
<result column="personType" property="personType"/>
<result column="plaitAmount" property="plaitAmount"/>
<result column="strengthAmount" property="strengthAmount"/>
</resultMap>
<select id="getPlaitStrength" resultMap="baseAmount">
SELECT
pe.person_type as personType,
mysql语句多表查询COUNT(1) as strengthAmount,
g.id as id,
g.plaitAmount as plaitAmount
FROM t_person as pe
乱世佳人在线LEFT JOIN (
disabled英语SELECT
bz.id as id,网页首页设计模板图片
bz.person_type AS personType,
bz.plait_amount AS plaitAmount,
bz.department_id AS departmentId
FROM t_preparation_rybzsbz as bz
LEFT JOIN t_department as d
ON bz.department_id = d.id
and bz.deleted = ${@com.aisino.guard.vo.system.TUserVO@DELTED_FLAG_N}
where bz.department_id = #{parameter.departmentId}
table函数) g
ON g.departmentId = pe.department_id
AND g.personType = pe.person_type
and pe.deleted = ${@com.aisino.guard.vo.system.TUserVO@DELTED_FLAG_N}
where pe.department_id = #{parameter.departmentId}
GROUP BY pe.id
</select>
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论