mappers.UserEntityMapper.xml Maven / Gradle / Ivy
<?xml version="1.0" encoding="UTF-8"?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="org.apache.inlong.manager.dao.mapper.UserEntityMapper"> <resultMap id="BaseResultMap" type="org.apache.inlong.manager.dao.entity.UserEntity"> <id column="id" jdbcType="INTEGER" property="id"/> <result column="name" jdbcType="VARCHAR" property="name"/> <result column="password" jdbcType="VARCHAR" property="password"/> <result column="account_type" jdbcType="INTEGER" property="accountType"/> <result column="due_date" jdbcType="TIMESTAMP" property="dueDate"/> <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> <result column="create_by" jdbcType="VARCHAR" property="createBy"/> <result column="update_by" jdbcType="VARCHAR" property="updateBy"/> </resultMap> <sql id="Example_Where_Clause"> <where> <foreach collection="oredCriteria" item="criteria" separator="or"> <if test="criteria.valid"> <trim prefix="(" prefixOverrides="and" suffix=")"> <foreach collection="criteria.criteria" item="criterion"> <choose> <when test="criterion.noValue"> and ${criterion.condition} </when> <when test="criterion.singleValue"> and ${criterion.condition} #{criterion.value} </when> <when test="criterion.betweenValue"> and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} </when> <when test="criterion.listValue"> and ${criterion.condition} <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> #{listItem} </foreach> </when> </choose> </foreach> </trim> </if> </foreach> </where> </sql> <sql id="Base_Column_List"> id, name, password, account_type, due_date, create_time, update_time, create_by, update_by </sql> <select id="selectByExample" parameterType="org.apache.inlong.manager.dao.entity.UserEntityExample" resultMap="BaseResultMap"> select <if test="distinct"> distinct </if> <include refid="Base_Column_List"/> from user <if test="_parameter != null"> <include refid="Example_Where_Clause"/> </if> <if test="orderByClause != null"> order by ${orderByClause} </if> </select> <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> select <include refid="Base_Column_List"/> from user where id = #{id,jdbcType=INTEGER} </select> <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> delete from user where id = #{id,jdbcType=INTEGER} </delete> <insert id="insert" parameterType="org.apache.inlong.manager.dao.entity.UserEntity"> insert into user (id, name, password, account_type, due_date, create_time, update_time, create_by, update_by) values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, #{accountType,jdbcType=INTEGER}, #{dueDate,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{createBy,jdbcType=VARCHAR}, #{updateBy,jdbcType=VARCHAR}) </insert> <insert id="insertSelective" parameterType="org.apache.inlong.manager.dao.entity.UserEntity"> insert into user <trim prefix="(" suffix=")" suffixOverrides=","> <if test="id != null"> id, </if> <if test="name != null"> name, </if> <if test="password != null"> password, </if> <if test="accountType != null"> account_type, </if> <if test="dueDate != null"> due_date, </if> <if test="createTime != null"> create_time, </if> <if test="updateTime != null"> update_time, </if> <if test="createBy != null"> create_by, </if> <if test="updateBy != null"> update_by, </if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="id != null"> #{id,jdbcType=INTEGER}, </if> <if test="name != null"> #{name,jdbcType=VARCHAR}, </if> <if test="password != null"> #{password,jdbcType=VARCHAR}, </if> <if test="accountType != null"> #{accountType,jdbcType=INTEGER}, </if> <if test="dueDate != null"> #{dueDate,jdbcType=TIMESTAMP}, </if> <if test="createTime != null"> #{createTime,jdbcType=TIMESTAMP}, </if> <if test="updateTime != null"> #{updateTime,jdbcType=TIMESTAMP}, </if> <if test="createBy != null"> #{createBy,jdbcType=VARCHAR}, </if> <if test="updateBy != null"> #{updateBy,jdbcType=VARCHAR}, </if> </trim> </insert> <select id="countByExample" parameterType="org.apache.inlong.manager.dao.entity.UserEntityExample" resultType="java.lang.Long"> select count(*) from user <if test="_parameter != null"> <include refid="Example_Where_Clause"/> </if> </select> <update id="updateByPrimaryKeySelective" parameterType="org.apache.inlong.manager.dao.entity.UserEntity"> update user <set> <if test="name != null"> name = #{name,jdbcType=VARCHAR}, </if> <if test="password != null"> password = #{password,jdbcType=VARCHAR}, </if> <if test="accountType != null"> account_type = #{accountType,jdbcType=INTEGER}, </if> <if test="dueDate != null"> due_date = #{dueDate,jdbcType=TIMESTAMP}, </if> <if test="createTime != null"> create_time = #{createTime,jdbcType=TIMESTAMP}, </if> <if test="updateTime != null"> update_time = #{updateTime,jdbcType=TIMESTAMP}, </if> <if test="createBy != null"> create_by = #{createBy,jdbcType=VARCHAR}, </if> <if test="updateBy != null"> update_by = #{updateBy,jdbcType=VARCHAR}, </if> </set> where id = #{id,jdbcType=INTEGER} </update> <update id="updateByPrimaryKey" parameterType="org.apache.inlong.manager.dao.entity.UserEntity"> update user set name = #{name,jdbcType=VARCHAR}, password = #{password,jdbcType=VARCHAR}, account_type = #{accountType,jdbcType=INTEGER}, due_date = #{dueDate,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP}, update_time = #{updateTime,jdbcType=TIMESTAMP}, create_by = #{createBy,jdbcType=VARCHAR}, update_by = #{updateBy,jdbcType=VARCHAR} where id = #{id,jdbcType=INTEGER} </update> </mapper>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy