Commit 8dd7c3c4 by YANGYANG

任务关联人接口

parent 192840e9
...@@ -235,7 +235,7 @@ public class UsersController { ...@@ -235,7 +235,7 @@ public class UsersController {
map.put("online",online); map.put("online",online);
map.put("wearFlag",wearFlag); map.put("wearFlag",wearFlag);
List<UsersAndOnlineVo> list = usersService.userPageOnlineList(map); List<UsersAndOnlineVo> list = usersService.userPageOnlineList(map);
Integer total = usersService.userPageOnlineListCount(xm,sbimei,online,wearFlag); Integer total = usersService.userPageOnlineListCount(map);
return MapRestResult.build(ResultCode.SUCCESS,"成功获取用户列表信息",total,list); return MapRestResult.build(ResultCode.SUCCESS,"成功获取用户列表信息",total,list);
} }
} }
......
...@@ -25,6 +25,6 @@ public interface UsersMapper extends BaseMapper<Users> { ...@@ -25,6 +25,6 @@ public interface UsersMapper extends BaseMapper<Users> {
List<UsersAndOnlineVo> userPageOnlineList(Map map); List<UsersAndOnlineVo> userPageOnlineList(Map map);
Integer userPageOnlineListCount(@Param("xm") String xm, @Param("sbimei")String sbimei, @Param("online") String online, @Param("wearFlag") String wearFlag); Integer userPageOnlineListCount(Map map);
} }
...@@ -3,16 +3,16 @@ ...@@ -3,16 +3,16 @@
<mapper namespace="com.founder.zdry.mapper.FenceTaskMapper"> <mapper namespace="com.founder.zdry.mapper.FenceTaskMapper">
<sql id="queryTlWhere"> <sql id="queryTlWhere">
<if test="xm!= null and xm!=''"> <if test="xm!= null and xm!=''">
AND users.xm LIKE '%' || #{xm , jdbcType=VARCHAR } || '%' AND users.xm LIKE concat('%', #{xm,jdbcType=VARCHAR}, '%')
</if> </if>
<if test="sbimei!= null and sbimei != ''"> <if test="sbimei!= null and sbimei != ''">
AND users.sb_imei= #{ sbimei , jdbcType=INTEGER } AND users.sb_imei= #{ sbimei , jdbcType=INTEGER }
</if> </if>
<if test="bs!= null and bs != ''"> <if test="bs!= null and bs != ''">
AND users.bs LIKE '%' || #{xm , jdbcType=VARCHAR } || '%' AND users.bs LIKE concat('%', #{bs,jdbcType=VARCHAR}, '%')
</if> </if>
<if test="sfzhm!= null and sfzhm != ''"> <if test="sfzhm!= null and sfzhm != ''">
AND users.sfzhm LIKE '%' || #{sfzhm , jdbcType=VARCHAR } || '%' AND users.sfzhm LIKE concat('%', #{sfzhm,jdbcType=VARCHAR}, '%')
</if> </if>
<if test="bq_dj!= null and bq_dj != ''"> <if test="bq_dj!= null and bq_dj != ''">
AND users.bq_dj= #{ bq_dj , jdbcType=INTEGER } AND users.bq_dj= #{ bq_dj , jdbcType=INTEGER }
......
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.founder.zdry.mapper.UsersMapper"> <mapper namespace="com.founder.zdry.mapper.UsersMapper">
<sql id="queryTlWhere"> <sql id="queryWhere">
<if test="xm!= null and xm!=''"> <if test="xm!= null and xm!=''">
AND users.xm LIKE '%' || #{xm , jdbcType=VARCHAR } || '%' AND users.xm LIKE concat('%', #{xm,jdbcType=VARCHAR}, '%')
</if> </if>
<if test="sbimei!= null and sbimei != ''"> <if test="sbimei!= null and sbimei != ''">
AND users.sb_imei= #{ sbimei , jdbcType=INTEGER } AND users.sb_imei= #{ sbimei, jdbcType=INTEGER }
</if> </if>
<if test="online!= null and online != ''"> <if test="online!= null and online != ''">
AND online.online= #{ online , jdbcType=INTEGER } AND online.online= #{ online, jdbcType=INTEGER }
</if> </if>
<if test="wearFlag!= null and wearFlag != ''"> <if test="wearFlag!= null and wearFlag != ''">
AND online.wear_flag= #{ wearFlag , jdbcType=INTEGER } AND online.wear_flag= #{ wearFlag, jdbcType=INTEGER }
</if> </if>
</sql> </sql>
<select id="userPageOnlineList" parameterType="java.util.Map" resultType="com.founder.commonutils.ZdryAndZdryApiVo.UsersAndOnlineVo"> <select id="userPageOnlineList" parameterType="Map" resultType="com.founder.commonutils.ZdryAndZdryApiVo.UsersAndOnlineVo">
select select
users.xm as xm, users.xm as xm,
users.xb as xb, users.xb as xb,
...@@ -45,15 +45,15 @@ ...@@ -45,15 +45,15 @@
from gk_users users,gk_online online from gk_users users,gk_online online
where users.sb_imei = online.sb_imei where users.sb_imei = online.sb_imei
and users.xxsc_pdbz = 0 and users.xxsc_pdbz = 0
<include refid="queryTlWhere"/> <include refid="queryWhere"/>
limit #{ page },#{ limit} limit #{ page },#{ limit}
</select> </select>
<select id="userPageOnlineListCount" parameterType="java.lang.String" resultType="java.lang.Integer"> <select id="userPageOnlineListCount" parameterType="java.util.Map" resultType="java.lang.Integer">
select select
count(*) count(*)
from gk_users users,gk_online online from gk_users users,gk_online online
where users.sb_imei = online.sb_imei where users.sb_imei = online.sb_imei
and users.xxsc_pdbz = 0 and users.xxsc_pdbz = 0
<include refid="queryTlWhere"/> <include refid="queryWhere"/>
</select> </select>
</mapper> </mapper>
...@@ -18,6 +18,6 @@ import java.util.Map; ...@@ -18,6 +18,6 @@ import java.util.Map;
public interface UsersService extends IService<Users> { public interface UsersService extends IService<Users> {
List<UsersAndOnlineVo> userPageOnlineList(Map map); List<UsersAndOnlineVo> userPageOnlineList(Map map);
Integer userPageOnlineListCount(String xm, String sbimei, String online, String wearFlag); Integer userPageOnlineListCount(Map map);
} }
...@@ -30,7 +30,7 @@ public class UsersServiceImpl extends ServiceImpl<UsersMapper, Users> implements ...@@ -30,7 +30,7 @@ public class UsersServiceImpl extends ServiceImpl<UsersMapper, Users> implements
} }
@Override @Override
public Integer userPageOnlineListCount(String xm, String sbimei, String online, String wearFlag) { public Integer userPageOnlineListCount(Map map) {
return usersMapper.userPageOnlineListCount(xm,sbimei,online,wearFlag); return usersMapper.userPageOnlineListCount(map);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment