| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514 |
- <?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.UserIdentityMapper" >
- <resultMap id="BaseResultMap" type="com.goafanti.common.model.UserIdentity" >
- <id column="id" property="id" jdbcType="VARCHAR" />
- <result column="uid" property="uid" jdbcType="VARCHAR" />
- <result column="username" property="username" jdbcType="VARCHAR" />
- <result column="sex" property="sex" jdbcType="VARCHAR" />
- <result column="date_of_birth_year" property="dateOfBirthYear" jdbcType="VARCHAR" />
- <result column="date_of_birth_month" property="dateOfBirthMonth" jdbcType="VARCHAR" />
- <result column="id_number" property="idNumber" jdbcType="VARCHAR" />
- <result column="positive_id_url" property="positiveIdUrl" jdbcType="VARCHAR" />
- <result column="opposite_id_url" property="oppositeIdUrl" jdbcType="VARCHAR" />
- <result column="aft_username" property="aftUsername" jdbcType="VARCHAR" />
- <result column="province" property="province" jdbcType="INTEGER" />
- <result column="city" property="city" jdbcType="INTEGER" />
- <result column="area" property="area" jdbcType="INTEGER" />
- <result column="contact_mobile" property="contactMobile" jdbcType="VARCHAR" />
- <result column="bank_name" property="bankName" jdbcType="VARCHAR" />
- <result column="bank_account" property="bankAccount" jdbcType="VARCHAR" />
- <result column="bank_card_number" property="bankCardNumber" jdbcType="VARCHAR" />
- <result column="amount_money" property="amountMoney" jdbcType="DECIMAL" />
- <result column="audit_status" property="auditStatus" jdbcType="INTEGER" />
- <result column="process" property="process" jdbcType="INTEGER" />
- <result column="wrong_count" property="wrongCount" jdbcType="INTEGER" />
- <result column="payment_date" property="paymentDate" jdbcType="TIMESTAMP" />
- <result column="expert" property="expert" jdbcType="INTEGER" />
- <result column="celebrity" property="celebrity" jdbcType="INTEGER" />
- </resultMap>
- <sql id="Base_Column_List" >
- id, uid, username, sex, date_of_birth_year, date_of_birth_month, id_number, positive_id_url,
- opposite_id_url, aft_username, province, city, area, contact_mobile, bank_name, bank_account,
- bank_card_number, amount_money, audit_status, process , wrong_count, payment_date,
- expert, celebrity
- </sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
- select
- <include refid="Base_Column_List" />
- from user_identity
- where id = #{id,jdbcType=VARCHAR}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
- delete from user_identity
- where id = #{id,jdbcType=VARCHAR}
- </delete>
- <insert id="insert" parameterType="com.goafanti.common.model.UserIdentity" >
- insert into user_identity (id, uid, username,
- sex, date_of_birth_year, date_of_birth_month,
- id_number, positive_id_url, opposite_id_url,
- aft_username, province, city,
- area, contact_mobile, bank_name,
- bank_account, bank_card_number, amount_money,
- audit_status, process, wrong_count, payment_date,
- expert, celebrity)
- values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR},
- #{sex,jdbcType=VARCHAR}, #{dateOfBirthYear,jdbcType=VARCHAR}, #{dateOfBirthMonth,jdbcType=VARCHAR},
- #{idNumber,jdbcType=VARCHAR}, #{positiveIdUrl,jdbcType=VARCHAR}, #{oppositeIdUrl,jdbcType=VARCHAR},
- #{aftUsername,jdbcType=VARCHAR}, #{province,jdbcType=INTEGER}, #{city,jdbcType=INTEGER},
- #{area,jdbcType=INTEGER}, #{contactMobile,jdbcType=VARCHAR}, #{bankName,jdbcType=VARCHAR},
- #{bankAccount,jdbcType=VARCHAR}, #{bankCardNumber,jdbcType=VARCHAR}, #{amountMoney,jdbcType=DECIMAL},
- #{auditStatus,jdbcType=INTEGER}, #{process,jdbcType=INTEGER}, #{wrongCount,jdbcType=INTEGER}, #{paymentDate,jdbcType=TIMESTAMP},
- #{expert,jdbcType=INTEGER}, #{celebrity,jdbcType=INTEGER})
- </insert>
- <insert id="insertSelective" parameterType="com.goafanti.common.model.UserIdentity" >
- insert into user_identity
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="id != null" >
- id,
- </if>
- <if test="uid != null" >
- uid,
- </if>
- <if test="username != null" >
- username,
- </if>
- <if test="sex != null" >
- sex,
- </if>
- <if test="dateOfBirthYear != null" >
- date_of_birth_year,
- </if>
- <if test="dateOfBirthMonth != null" >
- date_of_birth_month,
- </if>
- <if test="idNumber != null" >
- id_number,
- </if>
- <if test="positiveIdUrl != null" >
- positive_id_url,
- </if>
- <if test="oppositeIdUrl != null" >
- opposite_id_url,
- </if>
- <if test="aftUsername != null" >
- aft_username,
- </if>
- <if test="province != null" >
- province,
- </if>
- <if test="city != null" >
- city,
- </if>
- <if test="area != null" >
- area,
- </if>
- <if test="contactMobile != null" >
- contact_mobile,
- </if>
- <if test="bankName != null" >
- bank_name,
- </if>
- <if test="bankAccount != null" >
- bank_account,
- </if>
- <if test="bankCardNumber != null" >
- bank_card_number,
- </if>
- <if test="amountMoney != null" >
- amount_money,
- </if>
- <if test="auditStatus != null" >
- audit_status,
- </if>
- <if test="process != null" >
- process,
- </if>
- <if test="wrongCount != null" >
- wrong_count,
- </if>
- <if test="paymentDate != null" >
- payment_date,
- </if>
- <if test="expert != null" >
- expert,
- </if>
- <if test="celebrity != null" >
- celebrity,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="id != null" >
- #{id,jdbcType=VARCHAR},
- </if>
- <if test="uid != null" >
- #{uid,jdbcType=VARCHAR},
- </if>
- <if test="username != null" >
- #{username,jdbcType=VARCHAR},
- </if>
- <if test="sex != null" >
- #{sex,jdbcType=VARCHAR},
- </if>
- <if test="dateOfBirthYear != null" >
- #{dateOfBirthYear,jdbcType=VARCHAR},
- </if>
- <if test="dateOfBirthMonth != null" >
- #{dateOfBirthMonth,jdbcType=VARCHAR},
- </if>
- <if test="idNumber != null" >
- #{idNumber,jdbcType=VARCHAR},
- </if>
- <if test="positiveIdUrl != null" >
- #{positiveIdUrl,jdbcType=VARCHAR},
- </if>
- <if test="oppositeIdUrl != null" >
- #{oppositeIdUrl,jdbcType=VARCHAR},
- </if>
- <if test="aftUsername != null" >
- #{aftUsername,jdbcType=VARCHAR},
- </if>
- <if test="province != null" >
- #{province,jdbcType=INTEGER},
- </if>
- <if test="city != null" >
- #{city,jdbcType=INTEGER},
- </if>
- <if test="area != null" >
- #{area,jdbcType=INTEGER},
- </if>
- <if test="contactMobile != null" >
- #{contactMobile,jdbcType=VARCHAR},
- </if>
- <if test="bankName != null" >
- #{bankName,jdbcType=VARCHAR},
- </if>
- <if test="bankAccount != null" >
- #{bankAccount,jdbcType=VARCHAR},
- </if>
- <if test="bankCardNumber != null" >
- #{bankCardNumber,jdbcType=VARCHAR},
- </if>
- <if test="amountMoney != null" >
- #{amountMoney,jdbcType=DECIMAL},
- </if>
- <if test="auditStatus != null" >
- #{auditStatus,jdbcType=INTEGER},
- </if>
- <if test="process != null" >
- #{process,jdbcType=INTEGER},
- </if>
- <if test="wrongCount != null" >
- #{wrongCount,jdbcType=INTEGER},
- </if>
- <if test="paymentDate != null" >
- #{paymentDate,jdbcType=TIMESTAMP},
- </if>
- <if test="expert != null" >
- #{expert,jdbcType=INTEGER},
- </if>
- <if test="celebrity != null" >
- #{celebrity,jdbcType=INTEGER},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.UserIdentity" >
- update user_identity
- <set >
- <if test="uid != null" >
- uid = #{uid,jdbcType=VARCHAR},
- </if>
- <if test="username != null" >
- username = #{username,jdbcType=VARCHAR},
- </if>
- <if test="sex != null" >
- sex = #{sex,jdbcType=VARCHAR},
- </if>
- <if test="dateOfBirthYear != null" >
- date_of_birth_year = #{dateOfBirthYear,jdbcType=VARCHAR},
- </if>
- <if test="dateOfBirthMonth != null" >
- date_of_birth_month = #{dateOfBirthMonth,jdbcType=VARCHAR},
- </if>
- <if test="idNumber != null" >
- id_number = #{idNumber,jdbcType=VARCHAR},
- </if>
- <if test="positiveIdUrl != null" >
- positive_id_url = #{positiveIdUrl,jdbcType=VARCHAR},
- </if>
- <if test="oppositeIdUrl != null" >
- opposite_id_url = #{oppositeIdUrl,jdbcType=VARCHAR},
- </if>
- <if test="aftUsername != null" >
- aft_username = #{aftUsername,jdbcType=VARCHAR},
- </if>
- <if test="province != null" >
- province = #{province,jdbcType=INTEGER},
- </if>
- <if test="city != null" >
- city = #{city,jdbcType=INTEGER},
- </if>
- <if test="area != null" >
- area = #{area,jdbcType=INTEGER},
- </if>
- <if test="contactMobile != null" >
- contact_mobile = #{contactMobile,jdbcType=VARCHAR},
- </if>
- <if test="bankName != null" >
- bank_name = #{bankName,jdbcType=VARCHAR},
- </if>
- <if test="bankAccount != null" >
- bank_account = #{bankAccount,jdbcType=VARCHAR},
- </if>
- <if test="bankCardNumber != null" >
- bank_card_number = #{bankCardNumber,jdbcType=VARCHAR},
- </if>
- <if test="amountMoney != null" >
- amount_money = #{amountMoney,jdbcType=DECIMAL},
- </if>
- <if test="auditStatus != null" >
- audit_status = #{auditStatus,jdbcType=INTEGER},
- </if>
- <if test="process != null" >
- process = #{process,jdbcType=INTEGER},
- </if>
- <if test="wrongCount != null" >
- wrong_count = #{wrongCount,jdbcType=INTEGER},
- </if>
- <if test="paymentDate != null" >
- payment_date = #{paymentDate,jdbcType=TIMESTAMP},
- </if>
- <if test="expert != null" >
- expert = #{expert,jdbcType=INTEGER},
- </if>
- <if test="celebrity != null" >
- celebrity = #{celebrity,jdbcType=INTEGER},
- </if>
- </set>
- where id = #{id,jdbcType=VARCHAR}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.UserIdentity" >
- update user_identity
- set uid = #{uid,jdbcType=VARCHAR},
- username = #{username,jdbcType=VARCHAR},
- sex = #{sex,jdbcType=VARCHAR},
- date_of_birth_year = #{dateOfBirthYear,jdbcType=VARCHAR},
- date_of_birth_month = #{dateOfBirthMonth,jdbcType=VARCHAR},
- id_number = #{idNumber,jdbcType=VARCHAR},
- positive_id_url = #{positiveIdUrl,jdbcType=VARCHAR},
- opposite_id_url = #{oppositeIdUrl,jdbcType=VARCHAR},
- aft_username = #{aftUsername,jdbcType=VARCHAR},
- province = #{province,jdbcType=INTEGER},
- city = #{city,jdbcType=INTEGER},
- area = #{area,jdbcType=INTEGER},
- contact_mobile = #{contactMobile,jdbcType=VARCHAR},
- bank_name = #{bankName,jdbcType=VARCHAR},
- bank_account = #{bankAccount,jdbcType=VARCHAR},
- bank_card_number = #{bankCardNumber,jdbcType=VARCHAR},
- amount_money = #{amountMoney,jdbcType=DECIMAL},
- audit_status = #{auditStatus,jdbcType=INTEGER},
- process = #{process,jdbcType=INTEGER},
- wrong_count = #{wrongCount,jdbcType=INTEGER},
- payment_date = #{paymentDate,jdbcType=TIMESTAMP},
- expert = #{expert,jdbcType=INTEGER},
- celebrity = #{celebrity,jdbcType=INTEGER}
- where id = #{id,jdbcType=VARCHAR}
- </update>
-
- <select id="selectUserIdentityByUserId" parameterType="java.lang.String" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from user_identity
- where uid = #{uid,jdbcType=VARCHAR}
- </select>
-
-
- <select id="selectUserIdentityBoByUserId" parameterType="java.lang.String" resultType="com.goafanti.user.bo.UserIdentityBo">
- select
- t.id, t.uid, t.username, t.sex, t.date_of_birth_year as dateOfBirthYear,
- t.date_of_birth_month as dateOfBirthMonth, t.id_number as idNumber, t.audit_status as auditStatus,
- u.mobile, u.number from user u left JOIN user_identity t
- on t.uid = u.id where t.uid=#{uid,jdbcType=VARCHAR}
- </select>
-
- <select id="selectAuditorUserIdentityByUserId" parameterType="java.lang.String" resultType="com.goafanti.user.bo.AuditorUserIdentityDetailBo">
- select
- u.aid,
- u.mid,
- ui.id,
- ui.uid,
- ui.username,
- ui.sex,
- ui.date_of_birth_year as dateOfBirthYear,
- ui.date_of_birth_month as dateOfBirthMonth,
- ui.id_number as idNumber,
- ui.positive_id_url as positiveIdUrl,
- ui.opposite_id_url as oppositeIdUrl,
- ui.aft_username as aftUsername,
- ui.province,
- ui.city,
- ui.area,
- ui.contact_mobile as contactMobile,
- ui.bank_name as bankName,
- ui.bank_account as bankAccount,
- ui.bank_card_number as bankCardNumber,
- ui.amount_money as amountMoney,
- ui.audit_status as auditStatus,
- ui.payment_date as paymentDate,
- ui.expert,
- ui.celebrity
- from user u
- LEFT JOIN user_identity ui on u.id = ui.uid
- where u.id = #{uid,jdbcType=VARCHAR}
- </select>
-
- <select id="selectManagerUserNames" resultType="com.goafanti.user.bo.UserNames"
- parameterType="java.lang.String">
- select u.id as uid, i.username
- from user u INNER JOIN
- user_identity i on u.id = i.uid
- where
- i.audit_status = 5 and u.lvl = 1
- <if test="_parameter != null">
- and u.mid = #{aid,jdbcType=VARCHAR}
- </if>
- </select>
-
- <select id="selectAllUserNames" resultType="com.goafanti.user.bo.UserNames"
- parameterType="java.lang.String">
- select u.id as uid, i.username
- from user u INNER JOIN
- user_identity i on u.id = i.uid
- where
- i.audit_status = 5 and u.lvl = 1
- <if test="_parameter != null">
- and u.aid = #{aid,jdbcType=VARCHAR}
- </if>
- </select>
-
- <select id="selectManagerAchievementUserOwner" resultType="com.goafanti.user.bo.UserNames">
- select u.id as uid, ui.username, u.mobile
- from user u INNER JOIN
- user_identity ui on u.id = ui.uid
- where
- ui.audit_status = 5 and u.lvl = 1 and ui.username like
- "%"#{name,jdbcType=VARCHAR}"%"
- <if test="aid != null">
- and u.mid = #{aid,jdbcType=VARCHAR}
- </if>
-
- </select>
-
- <select id="selectAchievementUserOwner" resultType="com.goafanti.user.bo.UserNames">
- select u.id as uid, ui.username, u.mobile
- from user u INNER JOIN
- user_identity ui on u.id = ui.uid
- where
- ui.audit_status = 5 and u.lvl = 1 and ui.username like
- "%"#{name,jdbcType=VARCHAR}"%"
- <if test="aid != null">
- and u.aid = #{aid,jdbcType=VARCHAR}
- </if>
-
- </select>
-
- <select id="findSearchSubscriberListByPage" parameterType="String" resultType="com.goafanti.portal.bo.UserSubscriberListBo">
- SELECT
- u.id as uid, ui.username, u.number,
- ui.id as identityId, ui.province,
- info.person_portrait_url as personPortraitUrl,
- adc.achievement_count as achievementNum,
- adc.demand_count as demandNum,
- uc.engaged_field as engagedField,
- uc.work_unit as workUnit,
- uc.position
- FROM
- <![CDATA[ user ]]> u
- LEFT JOIN user_identity ui ON ui.uid = u.id
- LEFT JOIN user_career uc ON uc.uid = u.id
- LEFT JOIN user_info info ON info.uid = u.id
- LEFT JOIN achievement_demand_count adc ON adc.uid = u.id
- WHERE
- u.type = 0
- <if test="null != level and level==1 ">
- AND u.lvl <![CDATA[ >= ]]> 1
- </if>
- <if test="null !=level and level==0" >
- AND u.lvl = 0
- </if>
- <if test="province != null">
- AND ui.province = #{province,jdbcType=INTEGER}
- </if>
- <if test="city != null">
- AND ui.city = #{city,jdbcType=INTEGER}
- </if>
- <if test="area != null">
- AND ui.area = #{area,jdbcType=INTEGER}
- </if>
- <if test="field != null">
- AND uc.engaged_field like CONCAT(#{field,jdbcType=VARCHAR}, '%')
- </if>
- <if test="name != null">
- AND ui.username like CONCAT('%', #{name,jdbcType=VARCHAR}, '%')
- </if>
- ORDER BY
- u.number
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
-
- <select id="findSearchSubscriberCount" parameterType="String" resultType="java.lang.Integer">
- SELECT
- count(1)
- FROM
- <![CDATA[ user ]]> u
- LEFT JOIN user_identity ui ON ui.uid = u.id
- LEFT JOIN user_career uc ON uc.uid = u.id
- WHERE
- u.type = 0
- <if test="null != level and level==1 ">
- AND u.lvl <![CDATA[ >= ]]> 1
- </if>
- <if test="null != level and level==0" >
- AND u.lvl = 0
- </if>
- <if test="province != null">
- AND ui.province = #{province,jdbcType=INTEGER}
- </if>
- <if test="city != null">
- AND ui.city = #{city,jdbcType=INTEGER}
- </if>
- <if test="area != null">
- AND ui.area = #{area,jdbcType=INTEGER}
- </if>
- <if test="field != null">
- AND uc.engaged_field like CONCAT(#{field,jdbcType=VARCHAR}, '%')
- </if>
- <if test="name != null">
- AND ui.username like CONCAT('%', #{name,jdbcType=VARCHAR}, '%')
- </if>
- </select>
- <select id="selectInternationalUser" resultType="com.goafanti.portal.bo.InternationalListBo">
- select
- a.id,
- b.username as ownerName,
- c.ability_label as abilityLabel,
- d.person_portrait_url personPortraitUrl,
- e.education
- from user a
- left join user_identity b
- on a.id = b.uid
- left join user_ability c
- on a.id = c.uid
- left join user_info d
- on a.id = d.uid
- left join user_edu e
- on a.id = e.uid
- where 1=1
- <!-- and b.international_flag and b.audit_status = 5 and b.expert = 1 -->
- order by
- a.create_time desc
- limit 0,6
- </select>
- </mapper>
|