springBoot2.x 整合tk.mybits

导入包 compile group: 'tk.mybatis', name: 'mapper', version: '4.1.5' 配置文件中加入

mapper: mappers: - tk.mybatis.mapper.common.Mapper not-empty: false identity: select replace(uuid(),"-","") order: before

实体类配置: import lombok.Data;

import javax.persistence.*;

/**

  • 订单表 / @Data @Table(name="t_mom_order") public class MomOrderPO { /*

    • 自增 */ @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "id", length = 36) private String id;

    /**

    • 创建时间 / @Column(name="create_time") private String createTime; /*
    • 更新时间 / @Column(name="update_time") private String updateTime; /*
    • 抬头物料单位 / @Column(name="uom_code") private String uomCode; /*
    • 订单号 / @Column(name="wip_order_no") private String wipOrderNo; /*
    • 订单类型 / @Column(name="wip_order_type") private String wipOrderType; /*
    • 订单类型描述 / @Column(name="wip_order_type_desc") private String wipOrderTypeDesc; /*
    • 工序物料号 / @Column(name="product_no") private String productNo; /*
    • 工序描述 / @Column(name="product_desc") private String productDesc; /*
    • 订单状态 / @Column(name="progress_status") private String progressStatus; /*
    • 车辆号 / @Column(name="car_no") private String carNo; /*
    • 项目号 / @Column(name="project_no") private String projectNo; /*
    • WBS元素号 / @Column(name="wbs_code") private String wbsCode; /*
    • 订单需求数量 / @Column(name="order_quantity") private String orderQuantity; /*
    • 订单工厂 / @Column(name="facility") private String facility; /*
    • 订单工厂描述 / @Column(name="facility_desc") private String facilityDesc; /*
    • 实际开工时间 / @Column(name="actual_start_date") private String actualStartDate; /*
    • 计划开工时间 / @Column(name="scheduled_start_date") private String scheduledStartDate; /*
    • 计划完工时间 / @Column(name="scheduled_completion_date") private String scheduledCompletionDate; /*
    • 台位编码 / @Column(name="tw") private String tw; /*
    • 台位描述 / @Column(name="tw_desc") private String twDesc; /*
    • 工位编码 / @Column(name="gw") private String gw; /*
    • 工位描述 / @Column(name="gw_desc") private String gwDesc; /*
    • 车辆顺号 / @Column(name="product_number") private String productNumber; /*
    • 车辆钢号 */ @Column(name="steel_seal") private String steelSeal;

}

创建mapper import com.sunvua.calliope.mom.model.MomOrderDocPO; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import org.springframework.stereotype.Component; import tk.mybatis.mapper.common.Mapper; import tk.mybatis.mapper.common.MySqlMapper;

/**

  • @author jsc */

@Component public interface MomOrderDocPOMapper extends Mapper, MySqlMapper { @Select("select * from t_mom_order_doc where order_id=#{wipOrderNo}") MomOrderDocPO selectByWipOrderNo(@Param("wipOrderNo") String wipOrderNo); } 启动类加入@MapperScan("com.sunvua.calliope.mom.mapper") 扫描吗mapper springBoot2.x 整合tk.mybits_第1张图片

service 注入mapper

转载于:https://my.oschina.net/u/3022323/blog/3098357

你可能感兴趣的:(java)