Commit ea86d043 authored by jichao's avatar jichao

改bug

parent e041b7ac
...@@ -28,8 +28,8 @@ public interface EnergyCountMRepository extends BaseMapper<EnergyCountM> { ...@@ -28,8 +28,8 @@ public interface EnergyCountMRepository extends BaseMapper<EnergyCountM> {
"sum(GAS) as gas,sum(GAS_MONEY) as gasMoney" + "sum(GAS) as gas,sum(GAS_MONEY) as gasMoney" +
" from energy_count_m e " + " from energy_count_m e " +
"where e.PRO_ID=#{proId} and `year`=#{year}" + "where e.PRO_ID=#{proId} and `year`=#{year}" +
"<if test=\"day != null\"> and `day`=#{day} group by e.`day`</if>" + "<if test=\"day != null\"> and `day`=${day} group by e.`day`</if>" +
"<if test=\"mon != null\"> and mon=#{mon} group by e.mon</if></script>") "<if test=\"mon != null\"> and mon=${mon} group by e.mon</if></script>")
@ResultMap("BaseResultMap") @ResultMap("BaseResultMap")
EnergyCountM countAmountAndPrice(EnergyCountM energyCountM); EnergyCountM countAmountAndPrice(EnergyCountM energyCountM);
...@@ -41,7 +41,7 @@ public interface EnergyCountMRepository extends BaseMapper<EnergyCountM> { ...@@ -41,7 +41,7 @@ public interface EnergyCountMRepository extends BaseMapper<EnergyCountM> {
@Select("<script>select e.`HOUR`," + @Select("<script>select e.`HOUR`," +
"sum(e.WATER_MONEY)+sum(e.ELEC_MONEY)+sum(e.GAS_MONEY) as MONEY" + "sum(e.WATER_MONEY)+sum(e.ELEC_MONEY)+sum(e.GAS_MONEY) as MONEY" +
" from energy_count_m e" + " from energy_count_m e" +
" where e.PRO_ID=#{proId} and e.`YEAR`=#{year} and e.MON=#{mon} and e.`DAY`=#{day} group by e.`HOUR`+0 asc</script>") " where e.PRO_ID=#{proId} and e.`YEAR`=#{year} and e.MON=${mon} and e.`DAY`=${day} group by e.`HOUR`+0 asc</script>")
@ResultMap("resultMapVo") @ResultMap("resultMapVo")
List<EnergyCountMVo> countDailyPrice(EnergyCountMVo energyCountMVo); List<EnergyCountMVo> countDailyPrice(EnergyCountMVo energyCountMVo);
...@@ -51,7 +51,7 @@ public interface EnergyCountMRepository extends BaseMapper<EnergyCountM> { ...@@ -51,7 +51,7 @@ public interface EnergyCountMRepository extends BaseMapper<EnergyCountM> {
* @return * @return
*/ */
@Select("<script>select if(sum(e.WATER) is null, 0, sum(e.WATER)) ENERGY from energy_count_m e " + @Select("<script>select if(sum(e.WATER) is null, 0, sum(e.WATER)) ENERGY from energy_count_m e " +
"where e.`DAY`=#{day} and e.MON=#{mon} and e.`YEAR`=#{year} and e.PRO_ID=#{proId}</script>") "where e.`DAY`=${day} and e.MON=${mon} and e.`YEAR`=#{year} and e.PRO_ID=#{proId}</script>")
@ResultMap("resultMapVo") @ResultMap("resultMapVo")
List<EnergyCountMVo> countEnergySplitWater(EnergyCountMVo energyCountMVo); List<EnergyCountMVo> countEnergySplitWater(EnergyCountMVo energyCountMVo);
...@@ -65,7 +65,7 @@ public interface EnergyCountMRepository extends BaseMapper<EnergyCountM> { ...@@ -65,7 +65,7 @@ public interface EnergyCountMRepository extends BaseMapper<EnergyCountM> {
"<if test=\"type == 3\">sum(e.GAS) ENERGY </if>" + "<if test=\"type == 3\">sum(e.GAS) ENERGY </if>" +
"from bus_device d,bus_device_meter dm,energy_count_m e " + "from bus_device d,bus_device_meter dm,energy_count_m e " +
"where d.DEV_NUM=dm.DEV_NUM and dm.MET_NUM=e.MET_NUM and " + "where d.DEV_NUM=dm.DEV_NUM and dm.MET_NUM=e.MET_NUM and " +
"e.`DAY`=#{day} and e.MON=#{mon} and e.`YEAR`=#{year} and e.PRO_ID=#{proId} " + "e.`DAY`=${day} and e.MON=${mon} and e.`YEAR`=#{year} and e.PRO_ID=#{proId} " +
"group by d.DEV_NM</script>") "group by d.DEV_NM</script>")
@ResultMap("resultMapVo") @ResultMap("resultMapVo")
List<EnergyCountMVo> countEnergySplitElecGas(EnergyCountMVo energyCountMVo); List<EnergyCountMVo> countEnergySplitElecGas(EnergyCountMVo energyCountMVo);
...@@ -78,8 +78,8 @@ public interface EnergyCountMRepository extends BaseMapper<EnergyCountM> { ...@@ -78,8 +78,8 @@ public interface EnergyCountMRepository extends BaseMapper<EnergyCountM> {
@Select("<script>select a.* from (" + @Select("<script>select a.* from (" +
"select e.`DAY`," + "select e.`DAY`," +
"sum(e.WATER_MONEY)+sum(e.ELEC_MONEY)+sum(e.GAS_MONEY) MONEY" + "sum(e.WATER_MONEY)+sum(e.ELEC_MONEY)+sum(e.GAS_MONEY) MONEY" +
" from energy_count_m e where e.PRO_ID=#{proId} and e.`YEAR`=#{year} and e.MON=#{mon}" + " from energy_count_m e where e.PRO_ID=#{proId} and e.`YEAR`=#{year} and e.MON=${mon}" +
"<if test=\"hour != null\"> and e.HOUR &lt;= #{hour}</if>" + "<if test=\"hour != null\"> and e.HOUR &lt;= ${hour}</if>" +
" group by e.`DAY`+0 asc) a order by a.MONEY desc</script>") " group by e.`DAY`+0 asc) a order by a.MONEY desc</script>")
@ResultMap("resultMapVo") @ResultMap("resultMapVo")
List<EnergyCountMVo> getPriceRank(EnergyCountMVo energyCountMVo); List<EnergyCountMVo> getPriceRank(EnergyCountMVo energyCountMVo);
...@@ -93,7 +93,7 @@ public interface EnergyCountMRepository extends BaseMapper<EnergyCountM> { ...@@ -93,7 +93,7 @@ public interface EnergyCountMRepository extends BaseMapper<EnergyCountM> {
"<if test=\"type == 1\">sum(e.WATER)</if>" + "<if test=\"type == 1\">sum(e.WATER)</if>" +
"<if test=\"type == 2\">sum(e.ELEC)</if>" + "<if test=\"type == 2\">sum(e.ELEC)</if>" +
"<if test=\"type == 3\">sum(e.GAS)</if>" + "<if test=\"type == 3\">sum(e.GAS)</if>" +
" as ENERGY from energy_count_m e where e.PRO_ID=#{proId} and e.`YEAR`=#{year} and e.MON=#{mon} group by e.`DAY`+0 asc</script>") " as ENERGY from energy_count_m e where e.PRO_ID=#{proId} and e.`YEAR`=#{year} and e.MON=${mon} group by e.`DAY`+0 asc</script>")
@ResultMap("resultMapVo") @ResultMap("resultMapVo")
List<EnergyCountMVo> getEnergyCompare(EnergyCountMVo energyCountMVo); List<EnergyCountMVo> getEnergyCompare(EnergyCountMVo energyCountMVo);
...@@ -112,7 +112,7 @@ public interface EnergyCountMRepository extends BaseMapper<EnergyCountM> { ...@@ -112,7 +112,7 @@ public interface EnergyCountMRepository extends BaseMapper<EnergyCountM> {
* @param energyCountM * @param energyCountM
* @return * @return
*/ */
@Select("<script>select SUM(e.WATER) WATER,SUM(e.ELEC) ELEC,SUM(e.GAS) GAS from energy_count_m e where e.PRO_ID=#{proId} and e.`YEAR`=#{year} and e.MON=#{mon} and e.`DAY`=#{day}</script>") @Select("<script>select SUM(e.WATER) WATER,SUM(e.ELEC) ELEC,SUM(e.GAS) GAS from energy_count_m e where e.PRO_ID=#{proId} and e.`YEAR`=#{year} and e.MON=${mon} and e.`DAY`=${day}</script>")
@ResultMap("BaseResultMap") @ResultMap("BaseResultMap")
EnergyCountM countEnergyDay(EnergyCountM energyCountM); EnergyCountM countEnergyDay(EnergyCountM energyCountM);
...@@ -130,7 +130,7 @@ public interface EnergyCountMRepository extends BaseMapper<EnergyCountM> { ...@@ -130,7 +130,7 @@ public interface EnergyCountMRepository extends BaseMapper<EnergyCountM> {
* @param energyCountMVo * @param energyCountMVo
* @return * @return
*/ */
@Select("<script>select e.`DAY`,sum(if(e.WATER_MONEY is null,0,e.WATER_MONEY))+sum(if(e.ELEC_MONEY is null,0,e.ELEC_MONEY))+sum(if(e.GAS_MONEY is null,0,e.GAS_MONEY)) MONEY from energy_count_m e where e.PRO_ID=#{proId} and e.`YEAR`=#{year} and e.MON=#{mon} group by e.`DAY`+0 asc</script>") @Select("<script>select e.`DAY`,sum(if(e.WATER_MONEY is null,0,e.WATER_MONEY))+sum(if(e.ELEC_MONEY is null,0,e.ELEC_MONEY))+sum(if(e.GAS_MONEY is null,0,e.GAS_MONEY)) MONEY from energy_count_m e where e.PRO_ID=#{proId} and e.`YEAR`=#{year} and e.MON=${mon} group by e.`DAY`+0 asc</script>")
@ResultMap("resultMapVo") @ResultMap("resultMapVo")
List<EnergyCountMVo> statEnergyPlanMonth(EnergyCountMVo energyCountMVo); List<EnergyCountMVo> statEnergyPlanMonth(EnergyCountMVo energyCountMVo);
...@@ -139,7 +139,7 @@ public interface EnergyCountMRepository extends BaseMapper<EnergyCountM> { ...@@ -139,7 +139,7 @@ public interface EnergyCountMRepository extends BaseMapper<EnergyCountM> {
* @param energyCountMVo * @param energyCountMVo
* @return * @return
*/ */
@Select("<script>select e.`HOUR`,sum(if(e.WATER_MONEY is null,0,e.WATER_MONEY))+sum(if(e.ELEC_MONEY is null,0,e.ELEC_MONEY))+sum(if(e.GAS_MONEY is null,0,e.GAS_MONEY)) MONEY from energy_count_m e where e.PRO_ID=#{proId} and e.`YEAR`=#{year} and e.MON=#{mon} and e.`DAY`=#{day} group by e.`HOUR`+0 asc</script>") @Select("<script>select e.`HOUR`,sum(if(e.WATER_MONEY is null,0,e.WATER_MONEY))+sum(if(e.ELEC_MONEY is null,0,e.ELEC_MONEY))+sum(if(e.GAS_MONEY is null,0,e.GAS_MONEY)) MONEY from energy_count_m e where e.PRO_ID=#{proId} and e.`YEAR`=#{year} and e.MON=${mon} and e.`DAY`=#{day} group by e.`HOUR`+0 asc</script>")
@ResultMap("resultMapVo") @ResultMap("resultMapVo")
List<EnergyCountMVo> statEnergyPlanDay(EnergyCountMVo energyCountMVo); List<EnergyCountMVo> statEnergyPlanDay(EnergyCountMVo energyCountMVo);
......
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