修改查询用户集合对外接口查询用户系统视图groupby限制,改全查

master
zengwh 3 years ago
parent da81bb3e8b
commit b184c70a9b

@ -52,9 +52,6 @@ public class LoginController {
@Value("${EMRMEDICALRECORD_PORT}")
private String port;
@Value("${POWER_PORT}")
private String POWER_PORT;
@RequestMapping(value = "login",method = RequestMethod.GET)
public String toLogin(Model model){
Power_Login_Set loginSet = powerLoginSetMapper.selectByPrimaryKey(sysFlag);
@ -134,6 +131,8 @@ public class LoginController {
if(sysFlag == 2){
url = EMRMEDICALRECORD_URLHEAD+"/login?token="+token+"&userName="+user.getUserName()+"&flag=1";
}else{
//获取本地端口
int POWER_PORT = request.getLocalPort();
url = "http://"+ip+":"+POWER_PORT+"/power/gatewayPage";
}
//request.getRequestDispatcher(url).forward(request, response);

@ -35,7 +35,7 @@
role_id, dept_id, effective, create_date, creater, update_date, updater, remark,dept_code
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
select
<include refid="Base_Column_List" />
from power_user
where user_id = #{userId,jdbcType=INTEGER}
@ -46,17 +46,17 @@
</delete>
<insert id="insert" parameterType="com.manage.entity.Power_User">
insert into power_user (user_id, user_name,name, user_pwd,
user_sex, user_age, user_tel,
user_email, user_position, role_id,
dept_id, effective, create_date,
creater, update_date, updater,
user_sex, user_age, user_tel,
user_email, user_position, role_id,
dept_id, effective, create_date,
creater, update_date, updater,
remark)
values (#{userId,jdbcType=INTEGER}, #{userName,jdbcType=VARCHAR},#{name,jdbcType=VARCHAR},
#{userPwd,jdbcType=VARCHAR},
#{userSex,jdbcType=INTEGER}, #{userAge,jdbcType=INTEGER}, #{userTel,jdbcType=VARCHAR},
#{userEmail,jdbcType=VARCHAR}, #{userPosition,jdbcType=VARCHAR}, #{roleId,jdbcType=INTEGER},
#{deptId,jdbcType=VARCHAR}, #{effective,jdbcType=INTEGER}, #{createDate,jdbcType=CHAR},
#{creater,jdbcType=VARCHAR}, #{updateDate,jdbcType=CHAR}, #{updater,jdbcType=VARCHAR},
#{userSex,jdbcType=INTEGER}, #{userAge,jdbcType=INTEGER}, #{userTel,jdbcType=VARCHAR},
#{userEmail,jdbcType=VARCHAR}, #{userPosition,jdbcType=VARCHAR}, #{roleId,jdbcType=INTEGER},
#{deptId,jdbcType=VARCHAR}, #{effective,jdbcType=INTEGER}, #{createDate,jdbcType=CHAR},
#{creater,jdbcType=VARCHAR}, #{updateDate,jdbcType=CHAR}, #{updater,jdbcType=VARCHAR},
#{remark,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.manage.entity.Power_User">
@ -552,31 +552,24 @@
group by user_id
</select>
<select id="selectUserIdAndUserNameList" resultMap="BaseResultMapVo">
SELECT
power_user_dict.user_id,
power_user.user_name,
power_user.role_id,
power_user.dept_id,
power_user.dept_code,
power_role.role_name,
power_user.user_tel,
power_user.user_wechat,
name
FROM
power_user_dict
INNER JOIN power_user ON power_user_dict.user_id = power_user.user_id AND power_user.effective = 1 AND power_user.role_id != 0
LEFT JOIN power_role ON power_user.role_id = power_role.role_id AND power_role.effective = 1
<if test="userId != null and userId != ''">
WHERE
dict_id = (
SELECT
dict_id
FROM
power_user_dict
WHERE
user_id = #{userId}
)
</if>
SELECT
power_user.user_id,
power_user.user_name,
power_user.role_id,
power_user.dept_id,
power_user.dept_code,
power_role.role_name,
power_user.user_tel,
power_user.user_wechat,
NAME
FROM
power_user
LEFT JOIN power_role ON power_user.role_id = power_role.role_id
AND power_role.effective = 1
where power_user.effective = 1
<if test="userId != null">
AND user_id = #{userId}
</if>
</select>
<!--查询各表无效数-->
<select id="selectEffectiveCount" resultType="java.lang.Integer">

Loading…
Cancel
Save