参考下面的sql语句即可实现
@Select("<script>" +
"select gp.TEWRTYR,gp.FJFNM,gs.CVNNN,u.VCNBMBNV,gp.RAEER,gr.BVNCCVN\n" +
" from UPPBHT u\n" +
" left join GP_test gp\n" +
" on gp.GHFD=u.HDFGHF\n" +
" left join GP_WEWD gr\n" +
" ON gr.TRT=gp.VXZB\n" +
" left join FFGC gs\n" +
" ON gs.BCVNCVBN =gr.ZXCVZXB\n" +
" where\n" +
"<if test=\""+"gpPostQuery.rtyry!=null or gpPostQuery.rtyry != ""\">\n" +
" u.rtyry =#{gpPostQuery.rtyry}\n" +
"</if>\n" +
" <if test=\"gpPostQuery.dfrer!=null or gpPostQuery.dfrer != ""\">\n" +
" AND u.dfrer =#{gpPostQuery.dfrer}\n" +
"</if>\n" +
" <if test=\"gpPostQuery.ewrwerwrte!=null or gpPostQuery.ewrwerwrte != ""\">\n" +
" AND gs.ewrwerwrte=#{gpPostQuery.ewrwerwrte}\n" +
"</if>\n" +
"<if test=\"gpPostQuery.vhkkdfs!=null or gpPostQuery.vhkkdfs != ""\">\n" +
" AND gp.vhkkdfs=#{gpPostQuery.vhkkdfs} \n" +
"</if>\n"+
"</script>\n")
public List<Resultlls> getToResultGpCells(GpPostQuerygpPostQuery);
标签:gs,gr,gpPostQuery,gp,Plus,SQL,MyBatis,join,left From: https://www.cnblogs.com/Williamwen/p/18534494