You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
93 lines
3.9 KiB
93 lines
3.9 KiB
package com.mh.user.mapper; |
|
|
|
import com.mh.user.entity.BuildingEntity; |
|
import com.mh.user.entity.DeviceInstallEntity; |
|
import com.mh.user.entity.EnergyEntity; |
|
import com.mh.user.entity.MaintainInfoEntity; |
|
import com.mh.user.mapper.provider.EnergyProvider; |
|
import com.mh.user.mapper.provider.MaintainInfoProvider; |
|
import org.apache.ibatis.annotations.*; |
|
|
|
import java.util.List; |
|
|
|
@Mapper |
|
public interface MaintainInfoMapper { |
|
|
|
/** |
|
* 维修保养模块 |
|
* 维修保养信息 |
|
* @param maintainInfoEntity |
|
*/ |
|
@Insert("insert into maintain_info(cur_date,building_id,device_type,device_addr,maintain_type,maintain_people,cost,contents, evaluate) values (" + |
|
" getDate(),#{buildingId},#{deviceType},#{deviceAddr},#{maintainType},#{maintainPeople},#{cost},#{contents}, #{evaluate})") |
|
int saveMaintainInfo(MaintainInfoEntity maintainInfoEntity); |
|
|
|
/** |
|
* 维修保养模块 |
|
* 根据日期修改维修保养信息 |
|
* @param maintainInfoEntity |
|
*/ |
|
@Update("<script>" + |
|
" update maintain_info set " + |
|
" <if test='buildingId!=null'> building_id = #{buildingId} </if>" + |
|
" <if test='deviceType!=null'> , device_type = #{deviceType} </if>" + |
|
" <if test='deviceAddr!=null'> , device_addr = #{deviceAddr} </if>" + |
|
" <if test='maintainType!=null'> , maintain_type = #{maintainType} </if>" + |
|
" <if test='maintainPeople!=null'> , maintain_people = #{maintainPeople} </if>" + |
|
" <if test='cost!=null'> , cost = #{cost} </if>" + |
|
" <if test='contents!=null'> , contents = #{contents} </if>" + |
|
" <if test='evaluate!=null'> , evaluate = #{evaluate} </if>" + |
|
" where id = #{id} " + |
|
"</script>") |
|
int updateMaintainInfo(MaintainInfoEntity maintainInfoEntity); |
|
|
|
|
|
/** |
|
* 维修保养模块 |
|
* 根据日期、设备类型查询维修保养信息 |
|
* @param curDate |
|
* @param deviceType |
|
* @param page |
|
* @param limit |
|
* @return |
|
*/ |
|
@SelectProvider(type = MaintainInfoProvider.class,method = "queryMaintainInfo") |
|
@Results(value = { |
|
@Result(property="curDate",column="cur_date"), |
|
@Result(property="buildingId",column="building_id"), |
|
@Result(property="buildingName",column="building_name"), |
|
@Result(property="deviceType",column="device_type"), |
|
@Result(property ="deviceAddr",column ="device_addr"), |
|
@Result(property ="maintainType",column ="maintain_type"), |
|
@Result(property="maintainPeople",column="maintain_people"), |
|
@Result(property="id",column="id"), |
|
@Result(property="cost",column="cost"), |
|
@Result(property="contents",column="contents"), |
|
@Result(property="evaluate",column="evaluate") |
|
}) |
|
List<MaintainInfoEntity> queryMaintainInfo(@Param("curDate") String curDate, |
|
@Param("buildingId") String buildingId, |
|
@Param("deviceType") String deviceType, |
|
@Param("page") int page, |
|
@Param("limit") int limit); |
|
/** |
|
* 维修保养模块 |
|
* 根据日期、设备类型查询记录数 |
|
* @return |
|
*/ |
|
@SelectProvider(type = MaintainInfoProvider.class,method = "getMaintainInfoCount") |
|
int getMaintainInfoCount(@Param("curDate") String curDate, |
|
@Param("buildingId") String buildingId, |
|
@Param("deviceType") String deviceType, |
|
@Param("page") int page, |
|
@Param("limit") int limit); |
|
|
|
/** |
|
* 维修保养模块 |
|
* 根据维护编号删除维修保养信息 |
|
* @param id |
|
*/ |
|
@Delete("delete from maintain_info where id=#{id}") |
|
void deleteMaintainInfo(String id); |
|
|
|
}
|
|
|