1.生成表对应实体类
parent
d1d10bbd8f
commit
2ffcc5103a
@ -0,0 +1,19 @@
|
||||
package com.glxp.api.dao.basic;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.glxp.api.entity.basic.BasicUdirelTypeEntity;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface BasicUdirelTypeDao extends BaseMapper<BasicUdirelTypeEntity> {
|
||||
int updateBatch(List<BasicUdirelTypeEntity> list);
|
||||
|
||||
int updateBatchSelective(List<BasicUdirelTypeEntity> list);
|
||||
|
||||
int batchInsert(@Param("list") List<BasicUdirelTypeEntity> list);
|
||||
|
||||
int insertOrUpdate(BasicUdirelTypeEntity record);
|
||||
|
||||
int insertOrUpdateSelective(BasicUdirelTypeEntity record);
|
||||
}
|
@ -0,0 +1,67 @@
|
||||
package com.glxp.api.entity.basic;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 耗材字典菜单表
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "basic_udirel_type")
|
||||
public class BasicUdirelTypeEntity {
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@TableField(value = "pId")
|
||||
private Integer pId;
|
||||
|
||||
@TableField(value = "`name`")
|
||||
private String name;
|
||||
|
||||
@TableField(value = "remark")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(value = "createTime")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 最後更新時間
|
||||
*/
|
||||
@TableField(value = "updateTime")
|
||||
private String updateTime;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(value = "`createUser`")
|
||||
private String createUser;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@TableField(value = "updateUser")
|
||||
private String updateUser;
|
||||
|
||||
public static final String COL_ID = "id";
|
||||
|
||||
public static final String COL_PID = "pId";
|
||||
|
||||
public static final String COL_NAME = "name";
|
||||
|
||||
public static final String COL_REMARK = "remark";
|
||||
|
||||
public static final String COL_CREATETIME = "createTime";
|
||||
|
||||
public static final String COL_UPDATETIME = "updateTime";
|
||||
|
||||
public static final String COL_CREATEUSER = "createUser";
|
||||
|
||||
public static final String COL_UPDATEUSER = "updateUser";
|
||||
}
|
@ -0,0 +1,261 @@
|
||||
<?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.glxp.api.dao.basic.BasicUdirelTypeDao">
|
||||
<resultMap id="BaseResultMap" type="com.glxp.api.entity.basic.BasicUdirelTypeEntity">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table basic_udirel_type-->
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="pId" jdbcType="INTEGER" property="pId" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||
<result column="createTime" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="updateTime" jdbcType="VARCHAR" property="updateTime" />
|
||||
<result column="createUser" jdbcType="VARCHAR" property="createUser" />
|
||||
<result column="updateUser" jdbcType="VARCHAR" property="updateUser" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, pId, `name`, remark, createTime, updateTime, `createUser`, updateUser
|
||||
</sql>
|
||||
<update id="updateBatch" parameterType="java.util.List">
|
||||
<!--@mbg.generated-->
|
||||
update basic_udirel_type
|
||||
<trim prefix="set" suffixOverrides=",">
|
||||
<trim prefix="pId = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.pId,jdbcType=INTEGER}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="`name` = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.name,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="remark = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.remark,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="createTime = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="updateTime = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="`createUser` = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.createUser,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="updateUser = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.updateUser,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</trim>
|
||||
</trim>
|
||||
where id in
|
||||
<foreach close=")" collection="list" item="item" open="(" separator=", ">
|
||||
#{item.id,jdbcType=INTEGER}
|
||||
</foreach>
|
||||
</update>
|
||||
<update id="updateBatchSelective" parameterType="java.util.List">
|
||||
<!--@mbg.generated-->
|
||||
update basic_udirel_type
|
||||
<trim prefix="set" suffixOverrides=",">
|
||||
<trim prefix="pId = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
<if test="item.pId != null">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.pId,jdbcType=INTEGER}
|
||||
</if>
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="`name` = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
<if test="item.name != null">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.name,jdbcType=VARCHAR}
|
||||
</if>
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="remark = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
<if test="item.remark != null">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.remark,jdbcType=VARCHAR}
|
||||
</if>
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="createTime = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
<if test="item.createTime != null">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="updateTime = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
<if test="item.updateTime != null">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=VARCHAR}
|
||||
</if>
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="`createUser` = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
<if test="item.createUser != null">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.createUser,jdbcType=VARCHAR}
|
||||
</if>
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="updateUser = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
<if test="item.updateUser != null">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.updateUser,jdbcType=VARCHAR}
|
||||
</if>
|
||||
</foreach>
|
||||
</trim>
|
||||
</trim>
|
||||
where id in
|
||||
<foreach close=")" collection="list" item="item" open="(" separator=", ">
|
||||
#{item.id,jdbcType=INTEGER}
|
||||
</foreach>
|
||||
</update>
|
||||
<insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
|
||||
<!--@mbg.generated-->
|
||||
insert into basic_udirel_type
|
||||
(pId, `name`, remark, createTime, updateTime, `createUser`, updateUser)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.pId,jdbcType=INTEGER}, #{item.name,jdbcType=VARCHAR}, #{item.remark,jdbcType=VARCHAR},
|
||||
#{item.createTime,jdbcType=TIMESTAMP}, #{item.updateTime,jdbcType=VARCHAR}, #{item.createUser,jdbcType=VARCHAR},
|
||||
#{item.updateUser,jdbcType=VARCHAR})
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="insertOrUpdate" keyColumn="id" keyProperty="id" parameterType="com.glxp.api.entity.basic.BasicUdirelTypeEntity" useGeneratedKeys="true">
|
||||
<!--@mbg.generated-->
|
||||
insert into basic_udirel_type
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
pId,
|
||||
`name`,
|
||||
remark,
|
||||
createTime,
|
||||
updateTime,
|
||||
`createUser`,
|
||||
updateUser,
|
||||
</trim>
|
||||
values
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
#{pId,jdbcType=INTEGER},
|
||||
#{name,jdbcType=VARCHAR},
|
||||
#{remark,jdbcType=VARCHAR},
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
#{updateTime,jdbcType=VARCHAR},
|
||||
#{createUser,jdbcType=VARCHAR},
|
||||
#{updateUser,jdbcType=VARCHAR},
|
||||
</trim>
|
||||
on duplicate key update
|
||||
<trim suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id = #{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
pId = #{pId,jdbcType=INTEGER},
|
||||
`name` = #{name,jdbcType=VARCHAR},
|
||||
remark = #{remark,jdbcType=VARCHAR},
|
||||
createTime = #{createTime,jdbcType=TIMESTAMP},
|
||||
updateTime = #{updateTime,jdbcType=VARCHAR},
|
||||
`createUser` = #{createUser,jdbcType=VARCHAR},
|
||||
updateUser = #{updateUser,jdbcType=VARCHAR},
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="insertOrUpdateSelective" keyColumn="id" keyProperty="id" parameterType="com.glxp.api.entity.basic.BasicUdirelTypeEntity" useGeneratedKeys="true">
|
||||
<!--@mbg.generated-->
|
||||
insert into basic_udirel_type
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="pId != null">
|
||||
pId,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
`name`,
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
remark,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
createTime,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
updateTime,
|
||||
</if>
|
||||
<if test="createUser != null">
|
||||
`createUser`,
|
||||
</if>
|
||||
<if test="updateUser != null">
|
||||
updateUser,
|
||||
</if>
|
||||
</trim>
|
||||
values
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="pId != null">
|
||||
#{pId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
#{remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createUser != null">
|
||||
#{createUser,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updateUser != null">
|
||||
#{updateUser,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
on duplicate key update
|
||||
<trim suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id = #{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="pId != null">
|
||||
pId = #{pId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
`name` = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
remark = #{remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
createTime = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
updateTime = #{updateTime,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createUser != null">
|
||||
`createUser` = #{createUser,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updateUser != null">
|
||||
updateUser = #{updateUser,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
</mapper>
|
Loading…
Reference in New Issue