17,377
社区成员
发帖
与我相关
我的任务
分享
select t.* ,to_char(time,'MM')||'月' as month , from t_fpgl_inputinfo t
select t.* ,to_char(time,'MM')||'月' as month from t_fpgl_inputinfo t
select id="query" resultMap="ZRCJheadResult">
select * from
(
select z.* ,to_char(wl_date,'MM')||'月' as wl_month ,wl_weight*nf_num as nf_tonnage ,wl_weight*wf_num as wf_tonnage ,wl_weight*nt_num as nt_tonnage ,wl_weight*wt_num as wt_tonnage
,wl_weight*dd_num as dd_tonnage ,wl_weight*fj_num as fj_tonnage ,round(nf_num/dd_num,2) as nf_rate ,round(wf_num/fj_num,2) as wf_rate ,round(nt_num/dd_num,2) as nt_rate ,round(wt_num/fj_num,2) as wt_rate
,round((wf_num+wt_num)/fj_num,2) as wtwf_rate ,round((nf_num+wf_num/dd_num),2) as nwf_rate
from ZRCJ z
<where>
<if test="startTime != null and startTime != ''">
and to_char(wl_date,'YYYY-MM-DD') >= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
and to_char(wl_date,'YYYY-MM-DD') <= #{endTime}
</if>
</where>
)order by wl_month
</select>
<select id="query" resultMap="DifferentResult">
select * from
(
select t.* ,to_char(time,'MM')||'月' as month
from t_fpgl_inputinfo t
<where>
<if test="startTime != null and startTime != ''">
and to_char(time,'YYYY-MM-DD') >= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
and to_char(time,'YYYY-MM-DD') <= #{endTime}
</if>
</where>
)order by month
</select>
SELECT *
FROM ( SELECT t.* ,
to_char(TIME, 'MM') AS month
FROM t_fpgl_inputinfo t
) tt
ORDER BY MONTH