2025-04-14 09:35:36 +08:00
|
|
|
package com.cdzy.ebikemaintenance.mapper;
|
|
|
|
|
|
|
|
|
|
import com.mybatisflex.core.BaseMapper;
|
|
|
|
|
import com.cdzy.ebikemaintenance.model.pojo.EbikeBikeInfo;
|
|
|
|
|
import org.apache.ibatis.annotations.Param;
|
2025-05-23 14:27:32 +08:00
|
|
|
import org.apache.ibatis.annotations.Select;
|
2025-04-14 09:35:36 +08:00
|
|
|
import org.apache.ibatis.annotations.Update;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 车辆基本信息 映射层。
|
|
|
|
|
*
|
|
|
|
|
* @author zjd
|
|
|
|
|
* @since 2025-03-17
|
|
|
|
|
*/
|
|
|
|
|
public interface EbikeBikeInfoMapper extends BaseMapper<EbikeBikeInfo> {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 解绑中控 mapper接口
|
|
|
|
|
*
|
|
|
|
|
* @param bikeCodes 车辆编号
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@Update({
|
|
|
|
|
"<script>",
|
|
|
|
|
"UPDATE ebike_bike_info",
|
|
|
|
|
"SET ecu_id = NULL",
|
|
|
|
|
"WHERE bike_id IN",
|
|
|
|
|
"<foreach collection='bikeCodes' item='bikeCode' open='(' separator=',' close=')'>",
|
|
|
|
|
"#{bikeCode}",
|
|
|
|
|
"</foreach>",
|
|
|
|
|
"</script>"
|
|
|
|
|
})
|
|
|
|
|
int untieEcu(@Param("bikeCodes") List<String> bikeCodes);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 车辆批量出库
|
|
|
|
|
*
|
|
|
|
|
* @param bikeCodes 车辆出库信息
|
|
|
|
|
* @param status 车辆状态
|
2025-04-30 15:40:48 +08:00
|
|
|
* @param reginId 区域id
|
2025-04-14 09:35:36 +08:00
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@Update({
|
|
|
|
|
"<script>",
|
|
|
|
|
"UPDATE ebike_bike_info",
|
2025-04-21 18:38:50 +08:00
|
|
|
"SET state = #{status},regin_id = #{reginId}",
|
2025-04-14 09:35:36 +08:00
|
|
|
"WHERE bike_code IN",
|
|
|
|
|
"<foreach collection='bikeCodes' item='bikeCode' open='(' separator=',' close=')'>",
|
|
|
|
|
"#{bikeCode}",
|
|
|
|
|
"</foreach>",
|
|
|
|
|
"</script>"
|
|
|
|
|
})
|
|
|
|
|
int vehicleLeaveWarehouse(@Param("bikeCodes") List<String> bikeCodes,
|
2025-04-21 18:38:50 +08:00
|
|
|
@Param("status") String status, @Param("reginId") String reginId);
|
2025-05-23 14:27:32 +08:00
|
|
|
|
|
|
|
|
@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);
|
2025-04-14 09:35:36 +08:00
|
|
|
}
|