mybatis mapper sql include用法实现sql块复用

一、总SQL


二、Select sql片段


        SELECT
            xxx,xxx
        FROM
            xxx T1
                LEFT JOIN ( xxx ) T2 ON T1.xxx= T2.CODE
                LEFT JOIN xxxt3 ON t3.mn = t1.mn
                LEFT JOIN xxxt5 ON t5.site_id = t3.id
        WHERE
            1 = 1
    

二、and sql片段


        
        
            and t3.dl_areacode = #{vo.area}
        

        ORDER BY T1.MN ASC,T1.datatime DESC
    

你可能感兴趣的:(mybatis,sql,java)