| | |
| | | package cn.exrick.xboot.your.mapper; |
| | | |
| | | import cn.exrick.xboot.your.entity.Suggest; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import cn.exrick.xboot.your.entity.DrivingRecord; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Constants; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Result; |
| | | import org.apache.ibatis.annotations.Results; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.apache.ibatis.type.JdbcType; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | */ |
| | | public interface DrivingRecordMapper extends BaseMapper<DrivingRecord> { |
| | | |
| | | @Select("select max(mileage) from t_driving_record where user_id=#{userId}") |
| | | Integer maxByUserId(String userId); |
| | | |
| | | @Select("select min(mileage) from t_driving_record where user_id=#{userId}") |
| | | Integer minByUserId(String userId); |
| | | |
| | | @Select("select sum(likes) from t_driving_record where user_id=#{userId}") |
| | | Integer sumLikeByUserId(String userId); |
| | | |
| | | @Select("select count(id) from t_driving_record where yin_huan=1") |
| | | int count2(); |
| | | |
| | | @Select("SELECT a.*,b.car_no as carNo FROM t_driving_record a LEFT JOIN t_car b ON a.car_id=b.id ${ew.customSqlSegment} ") |
| | | @Results({@Result(column="carNo", property="carNo", jdbcType = JdbcType.VARCHAR)}) |
| | | IPage<DrivingRecord> page2(Page initMpPage, @Param(Constants.WRAPPER) QueryWrapper<DrivingRecord> wrapper); |
| | | } |