Commit ed51c540 authored by renchao's avatar renchao
parents 994afce8 39aab3f4
......@@ -3,9 +3,12 @@
<mapper namespace="cn.wise.sc.acquisition.business.mapper.DataStatisticsMapper">
<select id="countByPhoto" resultType="cn.wise.sc.acquisition.business.model.vo.DataStatisticsVo">
SELECT tw.Rq as name, SUM(tw.Jz) as value
SELECT Convert(varchar(10),tw.Rq,120) as name, SUM(tw.Jz) as value
FROM T_Weight tw
where 1=1
<if test="params.TruckID != null and params.TruckID != ''">
and tw.TruckID = #{params.TruckID}
</if>
<if test="params.cycle == 1 ">
and datediff(week, tw.Rq,getdate())=0
</if>
......@@ -19,23 +22,26 @@
and datediff(year, tw.Rq,getdate())=0
</if>
<if test="params.startDate != null and params.startDate != ''">
and tw.Rq > &gt;= #{params.startDate}
and Convert(varchar(10),tw.Rq,120) <![CDATA[ >= ]]> #{params.startDate}
</if>
<if test="params.endDate != null and params.endDate != ''">
and tw.Rq > &lt;= #{params.endDate}
and Convert(varchar(10),tw.Rq,120) <![CDATA[ <= ]]> #{params.endDate}
</if>
<if test="params.startDate == null and params.endDate == null">
and datediff(week, tw.Rq,getdate())=0
</if>
group by tw.Rq
group by Convert(varchar(10),tw.Rq,120)
</select>
<select id="countByTable" resultType="cn.wise.sc.acquisition.business.model.vo.DataStatisticsTableVo">
SELECT tw.Uid,tw.Rq,tw.Sj,tw.TruckID,'发货单位' as clientName,tpt.WorkType,tw.Mz,tw.Pz,tw.Jz
SELECT tw.Uid,Convert(varchar(19),tw.Rq,120)as Rq,tw.TruckID,'发货单位' as clientName,tpt.WorkType,tw.Mz,tw.Pz,tw.Jz
FROM T_Weight tw
left join T_Processes_Truck tpt on tpt.TruckID = tw.TruckID
where 1=1
<if test="params.TruckID != null and params.TruckID != ''">
and tw.TruckID = #{params.TruckID}
</if>
<if test="params.cycle == 1 ">
and datediff(week, tw.Rq,getdate())=0
</if>
......@@ -49,10 +55,10 @@
and datediff(year, tw.Rq,getdate())=0
</if>
<if test="params.startDate != null and params.startDate != ''">
and tw.Rq > &gt;= #{params.startDate}
and Convert(varchar(10),tw.Rq,120) <![CDATA[ >= ]]> #{params.startDate}
</if>
<if test="params.endDate != null and params.endDate != ''">
and tw.Rq > &lt;= #{params.endDate}
and Convert(varchar(10),tw.Rq,120) <![CDATA[ <= ]]> #{params.endDate}
</if>
<if test="params.startDate == null and params.endDate == null">
and datediff(week, tw.Rq,getdate())=0
......
......@@ -28,11 +28,11 @@ public class DataStatisticsTableVo {
@ApiModelProperty("日期")
private String Rq;
/**
/* *//**
* 时间
*/
*//*
@ApiModelProperty("时间")
private String Sj;
private String Sj;*/
/**
* 矿车编号
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment