Mybatis sql嵌套写法

<select id="auditEntInfoView" parameterType="String" resultType="com.topinfo.sc.xhzjpx.yqyd.enterpriseaudit.bean.vo.EnterpriseauditVO">
<include refid="baseSql"/>
WHERE
cee.ACTIVED = 1
and cee.audit_id = #{id}
</select>
 
 
 
<sql id="baseSql">
SELECT cee.audit_id, cee.ent_id, cee.ent_full_name, cee.ent_simple_name, cee.ent_unified_code, cee.ent_type, cee.ent_desc, cee.legal_repr, 
FROM s_ei_enterpriseaudit cee
left join s_ei_enterpriseaudit_ex cex on cee.audit_id = cex.audit_id
</sql>

 

posted @ 2022-03-23 16:17  甜8筒  阅读(487)  评论(0编辑  收藏  举报