Commit 248d9dc8 by gechengyang

提交Mps/Mpi/Mpe等相关类和配置

parent a143f899
......@@ -73,6 +73,12 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.3</version>
</dependency>
</dependencies>
......
package com.brilliance;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* @Description
* @Author s_guodong
* @Date 2022/12/6
* @Author gechengyang
* @Date 2023/10/23
*/
@SpringBootApplication
@MapperScan({"com.brilliance.mapper"})
public class App {
public static void main(String[] args) {
......
package com.brilliance.controller;
import com.brilliance.entity.Mps;
import com.brilliance.service.MpsService;
import com.brilliance.vo.Result;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.List;
/**
* @Description
* @Author gechengyang
* @Date 2023/10/23
*/
@RestController
@RequestMapping("mps")
public class MpsController {
private Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
private MpsService mpsService;
@PostMapping("getMps")
/* public Result userList(@RequestParam("pageNum") Integer pageNum,
@RequestParam("pageSize") Integer pageSize) {*/
public Result userList() {
List<Mps> mpsList = mpsService.getMpsList(">", "D", new Date());
return new Result("success");
}
}
package com.brilliance.controller;
import com.brilliance.service.UserService;
import com.brilliance.vo.PageData;
import com.brilliance.vo.Result;
import com.brilliance.vo.UserVO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* @Description
* @Author s_guodong
* @Date 2022/12/6
*/
@RestController
@RequestMapping("user")
public class UserController {
private Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
private UserService userService;
@GetMapping("list")
public Result userList(@RequestParam("pageNum") Integer pageNum,
@RequestParam("pageSize") Integer pageSize) {
logger.info("获取用户列表,pageNum:{},pageSize:{}", pageNum, pageSize);
PageData<UserVO> pageData = userService.userList(pageNum, pageSize);
return new Result(pageData);
}
}
package com.brilliance.entity;
import java.util.Date;
public class Mpe {
private String inr;
private String chncod;
private Date dattim;
private String mpsinr;
private String nxtchncod;
private String nxtsmhinr;
private String prvsta;
private String smhinr;
private String sta;
private String txt;
private String rspsta;
private String prvrspsta;
private String usr;
private String frmnam;
private String etyinr;
private String ptyinr;
public String getInr() {
return inr;
}
public void setInr(String inr) {
this.inr = inr == null ? null : inr.trim();
}
public String getChncod() {
return chncod;
}
public void setChncod(String chncod) {
this.chncod = chncod == null ? null : chncod.trim();
}
public Date getDattim() {
return dattim;
}
public void setDattim(Date dattim) {
this.dattim = dattim;
}
public String getMpsinr() {
return mpsinr;
}
public void setMpsinr(String mpsinr) {
this.mpsinr = mpsinr == null ? null : mpsinr.trim();
}
public String getNxtchncod() {
return nxtchncod;
}
public void setNxtchncod(String nxtchncod) {
this.nxtchncod = nxtchncod == null ? null : nxtchncod.trim();
}
public String getNxtsmhinr() {
return nxtsmhinr;
}
public void setNxtsmhinr(String nxtsmhinr) {
this.nxtsmhinr = nxtsmhinr == null ? null : nxtsmhinr.trim();
}
public String getPrvsta() {
return prvsta;
}
public void setPrvsta(String prvsta) {
this.prvsta = prvsta == null ? null : prvsta.trim();
}
public String getSmhinr() {
return smhinr;
}
public void setSmhinr(String smhinr) {
this.smhinr = smhinr == null ? null : smhinr.trim();
}
public String getSta() {
return sta;
}
public void setSta(String sta) {
this.sta = sta == null ? null : sta.trim();
}
public String getTxt() {
return txt;
}
public void setTxt(String txt) {
this.txt = txt == null ? null : txt.trim();
}
public String getRspsta() {
return rspsta;
}
public void setRspsta(String rspsta) {
this.rspsta = rspsta == null ? null : rspsta.trim();
}
public String getPrvrspsta() {
return prvrspsta;
}
public void setPrvrspsta(String prvrspsta) {
this.prvrspsta = prvrspsta == null ? null : prvrspsta.trim();
}
public String getUsr() {
return usr;
}
public void setUsr(String usr) {
this.usr = usr == null ? null : usr.trim();
}
public String getFrmnam() {
return frmnam;
}
public void setFrmnam(String frmnam) {
this.frmnam = frmnam == null ? null : frmnam.trim();
}
public String getEtyinr() {
return etyinr;
}
public void setEtyinr(String etyinr) {
this.etyinr = etyinr == null ? null : etyinr.trim();
}
public String getPtyinr() {
return ptyinr;
}
public void setPtyinr(String ptyinr) {
this.ptyinr = ptyinr == null ? null : ptyinr.trim();
}
}
\ No newline at end of file
package com.brilliance.entity;
import java.util.Date;
public class Mps {
private String inr;
private String chncod;
private String dir;
private Date lstdattim;
private String nxtchncod;
private String pntinr;
private Date rcvdattim;
private Date rspdattim;
private String rspsta;
private String smhinr;
private Date snddattim;
private String srcchncod;
private String sta;
private String nxtsta;
private String stp;
private Date sttdattim;
private String tgtchncod;
private Date tgtdattime;
private String isman;
private String isblk;
private String etyinr;
private String ptyinr;
private String flg;
private String rspcod;
private String reptrksta;
private String swetyp;
private String sweack;
private String rptsta;
private String messageid;
private String blktyp;
private String xhxflg;
private Long ismx;
public String getInr() {
return inr;
}
public void setInr(String inr) {
this.inr = inr == null ? null : inr.trim();
}
public String getChncod() {
return chncod;
}
public void setChncod(String chncod) {
this.chncod = chncod == null ? null : chncod.trim();
}
public String getDir() {
return dir;
}
public void setDir(String dir) {
this.dir = dir == null ? null : dir.trim();
}
public Date getLstdattim() {
return lstdattim;
}
public void setLstdattim(Date lstdattim) {
this.lstdattim = lstdattim;
}
public String getNxtchncod() {
return nxtchncod;
}
public void setNxtchncod(String nxtchncod) {
this.nxtchncod = nxtchncod == null ? null : nxtchncod.trim();
}
public String getPntinr() {
return pntinr;
}
public void setPntinr(String pntinr) {
this.pntinr = pntinr == null ? null : pntinr.trim();
}
public Date getRcvdattim() {
return rcvdattim;
}
public void setRcvdattim(Date rcvdattim) {
this.rcvdattim = rcvdattim;
}
public Date getRspdattim() {
return rspdattim;
}
public void setRspdattim(Date rspdattim) {
this.rspdattim = rspdattim;
}
public String getRspsta() {
return rspsta;
}
public void setRspsta(String rspsta) {
this.rspsta = rspsta == null ? null : rspsta.trim();
}
public String getSmhinr() {
return smhinr;
}
public void setSmhinr(String smhinr) {
this.smhinr = smhinr == null ? null : smhinr.trim();
}
public Date getSnddattim() {
return snddattim;
}
public void setSnddattim(Date snddattim) {
this.snddattim = snddattim;
}
public String getSrcchncod() {
return srcchncod;
}
public void setSrcchncod(String srcchncod) {
this.srcchncod = srcchncod == null ? null : srcchncod.trim();
}
public String getSta() {
return sta;
}
public void setSta(String sta) {
this.sta = sta == null ? null : sta.trim();
}
public String getNxtsta() {
return nxtsta;
}
public void setNxtsta(String nxtsta) {
this.nxtsta = nxtsta == null ? null : nxtsta.trim();
}
public String getStp() {
return stp;
}
public void setStp(String stp) {
this.stp = stp == null ? null : stp.trim();
}
public Date getSttdattim() {
return sttdattim;
}
public void setSttdattim(Date sttdattim) {
this.sttdattim = sttdattim;
}
public String getTgtchncod() {
return tgtchncod;
}
public void setTgtchncod(String tgtchncod) {
this.tgtchncod = tgtchncod == null ? null : tgtchncod.trim();
}
public Date getTgtdattime() {
return tgtdattime;
}
public void setTgtdattime(Date tgtdattime) {
this.tgtdattime = tgtdattime;
}
public String getIsman() {
return isman;
}
public void setIsman(String isman) {
this.isman = isman == null ? null : isman.trim();
}
public String getIsblk() {
return isblk;
}
public void setIsblk(String isblk) {
this.isblk = isblk == null ? null : isblk.trim();
}
public String getEtyinr() {
return etyinr;
}
public void setEtyinr(String etyinr) {
this.etyinr = etyinr == null ? null : etyinr.trim();
}
public String getPtyinr() {
return ptyinr;
}
public void setPtyinr(String ptyinr) {
this.ptyinr = ptyinr == null ? null : ptyinr.trim();
}
public String getFlg() {
return flg;
}
public void setFlg(String flg) {
this.flg = flg == null ? null : flg.trim();
}
public String getRspcod() {
return rspcod;
}
public void setRspcod(String rspcod) {
this.rspcod = rspcod == null ? null : rspcod.trim();
}
public String getReptrksta() {
return reptrksta;
}
public void setReptrksta(String reptrksta) {
this.reptrksta = reptrksta == null ? null : reptrksta.trim();
}
public String getSwetyp() {
return swetyp;
}
public void setSwetyp(String swetyp) {
this.swetyp = swetyp == null ? null : swetyp.trim();
}
public String getSweack() {
return sweack;
}
public void setSweack(String sweack) {
this.sweack = sweack == null ? null : sweack.trim();
}
public String getRptsta() {
return rptsta;
}
public void setRptsta(String rptsta) {
this.rptsta = rptsta == null ? null : rptsta.trim();
}
public String getMessageid() {
return messageid;
}
public void setMessageid(String messageid) {
this.messageid = messageid == null ? null : messageid.trim();
}
public String getBlktyp() {
return blktyp;
}
public void setBlktyp(String blktyp) {
this.blktyp = blktyp == null ? null : blktyp.trim();
}
public String getXhxflg() {
return xhxflg;
}
public void setXhxflg(String xhxflg) {
this.xhxflg = xhxflg == null ? null : xhxflg.trim();
}
public Long getIsmx() {
return ismx;
}
public void setIsmx(Long ismx) {
this.ismx = ismx;
}
}
\ No newline at end of file
package com.brilliance.entity;
public class Rol {
private String inr;
private String rolnam;
public String getInr() {
return inr;
}
public void setInr(String inr) {
this.inr = inr == null ? null : inr.trim();
}
public String getRolnam() {
return rolnam;
}
public void setRolnam(String rolnam) {
this.rolnam = rolnam == null ? null : rolnam.trim();
}
}
\ No newline at end of file
package com.brilliance.entity;
public class Usr {
private String inr;
private String usrnam;
private Integer age;
public String getInr() {
return inr;
}
public void setInr(String inr) {
this.inr = inr == null ? null : inr.trim();
}
public String getUsrnam() {
return usrnam;
}
public void setUsrnam(String usrnam) {
this.usrnam = usrnam == null ? null : usrnam.trim();
}
public Integer getAge() {
return age;
}
public void setAge(Integer age) {
this.age = age;
}
}
\ No newline at end of file
package com.brilliance.entity;
public class UsrRol {
private String inr;
private String usrinr;
private String rolinr;
public String getInr() {
return inr;
}
public void setInr(String inr) {
this.inr = inr == null ? null : inr.trim();
}
public String getUsrinr() {
return usrinr;
}
public void setUsrinr(String usrinr) {
this.usrinr = usrinr == null ? null : usrinr.trim();
}
public String getRolinr() {
return rolinr;
}
public void setRolinr(String rolinr) {
this.rolinr = rolinr == null ? null : rolinr.trim();
}
}
\ No newline at end of file
......@@ -6,7 +6,7 @@ import org.springframework.web.servlet.config.annotation.InterceptorRegistration
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
//@Configuration
public class WebConfig implements WebMvcConfigurer {
@Bean
......
package com.brilliance.mapper;
import com.brilliance.entity.Mpe;
public interface MpeMapper {
int insert(Mpe record);
int insertSelective(Mpe record);
}
\ No newline at end of file
package com.brilliance.mapper;
import com.brilliance.entity.Mpi;
public interface MpiMapper {
int insert(Mpi record);
int insertSelective(Mpi record);
}
\ No newline at end of file
package com.brilliance.mapper;
import com.brilliance.entity.Mps;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
public interface MpsMapper {
int deleteByPrimaryKey(String inr);
int insert(Mps record);
int insertSelective(Mps record);
Mps selectByPrimaryKey(String inr);
int updateByPrimaryKeySelective(Mps record);
int updateByPrimaryKey(Mps record);
List<Mps> getMpsList(@Param("dir") String dir,@Param("sta") String sta,@Param("sttdattim") Date sttdattim) ;
}
\ No newline at end of file
package com.brilliance.mapper;
import com.brilliance.entity.Rol;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface RolMapper {
int deleteByPrimaryKey(String inr);
int insert(Rol record);
int insertSelective(Rol record);
Rol selectByPrimaryKey(String inr);
int updateByPrimaryKeySelective(Rol record);
int updateByPrimaryKey(Rol record);
}
\ No newline at end of file
package com.brilliance.mapper;
import com.brilliance.entity.Usr;
import com.brilliance.vo.UserVO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface UsrMapper {
int deleteByPrimaryKey(String inr);
int insert(Usr record);
int insertSelective(Usr record);
Usr selectByPrimaryKey(String inr);
int updateByPrimaryKeySelective(Usr record);
int updateByPrimaryKey(Usr record);
/**
* 查询用户列表
*
* @return
*/
List<UserVO> selectUserList();
}
\ No newline at end of file
package com.brilliance.mapper;
import com.brilliance.entity.UsrRol;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface UsrRolMapper {
int deleteByPrimaryKey(String inr);
int insert(UsrRol record);
int insertSelective(UsrRol record);
UsrRol selectByPrimaryKey(String inr);
int updateByPrimaryKeySelective(UsrRol record);
int updateByPrimaryKey(UsrRol record);
}
\ No newline at end of file
package com.brilliance.service;
import com.brilliance.entity.Mps;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
/**
* @Description
* @Author gechengyang
* @Date 2023/10/23
*/
public interface MpsService {
List<Mps> getMpsList(@Param("dir") String dir, @Param("sta") String sta, @Param("sttdattim") Date sttdattim);
}
package com.brilliance.service;
import com.brilliance.vo.PageData;
import com.brilliance.vo.UserVO;
import java.util.List;
/**
* @Description
* @Author s_guodong
* @Date 2022/12/6
*/
public interface UserService {
/**
* 查询用户列表
*
* @param pageNum
* @param pageSize
* @return
*/
PageData<UserVO> userList(Integer pageNum, Integer pageSize);
}
package com.brilliance.service.impl;
import com.brilliance.entity.Mps;
import com.brilliance.mapper.MpsMapper;
import com.brilliance.service.MpsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
* @Description
* @Author gechengyang
* @Date 2023/10/23
*/
@Service
public class MpsServiceServiceImpl implements MpsService {
@Autowired
private MpsMapper mpsMapper;
@Override
public List<Mps> getMpsList(String dir, String sta, Date sttdattim) {
return mpsMapper.getMpsList(dir,sta,sttdattim);
}
}
package com.brilliance.service.impl;
import com.brilliance.mapper.UsrMapper;
import com.brilliance.service.UserService;
import com.brilliance.vo.PageData;
import com.brilliance.vo.UserVO;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @Description
* @Author s_guodong
* @Date 2022/12/6
*/
@Service
public class UserServiceImpl implements UserService {
@Autowired
private UsrMapper usrMapper;
@Override
public PageData<UserVO> userList(Integer pageNum, Integer pageSize) {
PageHelper.startPage(pageNum, pageSize);
List<UserVO> list = usrMapper.selectUserList();
PageInfo<UserVO> pageInfo = PageInfo.of(list);
PageHelper.clearPage();
PageData pageData = new PageData(list, pageInfo.getPageNum(), pageInfo.getPageSize(), pageInfo.getPages(), pageInfo.getTotal());
return pageData;
}
}
package com.brilliance.vo;
import lombok.Data;
import java.util.List;
/**
* @Description
* @Author s_guodong
* @Date 2022/12/6
*/
@Data
public class PageData<T> {
/**
* 页码
*/
private Integer pageNum;
/**
* 分页大小
*/
private Integer pageSize;
/**
* 总页数
*/
private Integer pages;
/**
* 数据总数量
*/
private Long total;
private List<T> list;
public PageData() {
}
public PageData(List<T> list, Integer pageNum, Integer pageSize, Integer pages, Long total) {
this.list = list;
this.pageNum = pageNum;
this.pageSize = pageSize;
this.pages = pages;
this.total = total;
}
}
......@@ -4,8 +4,8 @@ import lombok.Data;
/**
* @Description
* @Author s_guodong
* @Date 2022/12/6
* @Author gechengyang
* @Date 2023/10/23
*/
@Data
public class Result {
......
package com.brilliance.vo;
import lombok.Data;
/**
* @Description
* @Author s_guodong
* @Date 2022/12/6
*/
@Data
public class UserVO {
/**
* 用户标识
*/
private String usrInr;
/**
* 用户名称
*/
private String usrNam;
/**
* 用户年纪
*/
private Integer age;
/**
* 用户角色名称
*/
private String rolNam;
}
......@@ -3,9 +3,9 @@ server:
spring:
datasource:
url: jdbc:mysql://localhost:3306/test?serverTimezone=UTC&useUnicode=true&characterEncoding=utf8&useSSL=false
username: root
password: 123456
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:oracle:thin:@114.115.138.98:9400:XE
username: test
password: test
driver-class-name: oracle.jdbc.driver.OracleDriver
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.brilliance.mapper.MpeMapper" >
<resultMap id="BaseResultMap" type="com.brilliance.entity.Mpe" >
<result column="INR" property="inr" jdbcType="CHAR" />
<result column="CHNCOD" property="chncod" jdbcType="VARCHAR" />
<result column="DATTIM" property="dattim" jdbcType="TIMESTAMP" />
<result column="MPSINR" property="mpsinr" jdbcType="VARCHAR" />
<result column="NXTCHNCOD" property="nxtchncod" jdbcType="VARCHAR" />
<result column="NXTSMHINR" property="nxtsmhinr" jdbcType="VARCHAR" />
<result column="PRVSTA" property="prvsta" jdbcType="CHAR" />
<result column="SMHINR" property="smhinr" jdbcType="VARCHAR" />
<result column="STA" property="sta" jdbcType="CHAR" />
<result column="TXT" property="txt" jdbcType="VARCHAR" />
<result column="RSPSTA" property="rspsta" jdbcType="CHAR" />
<result column="PRVRSPSTA" property="prvrspsta" jdbcType="CHAR" />
<result column="USR" property="usr" jdbcType="VARCHAR" />
<result column="FRMNAM" property="frmnam" jdbcType="VARCHAR" />
<result column="ETYINR" property="etyinr" jdbcType="CHAR" />
<result column="PTYINR" property="ptyinr" jdbcType="CHAR" />
</resultMap>
<insert id="insert" parameterType="com.brilliance.entity.Mpe" >
insert into TEST.MPE (INR, CHNCOD, DATTIM,
MPSINR, NXTCHNCOD, NXTSMHINR,
PRVSTA, SMHINR, STA, TXT,
RSPSTA, PRVRSPSTA, USR, FRMNAM,
ETYINR, PTYINR)
values (#{inr,jdbcType=CHAR}, #{chncod,jdbcType=VARCHAR}, #{dattim,jdbcType=TIMESTAMP},
#{mpsinr,jdbcType=VARCHAR}, #{nxtchncod,jdbcType=VARCHAR}, #{nxtsmhinr,jdbcType=VARCHAR},
#{prvsta,jdbcType=CHAR}, #{smhinr,jdbcType=VARCHAR}, #{sta,jdbcType=CHAR}, #{txt,jdbcType=VARCHAR},
#{rspsta,jdbcType=CHAR}, #{prvrspsta,jdbcType=CHAR}, #{usr,jdbcType=VARCHAR}, #{frmnam,jdbcType=VARCHAR},
#{etyinr,jdbcType=CHAR}, #{ptyinr,jdbcType=CHAR})
</insert>
<insert id="insertSelective" parameterType="com.brilliance.entity.Mpe" >
insert into TEST.MPE
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="inr != null" >
INR,
</if>
<if test="chncod != null" >
CHNCOD,
</if>
<if test="dattim != null" >
DATTIM,
</if>
<if test="mpsinr != null" >
MPSINR,
</if>
<if test="nxtchncod != null" >
NXTCHNCOD,
</if>
<if test="nxtsmhinr != null" >
NXTSMHINR,
</if>
<if test="prvsta != null" >
PRVSTA,
</if>
<if test="smhinr != null" >
SMHINR,
</if>
<if test="sta != null" >
STA,
</if>
<if test="txt != null" >
TXT,
</if>
<if test="rspsta != null" >
RSPSTA,
</if>
<if test="prvrspsta != null" >
PRVRSPSTA,
</if>
<if test="usr != null" >
USR,
</if>
<if test="frmnam != null" >
FRMNAM,
</if>
<if test="etyinr != null" >
ETYINR,
</if>
<if test="ptyinr != null" >
PTYINR,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="inr != null" >
#{inr,jdbcType=CHAR},
</if>
<if test="chncod != null" >
#{chncod,jdbcType=VARCHAR},
</if>
<if test="dattim != null" >
#{dattim,jdbcType=TIMESTAMP},
</if>
<if test="mpsinr != null" >
#{mpsinr,jdbcType=VARCHAR},
</if>
<if test="nxtchncod != null" >
#{nxtchncod,jdbcType=VARCHAR},
</if>
<if test="nxtsmhinr != null" >
#{nxtsmhinr,jdbcType=VARCHAR},
</if>
<if test="prvsta != null" >
#{prvsta,jdbcType=CHAR},
</if>
<if test="smhinr != null" >
#{smhinr,jdbcType=VARCHAR},
</if>
<if test="sta != null" >
#{sta,jdbcType=CHAR},
</if>
<if test="txt != null" >
#{txt,jdbcType=VARCHAR},
</if>
<if test="rspsta != null" >
#{rspsta,jdbcType=CHAR},
</if>
<if test="prvrspsta != null" >
#{prvrspsta,jdbcType=CHAR},
</if>
<if test="usr != null" >
#{usr,jdbcType=VARCHAR},
</if>
<if test="frmnam != null" >
#{frmnam,jdbcType=VARCHAR},
</if>
<if test="etyinr != null" >
#{etyinr,jdbcType=CHAR},
</if>
<if test="ptyinr != null" >
#{ptyinr,jdbcType=CHAR},
</if>
</trim>
</insert>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.brilliance.mapper.RolMapper" >
<resultMap id="BaseResultMap" type="com.brilliance.entity.Rol" >
<id column="inr" property="inr" jdbcType="VARCHAR" />
<result column="rolnam" property="rolnam" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
inr, rolnam
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from rol
where inr = #{inr,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
delete from rol
where inr = #{inr,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.brilliance.entity.Rol" >
insert into rol (inr, rolnam)
values (#{inr,jdbcType=VARCHAR}, #{rolnam,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.brilliance.entity.Rol" >
insert into rol
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="inr != null" >
inr,
</if>
<if test="rolnam != null" >
rolnam,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="inr != null" >
#{inr,jdbcType=VARCHAR},
</if>
<if test="rolnam != null" >
#{rolnam,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.brilliance.entity.Rol" >
update rol
<set >
<if test="rolnam != null" >
rolnam = #{rolnam,jdbcType=VARCHAR},
</if>
</set>
where inr = #{inr,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.brilliance.entity.Rol" >
update rol
set rolnam = #{rolnam,jdbcType=VARCHAR}
where inr = #{inr,jdbcType=VARCHAR}
</update>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.brilliance.mapper.UsrMapper" >
<resultMap id="BaseResultMap" type="com.brilliance.entity.Usr" >
<id column="inr" property="inr" jdbcType="VARCHAR" />
<result column="usrnam" property="usrnam" jdbcType="VARCHAR" />
<result column="age" property="age" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List" >
inr, usrnam, age
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from usr
where inr = #{inr,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
delete from usr
where inr = #{inr,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.brilliance.entity.Usr" >
insert into usr (inr, usrnam, age
)
values (#{inr,jdbcType=VARCHAR}, #{usrnam,jdbcType=VARCHAR}, #{age,jdbcType=INTEGER}
)
</insert>
<insert id="insertSelective" parameterType="com.brilliance.entity.Usr" >
insert into usr
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="inr != null" >
inr,
</if>
<if test="usrnam != null" >
usrnam,
</if>
<if test="age != null" >
age,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="inr != null" >
#{inr,jdbcType=VARCHAR},
</if>
<if test="usrnam != null" >
#{usrnam,jdbcType=VARCHAR},
</if>
<if test="age != null" >
#{age,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.brilliance.entity.Usr" >
update usr
<set >
<if test="usrnam != null" >
usrnam = #{usrnam,jdbcType=VARCHAR},
</if>
<if test="age != null" >
age = #{age,jdbcType=INTEGER},
</if>
</set>
where inr = #{inr,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.brilliance.entity.Usr" >
update usr
set usrnam = #{usrnam,jdbcType=VARCHAR},
age = #{age,jdbcType=INTEGER}
where inr = #{inr,jdbcType=VARCHAR}
</update>
<select id="selectUserList" resultType="com.brilliance.vo.UserVO">
select usr.inr as usrInr,usr.usrnam as usrNam,usr.age as age, rol.rolnam as rolNam
from usr inner join usr_rol on usr.inr=usr_rol.usrinr
inner join rol on rol.inr=usr_rol.rolinr
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.brilliance.mapper.UsrRolMapper" >
<resultMap id="BaseResultMap" type="com.brilliance.entity.UsrRol" >
<id column="inr" property="inr" jdbcType="VARCHAR" />
<result column="usrinr" property="usrinr" jdbcType="VARCHAR" />
<result column="rolinr" property="rolinr" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
inr, usrinr, rolinr
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from usr_rol
where inr = #{inr,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
delete from usr_rol
where inr = #{inr,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.brilliance.entity.UsrRol" >
insert into usr_rol (inr, usrinr, rolinr
)
values (#{inr,jdbcType=VARCHAR}, #{usrinr,jdbcType=VARCHAR}, #{rolinr,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.brilliance.entity.UsrRol" >
insert into usr_rol
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="inr != null" >
inr,
</if>
<if test="usrinr != null" >
usrinr,
</if>
<if test="rolinr != null" >
rolinr,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="inr != null" >
#{inr,jdbcType=VARCHAR},
</if>
<if test="usrinr != null" >
#{usrinr,jdbcType=VARCHAR},
</if>
<if test="rolinr != null" >
#{rolinr,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.brilliance.entity.UsrRol" >
update usr_rol
<set >
<if test="usrinr != null" >
usrinr = #{usrinr,jdbcType=VARCHAR},
</if>
<if test="rolinr != null" >
rolinr = #{rolinr,jdbcType=VARCHAR},
</if>
</set>
where inr = #{inr,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.brilliance.entity.UsrRol" >
update usr_rol
set usrinr = #{usrinr,jdbcType=VARCHAR},
rolinr = #{rolinr,jdbcType=VARCHAR}
where inr = #{inr,jdbcType=VARCHAR}
</update>
</mapper>
\ No newline at end of file
jdbc.driverLocation=lib/mysql-connector-java-8.0.30.jar
jdbc.driverClass=com.mysql.jdbc.Driver
jdbc.connectionURL=jdbc:mysql://localhost:3306/test?serverTimezone=UTC&useUnicode=true&characterEncoding=utf8&useSSL=false
jdbc.userId=root
jdbc.password=123456
\ No newline at end of file
jdbc.driverLocation=lib/ojdbc6-11.2.0.3.jar
jdbc.driverClass=oracle.jdbc.driver.OracleDriver
jdbc.connectionURL=jdbc:oracle:thin:@114.115.138.98:9400:XE
jdbc.userId=test
jdbc.password=test
\ No newline at end of file
......@@ -4,12 +4,15 @@
"http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
<generatorConfiguration>
<classPathEntry location="E:\programFile\work\MavenRepository\com\oracle\ojdbc6\11.2.0.3\ojdbc6-11.2.0.3.jar" />
<!--导入属性配置-->
<!--
<properties resource="generator.properties"></properties>
-->
<classPathEntry location="${jdbc.driverLocation}"/>
<!--指定特定数据库的jdbc驱动jar包的位置-->
<context id="default" targetRuntime="MyBatis3">
<context id="default">
<!-- optional,旨在创建class时,对注释进行控制 -->
<commentGenerator>
......@@ -18,11 +21,10 @@
</commentGenerator>
<!--jdbc的数据库连接 -->
<jdbcConnection
driverClass="${jdbc.driverClass}"
connectionURL="${jdbc.connectionURL}"
userId="${jdbc.userId}"
password="${jdbc.password}">
<jdbcConnection driverClass="oracle.jdbc.driver.OracleDriver"
connectionURL="jdbc:oracle:thin:@114.115.138.98:9400:XE"
userId="test" password="test" >
<property name="nullCatalogMeansCurrent" value="true"/>
</jdbcConnection>
<!-- 非必需,类型处理器,在数据库类型和java类型之间的转换控制-->
......@@ -44,7 +46,7 @@
<!-- 是否对类CHAR类型的列的数据进行trim操作 -->
<property name="trimStrings" value="true"/>
<!-- 建立的Model对象是否 不可改变 即生成的Model对象不会有 setter方法,只有构造方法 -->
<property name="immutable" value="false"/>
<!-- <property name="immutable" value="false"/>-->
</javaModelGenerator>
<!--Mapper映射文件生成所在的目录 为每一个数据库的表生成对应的SqlMap文件 -->
......@@ -54,9 +56,22 @@
<javaClientGenerator targetPackage="com.brilliance.mapper" targetProject="src/main/java" type="XMLMAPPER">
<property name="enableSubPackages" value="true"/>
<!-- <property name="enableSubPackages" value="true"/>-->
</javaClientGenerator>
<table schema="test" tableName="MPI" domainObjectName="Mpi" enableCountByExample="false"
enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"
selectByExampleQueryId="false"/>
<table schema="test" tableName="MPS" domainObjectName="Mps" enableCountByExample="false"
enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"
selectByExampleQueryId="false"/>
<table schema="test" tableName="MPE" domainObjectName="Mpe" enableCountByExample="false"
enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"
selectByExampleQueryId="false"/>
</context>
<!-- <table tableName="usr" domainObjectName="Usr" enableCountByExample="false"-->
<!-- enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"-->
<!-- selectByExampleQueryId="false"/>-->
......@@ -66,5 +81,4 @@
<!-- <table tableName="usr_rol" domainObjectName="UsrRol" enableCountByExample="false"-->
<!-- enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"-->
<!-- selectByExampleQueryId="false"/>-->
</context>
</generatorConfiguration>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment