XML

    <resultMap >
        <result column="id" property="id" jdbcType="BIGINT" />
        <result column="frame_no" property="frameNo" jdbcType="VARCHAR"/>
        <result column="vehicle_no" property="vehicleNo" jdbcType="VARCHAR"/>
        <result column="version" property="version" jdbcType="VARCHAR"/>
    </resultMap>

    <select >
        SELECT id,frame_no ,vehicle_no ,version 
        FROM t_v_info 
        WHERE id IN
        <foreach collection="vehicleIds" item="vehicleId" open="(" close=")" separator=",">
            #{vehicleId}
        </foreach>
    </select>

DAO

    @MapKey("frameNo")
    Map<String,VehicleInfo> test(@Param("vehicleIds") List<Long> vehicleIds);

Entity

@Data
public class VehicleInfo implements Serializable{

    private static final long serialVersionUID = 1L;

    private Long id;
    private String frameNo;
    private String vehicleNo;
    private Integer version;
}

相关文章:

  • 2021-09-09
  • 2021-12-19
  • 2022-02-18
  • 2021-06-30
  • 2022-12-23
  • 2021-09-19
猜你喜欢
  • 2021-12-15
  • 2022-01-22
  • 2022-01-25
  • 2022-03-05
  • 2023-02-08
  • 2021-10-28
  • 2023-03-20
相关资源
相似解决方案