| 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.goafanti.common.dao.UserMapper">
- <resultMap id="BaseResultMap" type="com.goafanti.common.model.User">
- <id column="id" jdbcType="VARCHAR" property="id" />
- <result column="mobile" jdbcType="VARCHAR" property="mobile" />
- <result column="password" jdbcType="VARCHAR" property="password" />
- <result column="nickname" jdbcType="VARCHAR" property="nickname" />
- <result column="email" jdbcType="VARCHAR" property="email" />
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
- <result column="number" jdbcType="BIGINT" property="number" />
- <result column="lvl" jdbcType="INTEGER" property="lvl" />
- <result column="type" jdbcType="INTEGER" property="type" />
- <result column="aid" jdbcType="VARCHAR" property="aid" />
- </resultMap>
-
- <resultMap type="com.goafanti.user.bo.UserPageHomeBo" id="UserPageHomeBo">
- <id column="id" jdbcType="VARCHAR" property="id" />
- <result column="uid" jdbcType="VARCHAR" property="uid"/>
- <result column="lvl" jdbcType="INTEGER" property="lvl"/>
- <result column="nickname" jdbcType="VARCHAR" property="nickname"/>
- <result column="email" jdbcType="VARCHAR" property="email"/>
- <result column="number" jdbcType="INTEGER" property="number"/>
- <result column="type" jdbcType="INTEGER" property="type"/>
- <result column="person_portrait_url" jdbcType="VARCHAR" property="personPortraitUrl"/>
- </resultMap>
-
- <resultMap type="com.goafanti.user.bo.UserDownLoadBo" id="UserDownLoadBo">
- <id column="id" jdbcType="VARCHAR" property="id" />
- <result column="diploma_url" jdbcType="VARCHAR" property="diplomaUrl"/>
- <result column="degree_diploma_url" jdbcType="VARCHAR" property="degreeDiplomaUrl"/>
- <result column="professional_certificate_url" jdbcType="VARCHAR" property="professionalCertificateUrl"/>
- <result column="qualification_certificate_url" jdbcType="VARCHAR" property="qualificationCertificateUrl"/>
- <result column="positive_id_url" jdbcType="VARCHAR" property="positiveIdUrl"/>
- <result column="opposite_id_url" jdbcType="VARCHAR" property="oppositeIdUrl"/>
- </resultMap>
-
-
- <sql id="Base_Column_List">
- id, mobile, password, nickname, email, create_time, number, lvl, type, aid
- </sql>
- <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from user
- where id = #{id,jdbcType=VARCHAR}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
- delete from user
- where id = #{id,jdbcType=VARCHAR}
- </delete>
- <insert id="insert" parameterType="com.goafanti.common.model.User">
- insert into user (id, mobile, password,
- nickname, email, create_time,
- number, lvl, type, aid)
- values (#{id,jdbcType=VARCHAR}, #{mobile,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
- #{nickname,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
- #{number,jdbcType=BIGINT}, #{lvl,jdbcType=INTEGER},#{type,jdbcType=INTEGER}, #{aid,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.goafanti.common.model.User">
- insert into user
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
- id,
- </if>
- <if test="mobile != null">
- mobile,
- </if>
- <if test="password != null">
- password,
- </if>
- <if test="nickname != null">
- nickname,
- </if>
- <if test="email != null">
- email,
- </if>
- <if test="createTime != null">
- create_time,
- </if>
- <if test="number != null">
- number,
- </if>
- <if test="lvl != null">
- lvl,
- </if>
- <if test="type != null">
- type,
- </if>
- <if test="aid != null">
- aid,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">
- #{id,jdbcType=VARCHAR},
- </if>
- <if test="mobile != null">
- #{mobile,jdbcType=VARCHAR},
- </if>
- <if test="password != null">
- #{password,jdbcType=VARCHAR},
- </if>
- <if test="nickname != null">
- #{nickname,jdbcType=VARCHAR},
- </if>
- <if test="email != null">
- #{email,jdbcType=VARCHAR},
- </if>
- <if test="createTime != null">
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="number != null">
- #{number,jdbcType=BIGINT},
- </if>
- <if test="lvl != null">
- #{lvl,jdbcType=BIGINT},
- </if>
- <if test="type != null">
- #{type,jdbcType=INTEGER},
- </if>
- <if test="aid != null">
- #{aid,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.User">
- update user
- <set>
- <if test="mobile != null">
- mobile = #{mobile,jdbcType=VARCHAR},
- </if>
- <if test="password != null">
- password = #{password,jdbcType=VARCHAR},
- </if>
- <if test="nickname != null">
- nickname = #{nickname,jdbcType=VARCHAR},
- </if>
- <if test="email != null">
- email = #{email,jdbcType=VARCHAR},
- </if>
- <if test="createTime != null">
- create_time = #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="number != null">
- number = #{number,jdbcType=BIGINT},
- </if>
- <if test="lvl != null">
- lvl = #{lvl,jdbcType=INTEGER},
- </if>
- <if test="type != null">
- type = #{type,jdbcType=INTEGER},
- </if>
- <if test="aid != null">
- aid = #{aid,jdbcType=VARCHAR}
- </if>
- </set>
- where id = #{id,jdbcType=VARCHAR}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.User">
- update user
- set mobile = #{mobile,jdbcType=VARCHAR},
- password = #{password,jdbcType=VARCHAR},
- nickname = #{nickname,jdbcType=VARCHAR},
- email = #{email,jdbcType=VARCHAR},
- create_time = #{createTime,jdbcType=TIMESTAMP},
- number = #{number,jdbcType=BIGINT},
- lvl = #{lvl,jdbcType=INTEGER},
- type = #{type,jdbcType=INTEGER},
- aid = #{aid,jdbcType=VARCHAR}
- where id = #{id,jdbcType=VARCHAR}
- </update>
-
-
- <select id="selectByMobieAndType" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from user
- where mobile = #{0} and type=#{1}
- </select>
-
- <select id="selectUserPageHomeBoByUserId" resultMap="UserPageHomeBo" parameterType="java.lang.String">
- select u.lvl,u.nickname,u.email,u.number,u.type,i.person_portrait_url, o.logo_url ,i.id ,i.uid from user u LEFT JOIN user_info i
- on u.id = i.uid
- LEFT JOIN organization_info o on u.id = o.uid where u.id = #{uid,jdbcType = VARCHAR}
- </select>
-
- <select id="selectUserDownLoadBoByUserId" resultMap="UserDownLoadBo" parameterType="java.lang.String">
- select u.id,i.positive_id_url ,i.opposite_id_url,c.professional_certificate_url,c.qualification_certificate_url,
- e.diploma_url, e.degree_diploma_url
- from user u
- LEFT JOIN user_identity i on u.id = i.uid
- LEFT JOIN user_career c on u.id = c.uid
- LEFT JOIN user_edu e on u.id = e.uid
- where u.id =#{id,jdbcType=VARCHAR}
- </select>
-
- <select id="findUserListByPage" parameterType="String" resultType="com.goafanti.user.bo.UserListBo">
- select u.id ,u.mobile, u.email, u.create_time as createTime,
- u.number , i.aft_username as aftUsername, i.audit_status as auditStatus, a.name as adminName
- from user u
- LEFT JOIN admin a on a.id = u.aid
- LEFT JOIN user_identity i
- ON u.id = i.uid where u.type = 0
- <if test = "mobile != null">
- and u.mobile = #{mobile,jdbcType=VARCHAR}
- </if>
- <if test = "email != null">
- and u.email = #{email,jdbcType=VARCHAR}
- </if>
- <if test = "pStart != null" >
- and u.create_time <![CDATA[ > ]]> #{pStart,jdbcType=TIMESTAMP}
- </if>
- <if test = "pEnd != null">
- and u.create_time <![CDATA[ < ]]> #{pEnd,jdbcType=TIMESTAMP}
- </if>
- <if test=" number != null">
- and u.number = #{number,jdbcType=INTEGER}
- </if>
- <if test="aftUsername != null">
- and i.aft_username = #{aftUsername,jdbcType=VARCHAR}
- </if>
- <if test="auditStatus != null">
- and i.audit_status= #{auditStatus,jdbcType=INTEGER}
- </if>
- order by u.number desc
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
-
- <select id="findUserCount" resultType="java.lang.Integer" parameterType="String">
- select count(1)
- from user u LEFT JOIN user_identity i
- ON u.id = i.uid
- WHERE u.type = 0
- <if test = "mobile != null">
- and u.mobile = #{mobile,jdbcType=VARCHAR}
- </if>
- <if test = "email != null">
- and u.email = #{email,jdbcType=VARCHAR}
- </if>
- <if test = "pStart != null" >
- and u.create_time <![CDATA[ > ]]> #{pStart,jdbcType=TIMESTAMP}
- </if>
- <if test = "pEnd != null">
- and u.create_time <![CDATA[ < ]]> #{pEnd,jdbcType=TIMESTAMP}
- </if>
- <if test="number != null">
- and u.number = #{number,jdbcType=INTEGER}
- </if>
- <if test="aftUsername != null">
- and i.aft_username = #{aftUsername,jdbcType=VARCHAR}
- </if>
- <if test="auditStatus != null">
- and i.audit_status= #{auditStatus,jdbcType=INTEGER}
- </if>
- </select>
-
- <select id="findOrgListByPage" parameterType="String" resultType="com.goafanti.user.bo.OrgListBo">
- select u.id ,u.mobile, u.email, u.create_time as createTime,
- u.number , o.aft_username as aftUsername, o.audit_status as auditStatus, a.name as adminName,
- o.unit_name as unitName
- from user u
- LEFT JOIN admin a on a.id = u.aid
- LEFT JOIN organization_identity o
- ON u.id = o.uid
- WHERE u.type = 1
-
- <if test = "mobile != null">
- and u.mobile = #{mobile,jdbcType=VARCHAR}
- </if>
- <if test = "email != null">
- and u.email = #{email,jdbcType=VARCHAR}
- </if>
- <if test = "pStart != null" >
- and u.create_time <![CDATA[ > ]]> #{pStart,jdbcType=TIMESTAMP}
- </if>
- <if test = "pEnd != null">
- and u.create_time <![CDATA[ < ]]> #{pEnd,jdbcType=TIMESTAMP}
- </if>
- <if test=" number != null">
- and u.number = #{number,jdbcType=INTEGER}
- </if>
- <if test="aftUsername != null">
- and o.aft_username = #{aftUsername,jdbcType=VARCHAR}
- </if>
- <if test="auditStatus != null">
- and o.audit_status= #{auditStatus,jdbcType=INTEGER}
- </if>
- order by u.number desc
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
-
- <select id="findOrgCount" resultType="java.lang.Integer" parameterType="String">
- select count(1)
- from user u LEFT JOIN organization_identity o
- ON u.id = o.uid
- WHERE u.type = 1
- <if test = "mobile != null">
- and u.mobile = #{mobile,jdbcType=VARCHAR}
- </if>
- <if test = "email != null">
- and u.email = #{email,jdbcType=VARCHAR}
- </if>
- <if test = "pStart != null" >
- and u.create_time <![CDATA[ > ]]> #{pStart,jdbcType=TIMESTAMP}
- </if>
- <if test = "pEnd != null">
- and u.create_time <![CDATA[ < ]]> #{pEnd,jdbcType=TIMESTAMP}
- </if>
- <if test=" number != null">
- and u.number = #{number,jdbcType=INTEGER}
- </if>
- <if test="aftUsername != null">
- and o.aft_username = #{aftUsername,jdbcType=VARCHAR}
- </if>
- <if test="auditStatus != null">
- and o.audit_status= #{auditStatus,jdbcType=INTEGER}
- </if>
- </select>
- </mapper>
|