| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- <?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.ydtech.modules.admin.dao.SysAccountMapper">
- <resultMap id="BaseResultMap" type="com.ydtech.modules.admin.model.SysAccount">
- <id column="id" jdbcType="VARCHAR" property="id"/>
- <result column="name" jdbcType="VARCHAR" property="name"/>
- <result column="dept_id" jdbcType="VARCHAR" property="deptId"/>
- <result column="order_num" jdbcType="INTEGER" property="orderNum"/>
- <result column="del_flag" jdbcType="INTEGER" property="delFlag"/>
- </resultMap>
- <sql id="Base_Column_List">
- id, name, dept_id, order_num, del_flag
- </sql>
- <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List"/>
- from sys_account
- where id = #{id,jdbcType=VARCHAR}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
- delete
- from sys_account
- where id = #{id,jdbcType=VARCHAR}
- </delete>
- <insert id="insert" parameterType="com.ydtech.modules.admin.model.SysAccount">
- insert into sys_account (id, name, dept_id,
- order_num, del_flag)
- values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{deptId,jdbcType=VARCHAR},
- #{orderNum,jdbcType=INTEGER}, #{delFlag,jdbcType=INTEGER})
- </insert>
- <insert id="insertSelective" parameterType="com.ydtech.modules.admin.model.SysAccount">
- insert into sys_account
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
- id,
- </if>
- <if test="name != null">
- name,
- </if>
- <if test="deptId != null">
- dept_id,
- </if>
- <if test="orderNum != null">
- order_num,
- </if>
- <if test="delFlag != null">
- del_flag,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">
- #{id,jdbcType=VARCHAR},
- </if>
- <if test="name != null">
- #{name,jdbcType=VARCHAR},
- </if>
- <if test="deptId != null">
- #{deptId,jdbcType=VARCHAR},
- </if>
- <if test="orderNum != null">
- #{orderNum,jdbcType=INTEGER},
- </if>
- <if test="delFlag != null">
- #{delFlag,jdbcType=INTEGER},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.ydtech.modules.admin.model.SysAccount">
- update sys_account
- <set>
- <if test="name != null">
- name = #{name,jdbcType=VARCHAR},
- </if>
- <if test="deptId != null">
- dept_id = #{deptId,jdbcType=VARCHAR},
- </if>
- <if test="orderNum != null">
- order_num = #{orderNum,jdbcType=INTEGER},
- </if>
- <if test="delFlag != null">
- del_flag = #{delFlag,jdbcType=INTEGER},
- </if>
- </set>
- where id = #{id,jdbcType=VARCHAR}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.ydtech.modules.admin.model.SysAccount">
- update sys_account
- set name = #{name,jdbcType=VARCHAR},
- dept_id = #{deptId,jdbcType=VARCHAR},
- order_num = #{orderNum,jdbcType=INTEGER},
- del_flag = #{delFlag,jdbcType=INTEGER}
- where id = #{id,jdbcType=VARCHAR}
- </update>
- <select id="findByDeptId" resultType="com.ydtech.modules.admin.model.SysAccount">
- select
- <include refid="Base_Column_List"/>
- from sys_account
- where dept_id = #{deptId,jdbcType=VARCHAR} and del_flag=0 order by order_num
- </select>
- </mapper>
|