123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- <?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.mofangchuxing.aska.dao.mapper.AskaAccountsMapper">
- <resultMap id="BaseResultMap" type="com.mofangchuxing.aska.dao.domain.AskaAccounts">
- <id property="id" column="id" jdbcType="INTEGER"/>
- <result property="username" column="username" jdbcType="CHAR"/>
- <result property="name" column="name" jdbcType="CHAR"/>
- <result property="phone" column="phone" jdbcType="CHAR"/>
- <result property="pass" column="pass" jdbcType="CHAR"/>
- <result property="role" column="role" jdbcType="VARCHAR"/>
- <result property="status" column="status" jdbcType="CHAR"/>
- </resultMap>
- <sql id="Base_Column_List">
- id,username,name,
- phone,pass,role,
- status
- </sql>
- <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from aska_accounts
- where id = #{id,jdbcType=INTEGER}
- </select>
- <select id="selectByUsername" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from aska_accounts
- where username = #{username} limit 1
- </select>
- <select id="selectByRole" resultType="com.mofangchuxing.aska.dao.domain.AskaAccounts">
- select
- <include refid="Base_Column_List" />
- from aska_accounts
- where 1=1
- <if test="role != null and role != ''">
- and role = #{role}
- </if>
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
- delete from aska_accounts
- where id = #{id,jdbcType=INTEGER}
- </delete>
- <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.mofangchuxing.aska.dao.domain.AskaAccounts" useGeneratedKeys="true">
- insert into aska_accounts
- ( id,username,name
- ,phone,pass,role
- ,status)
- values (#{id,jdbcType=INTEGER},#{username,jdbcType=CHAR},#{name,jdbcType=CHAR}
- ,#{phone,jdbcType=CHAR},#{pass,jdbcType=CHAR},#{role,jdbcType=VARCHAR}
- ,#{status,jdbcType=CHAR})
- </insert>
- <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.mofangchuxing.aska.dao.domain.AskaAccounts" useGeneratedKeys="true">
- insert into aska_accounts
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">id,</if>
- <if test="username != null">username,</if>
- <if test="name != null">name,</if>
- <if test="phone != null">phone,</if>
- <if test="pass != null">pass,</if>
- <if test="role != null">role,</if>
- <if test="status != null">status,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">#{id,jdbcType=INTEGER},</if>
- <if test="username != null">#{username,jdbcType=CHAR},</if>
- <if test="name != null">#{name,jdbcType=CHAR},</if>
- <if test="phone != null">#{phone,jdbcType=CHAR},</if>
- <if test="pass != null">#{pass,jdbcType=CHAR},</if>
- <if test="role != null">#{role,jdbcType=VARCHAR},</if>
- <if test="status != null">#{status,jdbcType=CHAR},</if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.mofangchuxing.aska.dao.domain.AskaAccounts">
- update aska_accounts
- <set>
- <if test="username != null">
- username = #{username,jdbcType=CHAR},
- </if>
- <if test="name != null">
- name = #{name,jdbcType=CHAR},
- </if>
- <if test="phone != null">
- phone = #{phone,jdbcType=CHAR},
- </if>
- <if test="pass != null">
- pass = #{pass,jdbcType=CHAR},
- </if>
- <if test="role != null">
- role = #{role,jdbcType=VARCHAR},
- </if>
- <if test="status != null">
- status = #{status,jdbcType=CHAR},
- </if>
- </set>
- where id = #{id,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.mofangchuxing.aska.dao.domain.AskaAccounts">
- update aska_accounts
- set
- username = #{username,jdbcType=CHAR},
- name = #{name,jdbcType=CHAR},
- phone = #{phone,jdbcType=CHAR},
- pass = #{pass,jdbcType=CHAR},
- role = #{role,jdbcType=VARCHAR},
- status = #{status,jdbcType=CHAR}
- where id = #{id,jdbcType=INTEGER}
- </update>
- </mapper>
|