123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-
- <mapper namespace="com.bosshand.virgo.core.dao.MgrUserDao">
- <resultMap type="com.bosshand.virgo.core.model.MgrUser" id="MgrUserResult" >
- <id column="id" property="id"/>
- <result column="name" property="name"/>
- <result column="sex" property="sex"/>
- <result column="phone" property="phone"/>
- <result column="pwd" property="pwd"/>
- <result column="email" property="email"/>
- <result column="portrait" property="portrait"/>
- <result column="create_time" property="createTime"/>
- <result column="rsonal_signature" property="rsonalSignature"/>
- <result column="id_card" property="idCard"/>
- <result column="practice_certificate" property="practiceCertificate"/>
- <result column="practice_seal" property="practiceSeal"/>
- <result column="status" property="status"/>
- <result column="lastOrganizationId" property="lastOrganizationId"/>
- <result column="lastProjectId" property="lastProjectId"/>
- </resultMap>
- <select id="getById" resultMap="MgrUserResult">
- select * from mgr_user where id = #{id} limit 1
- </select>
- <select id="getByPhone" resultMap="MgrUserResult">
- select * from mgr_user where phone = #{phone} limit 1
- </select>
- <select id="getUserByPhone" resultType="com.bosshand.virgo.core.model.MgrUser">
- SELECT * FROM mgr_user where phone=#{phone}
- </select>
- <select id="getIds" parameterType="list" resultType="com.bosshand.virgo.core.model.MgrUser">
- select * from mgr_user
- <trim>
- <if test="list.size > 0">
- where id in (
- <foreach collection="list" item="item" index="index" separator=",">
- #{item}
- </foreach>
- )
- </if>
- <if test="list.size = 0">
- where 1=0
- </if>
- </trim>
- </select>
- <insert id="insert" parameterType="com.bosshand.virgo.core.model.MgrUser" useGeneratedKeys="true" keyProperty="id">
- INSERT into mgr_user(name, sex, phone, email, portrait, create_time, rsonal_signature, id_card, practice_certificate, practice_seal)
- values(#{name}, #{sex}, #{phone}, #{email}, #{portrait}, #{createTime}, #{rsonalSignature}, #{idCard}, #{practiceCertificate}, #{practiceSeal})
- </insert>
- <delete id="delete">
- DELETE from mgr_user where id = #{id}
- </delete>
- <update id="updateLastOrganizationId" parameterType="com.bosshand.virgo.core.model.MgrUser">
- UPDATE mgr_user set lastOrganizationId = #{lastOrganizationId} WHERE id=#{id}
- </update>
- <update id="updateLastProjectId" parameterType="com.bosshand.virgo.core.model.MgrUser">
- UPDATE mgr_user set lastProjectId = #{lastProjectId} WHERE id=#{id}
- </update>
- <update id="updateLastIdentityId" parameterType="com.bosshand.virgo.core.model.MgrUser">
- UPDATE mgr_user set lastIdentityId = #{lastIdentityId} WHERE id=#{id}
- </update>
- <update id="update" parameterType="com.bosshand.virgo.core.model.MgrUser">
- UPDATE mgr_user
- <trim prefix="set" suffixOverrides=",">
- <if test="id!=0">id=#{id},</if>
- <if test="name!=null">name=#{name},</if>
- <if test="sex!=null">sex=#{sex},</if>
- <if test="phone!=null">phone=#{phone},</if>
- <if test="email!=null">email=#{email},</if>
- <if test="portrait!=null">portrait=#{portrait},</if>
- <if test="face!=null">face=#{face},</if>
- <if test="faceStatus!=0">faceStatus=#{faceStatus},</if>
- <if test="lastOrganizationId!=0">lastOrganizationId=#{lastOrganizationId},</if>
- <if test="lastProjectId!=0">lastProjectId=#{lastProjectId},</if>
- <if test="rsonalSignature!=null">rsonal_signature=#{rsonalSignature},</if>
- <if test="idCard!=null">id_card=#{idCard},</if>
- <if test="practiceCertificate!=null">practice_certificate=#{practiceCertificate},</if>
- <if test="practiceSeal!=null">practice_seal=#{practiceSeal},</if>
- </trim>
- WHERE id=#{id}
- </update>
- <update id="updatePhone" parameterType="com.bosshand.virgo.core.model.MgrUser">
- UPDATE mgr_user SET phone = #{phone} where id =#{id}
- </update>
- <update id="updatePwd" parameterType="com.bosshand.virgo.core.model.MgrUser">
- UPDATE mgr_user SET pwd = #{pwd} where id =#{id}
- </update>
- <update id="banUser" parameterType="com.bosshand.virgo.core.model.MgrUser">
- UPDATE mgr_user set status = #{status} WHERE id=#{id}
- </update>
- <update id="checkFace" parameterType="com.bosshand.virgo.core.model.MgrUser">
- UPDATE mgr_user SET faceStatus = 1 where id =#{id}
- </update>
- </mapper>
|