package com.cdzy.ebikemaintenance.mapper; import com.mybatisflex.core.BaseMapper; import com.cdzy.ebikemaintenance.model.pojo.EbikeBikeInfo; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Update; import java.util.List; /** * 车辆基本信息 映射层。 * * @author zjd * @since 2025-03-17 */ public interface EbikeBikeInfoMapper extends BaseMapper { /** * 解绑中控 mapper接口 * * @param bikeCodes 车辆编号 * @return */ @Update({ "" }) int untieEcu(@Param("bikeCodes") List bikeCodes); /** * 车辆批量出库 * * @param bikeCodes 车辆出库信息 * @param status 车辆状态 * @param reginId 区域id * @return */ @Update({ "" }) int vehicleLeaveWarehouse(@Param("bikeCodes") List bikeCodes, @Param("status") String status, @Param("reginId") String reginId); @Select({ "SELECT COUNT(1) FROM ebike_bike_order a " + "LEFT JOIN ebike_bike_info b ON a.bike_id = b.bike_id " + "WHERE a.order_type = 1 " + "AND a.handle_state = 0 " + "AND a.is_deleted = 0 " + "AND b.bike_code = #{bikeCode}" }) int selectOrderCount(@Param("bikeCode") String bikeCode); @Select({ "SELECT count(1) as sl FROM ebike_bike_faultreport where " + "ifnull(handle_state,0)=0 AND bike_code = #{bikeCode}" }) int selectReportCount(@Param("bikeCode") String bikeCode); }