求大神解答mybatis里的SQL语句BUG

<select resultType="com.ph.entity.ext.Line">
SELECT
CONVERT(p.create_date,DATE) 'dateTime',
SUM(p.poundage_cny) 'countCNY',
SUM(p.poundage_bsc) 'countBSC'
FROM
pa_performance p,
pa_referral_code c
WHERE
p.referral_id = c.id AND
DATE_FORMAT(p.create_date, '%Y-%m') = DATE_FORMAT(NOW(), '%Y-%m') AND
c.partner_code = #{partnerCode} AND
c.agent_code = #{agentCode}
GROUP BY
TO_DAYS(p.create_date)
ORDER BY
TO_DAYS(p.create_date) ASC
</select>

要返回的实体类:

public class Line {

private Date dateTime;
private BigDecimal countBSC;
private BigDecimal countCNY;

public Date getDateTime() {
return dateTime;
}
public void setDateTime(Date dateTime) {
this.dateTime = dateTime;
}
public BigDecimal getCountBSC() {
return countBSC;
}
public void setCountBSC(BigDecimal countBSC) {
this.countBSC = countBSC;
}
public BigDecimal getCountCNY() {
return countCNY;
}
public void setCountCNY(BigDecimal countCNY) {
this.countCNY = countCNY;
}

}

 

数据库里create_date字段是datetime属性,请大神帮忙解答

回答

报什么错误贴出来啊,那个时间类型你可以使用String来接收,要不然就是数据库要和属性对应上.

以上是求大神解答mybatis里的SQL语句BUG的全部内容。
THE END
分享
二维码
< <上一篇
下一篇>>