select TC001 ,TC002,TC003,TC004,
TD004,TD005,TD006,TD008,TD009,TD010,TD013,TD021,TD020,
case TD016 when 'Y' then 'Y.自动结束'
when 'y' then 'y.指定结束' when 'N' then 'N.未结束'
end as 结束 FROM COPTC
INNER JOIN COPTD ON TC001 = TD001 AND TC002 = TD002
LEFT JOIN COPMA ON TC004 = MA001
WHERE TC003>= '20160201' AND TC003<= '20160229'
order by TC003 asc
SQL语句如上,我现在用dapper的连接查询,我先试了一下两张表的连接
var list= connection.Query<COPTC,COPTD,COPTC>(sql,(u,m)=> { u.COPTD = m;return u; },splitOn:"TD004").ToList();
查询可以,但是返回的类型应该是COPTC这个实体,返回json的话还是获取不到COPTD里的字段,不知道dapper的连接查询应该怎么样才能显示一张连接完整的表,不吝赐教,请大神帮忙解答下,困扰很多天了!!!
ghhsghjjhffg