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>