123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324 |
- <?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.ygj.yuemum.dao.admin.JlAdminUserDao" >
- <resultMap id="BaseResultMap" type="com.ygj.yuemum.domain.admin.JlAdminUser" >
- <id column="id" property="id" jdbcType="INTEGER" />
- <result column="username" property="username" jdbcType="VARCHAR" />
- <result column="email" property="email" jdbcType="VARCHAR" />
- <result column="name" property="name" jdbcType="VARCHAR" />
- <result column="password" property="password" jdbcType="VARCHAR" />
- <result column="create_time" property="create_time" jdbcType="VARCHAR" />
- <result column="last_login_time" property="last_login_time" jdbcType="DATE" />
- <result column="last_login_ip" property="last_login_ip" jdbcType="VARCHAR" />
- <result column="role" property="role" jdbcType="INTEGER" />
- <result column="status" property="status" jdbcType="INTEGER" />
- <result column="org" property="org" jdbcType="INTEGER" />
- <result column="last_login_location" property="last_login_location" jdbcType="VARCHAR" />
- <result column="remark" property="remark" jdbcType="VARCHAR" />
- <result column="phone" property="phone" jdbcType="VARCHAR" />
- <result column="province" property="province" jdbcType="VARCHAR" />
- <result column="city" property="city" jdbcType="VARCHAR" />
- <result column="district" property="district" jdbcType="VARCHAR" />
- <result column="province" property="province" jdbcType="VARCHAR" />
- <result column="enabled" property="enabled" jdbcType="INTEGER" />
- <result column="update_time" property="update_time" jdbcType="DATE" />
- </resultMap>
- <sql id="Base_Column_List" >
- id,username,name,email,password,create_time,last_login_time,last_login_ip,role,status,org,last_login_location,remark,phone,province,city,district,enabled,update_time
- </sql>
- <select id="checkUsername" resultType="java.lang.Integer" parameterType="java.lang.String">
- select
- count(1)
- from jl_admin_user
- where username = #{username,jdbcType=VARCHAR}
- </select>
- <select id="getConsultants" resultMap="BaseResultMap" >
- select
- *
- from jl_admin_user
- where role = 3
- </select>
- <select id="getRolePermissionCount" resultType="java.lang.Integer" parameterType="java.lang.Integer">
- select
- count(1)
- from jl_admin_user
- where role = #{roleid,jdbcType=VARCHAR}
- </select>
- <!-- 得到所有的用户信息 -->
- <select id="getAll" resultMap="BaseResultMap" >
- select
- <include refid="Base_Column_List" />
- from jl_admin_user
- </select>
- <select id="queryAdminUsers" resultMap="BaseResultMap" parameterType="com.ygj.yuemum.domain.admin.JlAdminUser">
- select
- id,
- username,
- name,
- role,
- status,
- city,
- IFNULL(fgetbranches_name(city),'ALL') cityname,
- fgetrole_name(role) rolename
- from jl_admin_user
- where username != 'admin'
- <if test="username != null and username !=''">
- and username like "%"#{username,jdbcType=VARCHAR}"%"
- </if>
- <if test="name != null and name !=''">
- and name like "%"#{name,jdbcType=VARCHAR}"%"
- </if>
- <if test="role != null and role !=''">
- and role = #{role,jdbcType=INTEGER}
- </if>
- <if test="status != null ">
- and status = #{status,jdbcType=INTEGER}
- </if>
- <if test="city != null and city !=''">
- and city = #{city,jdbcType=VARCHAR}
- </if>
- </select>
- <select id="logIN" resultType="java.lang.Integer" parameterType="com.ygj.yuemum.domain.admin.JlAdminUser">
- select
- count(1)
- from jl_admin_user
- where 1=1
- <if test="username != null" >
- and username = #{username,jdbcType=VARCHAR}
- </if>
- <if test="password != null" >
- and password = #{password,jdbcType=VARCHAR}
- </if>
- </select>
- <select id="getPassword" resultType="java.lang.String" parameterType="java.lang.String">
- select
- password
- from jl_admin_user
- where
- username = #{username,jdbcType=VARCHAR}
- </select>
- <select id="getStatus" resultType="java.lang.String" parameterType="java.lang.String">
- select
- status
- from jl_admin_user
- where
- username = #{username,jdbcType=VARCHAR}
- </select>
- <select id="getRole" resultType="java.lang.String" parameterType="java.lang.String">
- select
- role
- from jl_admin_user
- where
- username = #{username,jdbcType=VARCHAR}
- </select>
- <select id="getUserMkt" resultMap="BaseResultMap" parameterType="java.lang.String">
- select
- *
- from jl_admin_user
- where
- username = #{username,jdbcType=VARCHAR}
- </select>
- <!-- 根据id查找某个用户信息 -->
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
- select
- *
- from jl_admin_user
- where id = #{id,jdbcType=INTEGER}
- </select>
- <!-- 根据id删除某个用户信息 -->
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
- delete from jl_admin_user
- where id = #{id,jdbcType=INTEGER}
- </delete>
- <!-- 插入一条用户信息 -->
- <insert id="insertSelective" parameterType="com.ygj.yuemum.domain.admin.JlAdminUser" >
- insert into jl_admin_user
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="username != null" >
- username,
- </if>
- <if test="email != null" >
- email,
- </if>
- <if test="name != null" >
- name,
- </if>
- <if test="password != null" >
- password,
- </if>
- <if test="create_time != null" >
- create_time,
- </if>
- <if test="last_login_time != null" >
- last_login_time,
- </if>
- <if test="last_login_ip != null" >
- last_login_ip,
- </if>
- <if test="role != null" >
- role,
- </if>
- <if test="status != null" >
- status,
- </if>
- <if test="org != null" >
- org,
- </if>
- <if test="last_login_location != null" >
- last_login_location,
- </if>
- <if test="remark != null" >
- remark,
- </if>
- <if test="phone != null" >
- phone,
- </if>
- <if test="province != null" >
- province,
- </if>
- <if test="city != null" >
- city,
- </if>
- <if test="district != null" >
- district,
- </if>
- <if test="enabled != null" >
- enabled,
- </if>
- <if test="update_time != null" >
- update_time
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="username != null" >
- #{username,jdbcType=VARCHAR},
- </if>
- <if test="email != null" >
- #{email,jdbcType=VARCHAR},
- </if>
- <if test="name != null" >
- #{name,jdbcType=VARCHAR},
- </if>
- <if test="password != null" >
- #{password,jdbcType=VARCHAR},
- </if>
- <if test="create_time != null" >
- #{create_time,jdbcType=VARCHAR},
- </if>
- <if test="last_login_time != null" >
- #{last_login_time,jdbcType=DATETIME},
- </if>
- <if test="last_login_ip != null" >
- #{last_login_ip,jdbcType=VARCHAR},
- </if>
- <if test="role != null" >
- #{role,jdbcType=INTEGER},
- </if>
- <if test="status != null" >
- #{status,jdbcType=INTEGER},
- </if>
- <if test="org != null" >
- #{org,jdbcType=INTEGER},
- </if>
- <if test="last_login_location != null" >
- #{last_login_location,jdbcType=VARCHAR},
- </if>
- <if test="remark != null" >
- #{remark,jdbcType=VARCHAR},
- </if>
- <if test="phone != null" >
- #{phone,jdbcType=VARCHAR},
- </if>
- <if test="province != null" >
- #{province,jdbcType=VARCHAR},
- </if>
- <if test="city != null" >
- #{city,jdbcType=VARCHAR},
- </if>
- <if test="district != null" >
- #{district,jdbcType=VARCHAR},
- </if>
- <if test="enabled != null" >
- #{enabled,jdbcType=INTEGER},
- </if>
- <if test="update_time != null" >
- #{update_time,jdbcType=DATE}
- </if>
- </trim>
- </insert>
- <!-- 根据id更新一条用户信息 -->
- <update id="updateByPrimaryKeySelective" parameterType="com.ygj.yuemum.domain.admin.JlAdminUser" >
- update jl_admin_user
- <set >
- <if test="username != null" >
- username = #{username,jdbcType=VARCHAR},
- </if>
- <if test="name != null" >
- name = #{name,jdbcType=VARCHAR},
- </if>
- <if test="email != null" >
- email = #{email,jdbcType=VARCHAR},
- </if>
- <if test="password != null" >
- password = #{password,jdbcType=VARCHAR},
- </if>
- <if test="create_time != null" >
- create_time = #{create_time,jdbcType=DATE},
- </if>
- <if test="last_login_time != null" >
- password = #{last_login_time,jdbcType=DATE},
- </if>
- <if test="last_login_ip != null" >
- last_login_ip = #{last_login_ip,jdbcType=VARCHAR},
- </if>
- <if test="role != null" >
- role = #{role,jdbcType=INTEGER},
- </if>
- <if test="status != null" >
- status = #{status,jdbcType=INTEGER},
- </if>
- <if test="org != null" >
- org = #{org,jdbcType=INTEGER},
- </if>
- <if test="last_login_location != null" >
- last_login_location = #{last_login_location,jdbcType=VARCHAR},
- </if>
- <if test="remark != null" >
- remark = #{remark,jdbcType=VARCHAR},
- </if>
- <if test="phone != null" >
- phone = #{phone,jdbcType=VARCHAR},
- </if>
- <if test="province != null" >
- province = #{province,jdbcType=VARCHAR},
- </if>
- <if test="city != null" >
- city = #{city,jdbcType=VARCHAR},
- </if>
- <if test="district != null" >
- district = #{district,jdbcType=VARCHAR},
- </if>
- <if test="enabled != null" >
- enabled = #{enabled,jdbcType=INTEGER},
- </if>
- <if test="update_time != null" >
- update_time = #{update_time,jdbcType=DATE}
- </if>
- </set>
- where id = #{id,jdbcType=INTEGER}
- </update>
- </mapper>
|