whycrzg
2021-02-23 351b9a53cb9ecebdf8f79db0117f540d9c42c2a4
src/main/java/com/fgkj/services/User_task_batt_checkService.java
@@ -1,26 +1,30 @@
package com.fgkj.services;
import java.util.List;
import com.fgkj.mapper.BaseDAO;
import com.fgkj.mapper.BaseDAOFactory;
import com.fgkj.dto.ServiceModel;
import com.fgkj.dto.User_task_batt_check;
import com.fgkj.mapper.impl.User_task_batt_checkMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import javax.annotation.Resource;
@Service
public class User_task_batt_checkService {
   private ServiceModel model;
   private Impl mapper;;
   @Resource
   private User_task_batt_checkMapper mapper;;
   
   public User_task_batt_checkService() {
      model=new ServiceModel();
      dao=BaseDAOFactory.getBaseDAO(BaseDAO.USER_TASK_BATT_CHECK);
   }
    public ServiceModel add(Object obj) {
      Boolean bl=dao.add(obj);
    public ServiceModel add(User_task_batt_check obj) {
      ServiceModel model = new ServiceModel();
      Boolean bl= null;
      try {
         bl = mapper.add(obj);
      } catch (Exception e) {
         e.printStackTrace();
         model.setMsg("添加失败!");
         return model;
      }
      if(bl){
         model.setCode(1);
         model.setMsg("添加成功!");
@@ -32,8 +36,16 @@
      
   }
    //4.1提交,复查作业
   public ServiceModel update(Object obj) {
      Boolean bl=dao.update(obj);
   public ServiceModel update(User_task_batt_check obj) {
      ServiceModel model = new ServiceModel();
      Boolean bl= null;
      try {
         bl = mapper.update(obj);
      } catch (Exception e) {
         e.printStackTrace();
         model.setMsg("修改失败!");
         return model;
      }
      if(bl){
         model.setCode(1);
         model.setMsg("修改成功!");
@@ -44,8 +56,9 @@
      return model;   
   }
   
   public ServiceModel delete(Object obj) {
      Boolean bl=dao.del(obj);
   public ServiceModel delete(User_task_batt_check obj) {
      ServiceModel model = new ServiceModel();
      Boolean bl=mapper.del(obj)>0;
      if(bl){
         model.setCode(1);
         model.setMsg("删除成功!");
@@ -55,8 +68,10 @@
      }
      return model;   
   }
     public ServiceModel serchByCondition(Object obj){
      List list=dao.serchByCondition(obj);
     public ServiceModel serchByCondition(User_task_batt_check obj){
       ServiceModel model = new ServiceModel();
       System.out.println("obj = " + obj);
      List list=mapper.serchByCondition1(obj);// 不同bean参数调用 User_taskService
//      for (Object object : list) {
//         System.out.println(object);
//      }
@@ -69,7 +84,8 @@
      return model;
   } 
    public ServiceModel searchAll(){
      List list=dao.searchAll();
      ServiceModel model = new ServiceModel();
      List list=mapper.searchAll();
//      for (Object object : list) {
//         System.out.println(object);
//      }
@@ -80,14 +96,7 @@
      }      
      return model;
   } 
   public static void main(String[] args) {
      User_task_batt_checkService us = new User_task_batt_checkService();
      User_task_batt_check u=new User_task_batt_check();
      u.setNum(10131);
      us.serchByCondition(u);
      //us.searchAll();
   }
}