/// <summary> /// 插入训练计划 /// </summary> /// <param name="trainingPlanEntity"></param> /// <returns></returns> public int SaveTrainingPlan(TrainingPlanEntity trainingPlanEntity) { //插入至上传表 UploadManagementDAO uploadManagementDao = new UploadManagementDAO(); //数据上传 uploadManagementDao.Insert(new UploadManagement(trainingPlanEntity.Id, "bdl_training_plan", 0)); using (var conn = DbUtil.getConn()) { const string insert = "INSERT INTO `ai_sports`.`bdl_training_plan` (`fk_member_id`, `title`, `start_date`, `training_target`) VALUES (@Fk_member_id ,@Title , @Start_date , @Training_target)"; return(conn.Execute(insert, trainingPlanEntity)); } }
/// <summary> /// 更新前后方限制和杠杆角度 根据设备类型和会员id /// </summary> /// <param name="entity"></param> public void UpdateLimitByType(PersonalSettingEntity entity) { //上传表 UploadManagementDAO uploadManagementDao = new UploadManagementDAO(); //插入至上传表 uploadManagementDao.Insert(new UploadManagement(entity.Id, "bdl_personal_setting", 1)); string sql = @"update bdl_personal_setting set Lever_angle=@Lever_angle,Front_limit=@Front_limit,Back_limit=@Back_limit where member_id = @Member_id and Device_code=@Device_code "; using (var conn = DbUtil.getConn()) { conn.Execute(sql, entity); } }
/// <summary> /// 更新所有个人设置根据3D扫描的身体数据 /// </summary> /// <param name="entity"></param> public void UpdatePersonalSettingBy3DScan(PersonalSettingEntity entity) { //上传表 UploadManagementDAO uploadManagementDao = new UploadManagementDAO(); //插入至上传表 uploadManagementDao.Insert(new UploadManagement(entity.Id, "bdl_personal_setting", 1)); string sql = @"update bdl_personal_setting set seat_height = @Seat_height,backrest_distance = @Backrest_distance,footboard_distance = @Footboard_distance,front_limit = @Front_limit,back_limit = @Back_limit,lever_angle = @Lever_angle where member_id = @Member_id "; using (var conn = DbUtil.getConn()) { conn.Execute(sql, entity); } }
/// <summary> /// 更新耐力训练设备 单车和跑步机 更新功率,不更新训练模式 单车跑步机就一种标准模式 /// </summary> /// <param name="entity"></param> public void UpdateEnduranceDeviceSettingByType(PersonalSettingEntity entity) { //上传表 UploadManagementDAO uploadManagementDao = new UploadManagementDAO(); //插入至上传表 uploadManagementDao.Insert(new UploadManagement(entity.Id, "bdl_personal_setting", 1)); string sql = @"update bdl_personal_setting set power = @Power where member_id = @Member_id and activity_type = @Activity_type and device_code = '12' or device_code = '16' "; using (var conn = DbUtil.getConn()) { conn.Execute(sql, entity); } }
/// <summary> /// 更新力量设备 除去12号和16号单车、跑步机 更新训练模式 顺向反向力 /// </summary> /// <param name="entity"></param> public void UpdateStrengthDeviceSettingByType(PersonalSettingEntity entity) { //上传表 UploadManagementDAO uploadManagementDao = new UploadManagementDAO(); //插入至上传表 uploadManagementDao.Insert(new UploadManagement(entity.Id, "bdl_personal_setting", 1)); string sql = @"update bdl_personal_setting set training_mode = @Training_mode,consequent_force = @Consequent_force, reverse_force = @Reverse_force where member_id = @Member_id and activity_type = @Activity_type and device_code != '12' and device_code != '16' "; using (var conn = DbUtil.getConn()) { conn.Execute(sql, entity); } }