|
|
@@ -216,9 +216,17 @@
|
|
|
</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,
|
|
|
- ad.name as managerName
|
|
|
+ select
|
|
|
+ u.id ,
|
|
|
+ u.mobile,
|
|
|
+ u.email,
|
|
|
+ u.create_time as createTime,
|
|
|
+ u.number ,
|
|
|
+ i.aft_username as aftUsername,
|
|
|
+ i.username,
|
|
|
+ i.audit_status as auditStatus,
|
|
|
+ a.name as adminName,
|
|
|
+ ad.name as managerName
|
|
|
from user u
|
|
|
LEFT JOIN admin a on a.id = u.aid
|
|
|
LEFT JOIN admin ad on ad.id = u.mid
|
|
|
@@ -272,7 +280,7 @@
|
|
|
and u.number = #{number,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="username != null">
|
|
|
- and i.username = #{username,jdbcType=VARCHAR}
|
|
|
+ and i.username like CONCAT('%', #{username,jdbcType=VARCHAR}, '%')
|
|
|
</if>
|
|
|
<if test="auditStatus != null">
|
|
|
and i.audit_status= #{auditStatus,jdbcType=INTEGER}
|
|
|
@@ -351,19 +359,167 @@
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
- <select id="selectUserByAid" parameterType="java.lang.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 orgAuditStatus, a.name as adminName, u.type,
|
|
|
- o.unit_name as unitName, i.username, i.audit_status as userAuditStatus
|
|
|
+ <select id="findUserByAidWithParamsListByPage" parameterType="java.lang.String" resultType="com.goafanti.user.bo.OrgListBo">
|
|
|
+ select
|
|
|
+ u.id ,
|
|
|
+ u.mobile,
|
|
|
+ u.email,
|
|
|
+ u.create_time as createTime,
|
|
|
+ u.number ,
|
|
|
+ a.name as adminName,
|
|
|
+ u.type,
|
|
|
+ i.username,
|
|
|
+ i.audit_status as userAuditStatus,
|
|
|
+ i.aft_username as aftUsername
|
|
|
from user u
|
|
|
LEFT JOIN admin a on a.id = u.aid
|
|
|
- LEFT JOIN organization_identity o ON u.id = o.uid
|
|
|
LEFT JOIN user_identity i on u.id = i.uid
|
|
|
-
|
|
|
- where u.aid = #{aid,jdbcType=VARCHAR}
|
|
|
+ where u.type = 0
|
|
|
+ <if test="aid != null">
|
|
|
+ and u.aid = #{aid,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="number !=null">
|
|
|
+ and u.number = #{number,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="mobile !=null">
|
|
|
+ and u.mobile= #{mobile,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="auditStatus !=null">
|
|
|
+ and i.audit_status = #{auditStatus,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="auditName !=null">
|
|
|
+ and i.username like CONCAT('%', #{auditName,jdbcType=VARCHAR}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="email !=null">
|
|
|
+ and u.email = #{email,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="startCreateTime !=null">
|
|
|
+ and u.create_time <![CDATA[ >= ]]> #{startCreateTime,jdbcType=TIMESTAMP}
|
|
|
+ </if>
|
|
|
+ <if test="endCreateTime !=null">
|
|
|
+ and u.create_time <![CDATA[ < ]]> #{endCreateTime,jdbcType=TIMESTAMP}
|
|
|
+ </if>
|
|
|
+ order by u.number desc
|
|
|
+ <if test="page_sql!=null">
|
|
|
+ ${page_sql}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="findUserByAidWithParamsCount" parameterType="String" resultType="java.lang.Integer">
|
|
|
+ select
|
|
|
+ count(1)
|
|
|
+ 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="aid != null">
|
|
|
+ and u.aid = #{aid,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="number !=null">
|
|
|
+ and u.number = #{number,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="mobile !=null">
|
|
|
+ and u.mobile= #{mobile,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="auditStatus !=null">
|
|
|
+ and i.audit_status = #{auditStatus,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="auditName !=null">
|
|
|
+ and i.username like CONCAT('%', #{auditName,jdbcType=VARCHAR}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="email !=null">
|
|
|
+ and u.email = #{email,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="startCreateTime !=null">
|
|
|
+ and u.create_time <![CDATA[ >= ]]> #{startCreateTime,jdbcType=TIMESTAMP}
|
|
|
+ </if>
|
|
|
+ <if test="endCreateTime !=null">
|
|
|
+ and u.create_time <![CDATA[ < ]]> #{endCreateTime,jdbcType=TIMESTAMP}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="findOrgByAidWithParamsListByPage" parameterType="java.lang.String" resultType="com.goafanti.user.bo.OrgListBo">
|
|
|
+ select
|
|
|
+ u.id ,
|
|
|
+ u.mobile,
|
|
|
+ u.email,
|
|
|
+ u.create_time as createTime,
|
|
|
+ u.number ,
|
|
|
+ a.name as adminName,
|
|
|
+ u.type,
|
|
|
+ i.unit_name as unitName,
|
|
|
+ i.audit_status as orgAuditStatus,
|
|
|
+ i.aft_username as aftUsername
|
|
|
+ from user u
|
|
|
+ LEFT JOIN admin a on a.id = u.aid
|
|
|
+ LEFT JOIN organization_identity i on u.id = i.uid
|
|
|
+ where u.type = 1
|
|
|
+ <if test="aid != null">
|
|
|
+ and u.aid = #{aid,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="number !=null">
|
|
|
+ and u.number = #{number,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="mobile !=null">
|
|
|
+ and u.mobile= #{mobile,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="auditStatus !=null">
|
|
|
+ and i.audit_status = #{auditStatus,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="auditName !=null">
|
|
|
+ and i.username like CONCAT('%', #{auditName,jdbcType=VARCHAR}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="email !=null">
|
|
|
+ and u.email = #{email,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="startCreateTime !=null">
|
|
|
+ and u.create_time <![CDATA[ >= ]]> #{startCreateTime,jdbcType=TIMESTAMP}
|
|
|
+ </if>
|
|
|
+ <if test="endCreateTime !=null">
|
|
|
+ and u.create_time <![CDATA[ < ]]> #{endCreateTime,jdbcType=TIMESTAMP}
|
|
|
+ </if>
|
|
|
order by u.number desc
|
|
|
+ <if test="page_sql!=null">
|
|
|
+ ${page_sql}
|
|
|
+ </if>
|
|
|
</select>
|
|
|
|
|
|
+ <select id="findOrgByAidWithParamsCount" parameterType="String" resultType="java.lang.Integer">
|
|
|
+ select
|
|
|
+ count(1)
|
|
|
+ from user u
|
|
|
+ LEFT JOIN admin a on a.id = u.aid
|
|
|
+ LEFT JOIN organization_identity i on u.id = i.uid
|
|
|
+ where u.type = 1
|
|
|
+ <if test="aid != null">
|
|
|
+ and u.aid = #{aid,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="number !=null">
|
|
|
+ and u.number = #{number,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="mobile !=null">
|
|
|
+ and u.mobile= #{mobile,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="auditStatus !=null">
|
|
|
+ and i.audit_status = #{auditStatus,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="auditName !=null">
|
|
|
+ and i.unit_name like CONCAT('%', #{auditName,jdbcType=VARCHAR}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="email !=null">
|
|
|
+ and u.email = #{email,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="startCreateTime !=null">
|
|
|
+ and u.create_time <![CDATA[ >= ]]> #{startCreateTime,jdbcType=TIMESTAMP}
|
|
|
+ </if>
|
|
|
+ <if test="endCreateTime !=null">
|
|
|
+ and u.create_time <![CDATA[ < ]]> #{endCreateTime,jdbcType=TIMESTAMP}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
<select id="findUserByNameAndMobile" resultType="java.lang.String">
|
|
|
select
|
|
|
ui.username
|
|
|
@@ -393,14 +549,22 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="findAreaManagerUserListByPage" 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,
|
|
|
- ad.name as managerName
|
|
|
+ select
|
|
|
+ u.id ,
|
|
|
+ u.mobile,
|
|
|
+ u.email,
|
|
|
+ u.create_time as createTime,
|
|
|
+ u.number ,
|
|
|
+ i.aft_username as aftUsername,
|
|
|
+ i.audit_status as auditStatus,
|
|
|
+ i.username,
|
|
|
+ a.name as adminName,
|
|
|
+ ad.name as managerName
|
|
|
from user u
|
|
|
LEFT JOIN admin a on a.id = u.aid
|
|
|
LEFT JOIN admin ad on ad.id = u.mid
|
|
|
- LEFT JOIN user_identity i
|
|
|
- ON u.id = i.uid where u.type = 0
|
|
|
+ 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>
|
|
|
@@ -463,7 +627,7 @@
|
|
|
and u.number = #{number,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="username != null">
|
|
|
- and i.username = #{username,jdbcType=VARCHAR}
|
|
|
+ and i.username like CONCAT('%', #{username,jdbcType=VARCHAR}, '%')
|
|
|
</if>
|
|
|
<if test="auditStatus != null">
|
|
|
and i.audit_status= #{auditStatus,jdbcType=INTEGER}
|
|
|
@@ -484,16 +648,22 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="findAreaManagerOrgListByPage" 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, ad.name as managerName
|
|
|
+ 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,
|
|
|
+ ad.name as managerName
|
|
|
from user u
|
|
|
LEFT JOIN admin a on a.id = u.aid
|
|
|
LEFT JOIN admin ad on ad.id = u.mid
|
|
|
- LEFT JOIN organization_identity o
|
|
|
- ON u.id = o.uid
|
|
|
+ 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>
|