O 乛 2021-04-02 11:06 采纳率: 20%
浏览 301
已采纳

关于Mapper.xml里写的insert方法 对应的dao方法

这是dao方法  

int insertRecord(CustmoerDownRecordDO custmoerDownRecordDO,String taskType);
}

这是xml

<insert id="insertRecord" parameterType="com.yz.api.pojo.CustomerDownRecordDO">
  insert into custmoer_down_record(task_type,customer_id,file_info_id,
                                   bucket_name,object_name,gmt_create,created_by,gmt_modify)
  values (
           #{taskType},
           #{customer_id},
           #{file_info_id},
           #{bucket_name},
           #{object_name},
           #{gmt_create},
           #{created_by},
           #{gmt_modify}
         )
</insert>

这是service

public int insertRecord(CustmoerDownRecordDO custmoerDownRecord, String taskType) {
    try {
        //记录客户下载文件信息
        FileInfoDO fileInfoMessage = fileInfoDao.select(taskType);
        custmoerDownRecord.setTaskType(taskType);
        custmoerDownRecord.setCustomerId(taskType);
        custmoerDownRecord.setFileInfoId(fileInfoMessage.getId());
        custmoerDownRecord.setBucketName((fileInfoMessage.getBucketName()));
        custmoerDownRecord.setObjectName(fileInfoMessage.getObjectName());
        custmoerDownRecord.setGmtCreate(fileInfoMessage.getGmtCreate());
        custmoerDownRecord.setGmtModify(fileInfoMessage.getGmtModify());
        custmoerDownRecordDao.insertRecord(custmoerDownRecord, taskType);
    }catch(Exception e){
        logger.error("记录用户下载文件异常",e);
        
    }
    return 0;

这是contorller

@Autowired
private ApiService apiService;
@RequestMapping("/api/v1")
public ResultJson selectByType(HttpServletRequest request,
                               HttpServletResponse response)throws Exception{
    String key = request.getHeader(ParamConstants.X_ACCESS_LKEY);
    String task_type = request.getHeader(ParamConstants.TASK_TYPE);
    ResultJson result = null;
    result = ResultJson.ok().data(apiService.selectByType(task_type));
    CustmoerDownRecordDO custmoerDownRecordDO = new CustmoerDownRecordDO();
    apiService.insertRecord(custmoerDownRecordDO,task_type);
    return result;

大概就是我要根据tasktype来判断用户下载的是哪文件 然后把一些属性拿出来记录一下

就一直报错

 

 

  • 写回答

8条回答 默认 最新

  • 魂兮呀 2021-04-02 11:48
    关注
    CustmoerDownRecordDO   CustomerDownRecordDO 类名错了  错误提示很明显了 
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(7条)

报告相同问题?

悬赏问题

  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法
  • ¥15 matlab代码代写,需写出详细代码,代价私
  • ¥15 ROS系统搭建请教(跨境电商用途)
  • ¥15 AIC3204的示例代码有吗,想用AIC3204测量血氧,找不到相关的代码。