<?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.javaweb.platform.mapper.FrontUserMapper">
|
|
<resultMap type="FrontUser" id="FrontUserResult">
|
<result property="id" column="id" />
|
<result property="userName" column="user_name" />
|
<result property="userType" column="user_type" />
|
<result property="email" column="email" />
|
<result property="phone" column="phone" />
|
<result property="password" column="password" />
|
<result property="salt" column="salt" />
|
<result property="status" column="status" />
|
<result property="isDeleted" column="is_deleted" />
|
<result property="avatar" column="avatar" />
|
<result property="loginIp" column="login_ip" />
|
<result property="createTime" column="create_time" />
|
<result property="address" column="address" />
|
<result property="company" column="company" />
|
<result property="applyLicense" column="apply_license" />
|
<result property="contacts" column="contacts" />
|
<result property="companyProps" column="company_props" />
|
<result property="businessNo" column="business_no" />
|
</resultMap>
|
|
<sql id="selectFrontUserVo">
|
select id, user_name, user_type, email, phone, password, salt, status, is_deleted, avatar, login_ip, create_time, address,
|
company, apply_license,contacts,company_props,business_no from js_front_user
|
</sql>
|
|
|
<select id="checkLoginNameUnique" parameterType="FrontUser" resultType="int">
|
select count(id) from js_front_user where user_name = #{userName}
|
</select>
|
|
<select id="checkEmailUnique" parameterType="FrontUser" resultType="int">
|
select count(id) from js_front_user where email = #{email}
|
</select>
|
|
<select id="checkPhoneUnique" parameterType="FrontUser" resultType="int">
|
select count(id) from js_front_user where phone = #{phone}
|
</select>
|
|
<select id="checkBusinessNoUnique" parameterType="FrontUser" resultType="int">
|
select count(id) from js_front_user where business_no = #{businessNo}
|
</select>
|
|
|
<select id="selectByUserName" parameterType="FrontUser" resultMap="FrontUserResult">
|
<include refid="selectFrontUserVo"/>
|
where user_name = #{userName}
|
</select>
|
|
<select id="selectFrontUserList" parameterType="FrontUser" resultMap="FrontUserResult">
|
<include refid="selectFrontUserVo"/>
|
<where>
|
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
|
<if test="userType != null and userType != ''"> and user_type = #{userType}</if>
|
<if test="email != null and email != ''"> and email = #{email}</if>
|
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
|
<if test="password != null and password != ''"> and password = #{password}</if>
|
<if test="salt != null and salt != ''"> and salt = #{salt}</if>
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
<if test="isDeleted != null and isDeleted != ''"> and is_deleted = #{isDeleted}</if>
|
<if test="avatar != null and avatar != ''"> and avatar = #{avatar}</if>
|
<if test="loginIp != null and loginIp != ''"> and login_ip = #{loginIp}</if>
|
<if test="address != null and address != ''"> and address = #{address}</if>
|
<if test="company != null and company != ''"> and company = #{company}</if>
|
<if test="applyLicense != null and applyLicense != ''"> and apply_license = #{applyLicense}</if>
|
<if test="businessNo != null and businessNo != ''"> and business_no = #{businessNo}</if>
|
</where>
|
</select>
|
|
<select id="selectFrontUserByLoginName" parameterType="FrontUser" resultMap="FrontUserResult">
|
<include refid="selectFrontUserVo"/>
|
where user_name = #{userName}
|
</select>
|
|
<select id="selectFrontUserById" parameterType="Long" resultMap="FrontUserResult">
|
<include refid="selectFrontUserVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertFrontUser" parameterType="FrontUser" useGeneratedKeys="true" keyProperty="id">
|
insert into js_front_user
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="userName != null and userName != ''">user_name,</if>
|
<if test="userType != null and userType != ''">user_type,</if>
|
<if test="email != null and email != ''">email,</if>
|
<if test="phone != null and phone != ''">phone,</if>
|
<if test="password != null and password != ''">password,</if>
|
<if test="salt != null and salt != ''">salt,</if>
|
<if test="status != null and status != ''">status,</if>
|
<if test="isDeleted != null and isDeleted != ''">is_deleted,</if>
|
<if test="avatar != null and avatar != ''">avatar,</if>
|
<if test="loginIp != null and loginIp != ''">login_ip,</if>
|
<if test="createTime != null ">create_time,</if>
|
<if test="address != null and address != ''">address,</if>
|
<if test="company != null and company != ''">company,</if>
|
<if test="applyLicense != null and applyLicense != ''">apply_license,</if>
|
<if test="contacts != null and contacts != ''">contacts,</if>
|
<if test="companyProps != null and companyProps != ''">company_props,</if>
|
<if test="businessNo != null and businessNo != ''">business_no,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="userName != null and userName != ''">#{userName},</if>
|
<if test="userType != null and userType != ''">#{userType},</if>
|
<if test="email != null and email != ''">#{email},</if>
|
<if test="phone != null and phone != ''">#{phone},</if>
|
<if test="password != null and password != ''">#{password},</if>
|
<if test="salt != null and salt != ''">#{salt},</if>
|
<if test="status != null and status != ''">#{status},</if>
|
<if test="isDeleted != null and isDeleted != ''">#{isDeleted},</if>
|
<if test="avatar != null and avatar != ''">#{avatar},</if>
|
<if test="loginIp != null and loginIp != ''">#{loginIp},</if>
|
<if test="createTime != null ">#{createTime},</if>
|
<if test="address != null and address != ''">#{address},</if>
|
<if test="company != null and company != ''">#{company},</if>
|
<if test="applyLicense != null and applyLicense != ''">#{applyLicense},</if>
|
<if test="contacts != null and contacts != ''">#{contacts},</if>
|
<if test="companyProps != null and companyProps != ''">#{companyProps},</if>
|
<if test="businessNo != null and businessNo != ''">#{businessNo},</if>
|
</trim>
|
</insert>
|
|
<update id="updateFrontUser" parameterType="FrontUser">
|
update js_front_user
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="userName != null and userName != ''">user_name = #{userName},</if>
|
<if test="userType != null and userType != ''">user_type = #{userType},</if>
|
<if test="email != null and email != ''">email = #{email},</if>
|
<if test="phone != null and phone != ''">phone = #{phone},</if>
|
<if test="password != null and password != ''">password = #{password},</if>
|
<if test="salt != null and salt != ''">salt = #{salt},</if>
|
<if test="status != null and status != ''">status = #{status},</if>
|
<if test="isDeleted != null and isDeleted != ''">is_deleted = #{isDeleted},</if>
|
<if test="avatar != null and avatar != ''">avatar = #{avatar},</if>
|
<if test="loginIp != null and loginIp != ''">login_ip = #{loginIp},</if>
|
<if test="createTime != null ">create_time = #{createTime},</if>
|
<if test="address != null and address != ''">address = #{address},</if>
|
<if test="company != null and company != ''">company = #{company},</if>
|
<if test="applyLicense != null and applyLicense != ''">apply_license = #{applyLicense},</if>
|
<if test="contacts != null and contacts != ''">contacts = #{contacts},</if>
|
<if test="companyProps != null and companyProps != ''">company_props = #{companyProps},</if>
|
<if test="businessNo != null and businessNo != ''">business_no = #{businessNo},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<update id="approve" parameterType="FrontUser">
|
update js_front_user set status = '1' where id = #{id}
|
</update>
|
|
<delete id="deleteFrontUserById" parameterType="Long">
|
delete from js_front_user where id = #{id}
|
</delete>
|
|
<delete id="deleteFrontUserByIds" parameterType="String">
|
delete from js_front_user where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
|
</mapper>
|