| | |
| | | <?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.whyc.mapper.BaoJiGroupBattGroupMapper"> |
| | | <resultMap id="BaseResultMap" type="com.whyc.pojo.BaojiGroupBattGroup"> |
| | | <id column="num" jdbcType="BIGINT" property="num" /> |
| | | <result column="baoji_group_id" jdbcType="INTEGER" property="baojiGroupId" /> |
| | | <result column="StationId" jdbcType="INTEGER" property="stationId" /> |
| | | <result column="BattGroupId" jdbcType="INTEGER" property="battGroupId" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | num, baoji_group_id, StationId, BattGroupId |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from tb_user_battgroup_baojigroup_battgroup |
| | | where num = #{num,jdbcType=BIGINT} |
| | | </select> |
| | | <select id="searchStationName1InGroup" resultType="java.lang.String"> |
| | | select distinct db_battinf.tb_battinf.stationname1 from db_battinf.tb_battinf left outer join |
| | | db_user.tb_user_battgroup_baojigroup_battgroup on |
| | | db_user.tb_user_battgroup_baojigroup_battgroup.stationid=db_battinf.tb_battinf.stationid left outer join |
| | | db_user.tb_user_battgroup_baojigroup_usr on |
| | | db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id |
| | | left outer join db_user.tb_user_inf on tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid where |
| | | db_user.tb_user_inf.uId=#{uId} ORDER BY db_battinf.tb_battinf.stationname1 |
| | | <resultMap id="BaseResultMap" type="com.whyc.pojo.BaojiGroupBattGroup"> |
| | | <id column="num" jdbcType="BIGINT" property="num"/> |
| | | <result column="baoji_group_id" jdbcType="INTEGER" property="baojiGroupId"/> |
| | | <result column="StationId" jdbcType="INTEGER" property="stationId"/> |
| | | <result column="BattGroupId" jdbcType="INTEGER" property="battGroupId"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | num, baoji_group_id, StationId, BattGroupId |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from tb_user_battgroup_baojigroup_battgroup |
| | | where num = #{num,jdbcType=BIGINT} |
| | | </select> |
| | | <select id="searchStationName1InGroup" parameterType="com.whyc.pojo.UserInf" resultType="java.lang.String"> |
| | | select distinct db_battinf.tb_battinf.stationname1 from db_battinf.tb_battinf left outer join |
| | | db_user.tb_user_battgroup_baojigroup_battgroup on |
| | | db_user.tb_user_battgroup_baojigroup_battgroup.stationid=db_battinf.tb_battinf.stationid left outer join |
| | | db_user.tb_user_battgroup_baojigroup_usr on |
| | | db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id |
| | | left outer join db_user.tb_user_inf on tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid where |
| | | db_user.tb_user_inf.uId=#{uId} ORDER BY db_battinf.tb_battinf.stationname1 |
| | | |
| | | </select> |
| | | <select id="searchStationByStationName1" resultType="com.whyc.pojo.Battinf"> |
| | | select distinct db_battinf.tb_battinf.stationname,db_battinf.tb_battinf.stationid,db_battinf.tb_battinf.fBSDeviceId |
| | | from db_battinf.tb_battinf left outer join db_user.tb_user_battgroup_baojigroup_battgroup on |
| | | db_user.tb_user_battgroup_baojigroup_battgroup.stationid=db_battinf.tb_battinf.stationid left outer join |
| | | db_user.tb_user_battgroup_baojigroup_usr on |
| | | db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id |
| | | left outer join db_user.tb_user_inf on tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid |
| | | <where> |
| | | db_user.tb_user_inf.uid=#{userId} |
| | | <if test="stationName1!=null and stationName1!='' and stationName1!='null'"> |
| | | and db_battinf.tb_battinf.stationname1 like CONCAT('%',#{stationName1},'%') |
| | | </if> |
| | | </where> |
| | | ORDER BY db_battinf.tb_battinf.stationname1,db_battinf.tb_battinf.BattGroupId |
| | | </select> |
| | | <select id="searchBattGroupIdInGroup" resultType="com.whyc.pojo.Battinf"> |
| | | select distinct |
| | | db_battinf.tb_battinf.battgroupid,db_battinf.tb_battinf.stationName,db_battinf.tb_battinf.battgroupname,db_battinf.tb_battinf.moncount,db_battinf.tb_battinf.GroupIndexInFBSDevice,db_battinf.tb_battinf.FBSDeviceId |
| | | from db_battinf.tb_battinf left outer join db_user.tb_user_battgroup_baojigroup_battgroup on |
| | | db_user.tb_user_battgroup_baojigroup_battgroup.BattGroupId=db_battinf.tb_battinf.BattGroupId left outer join |
| | | db_user.tb_user_battgroup_baojigroup_usr on |
| | | db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id |
| | | left outer join db_user.tb_user_inf on tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid where |
| | | db_user.tb_user_inf.uid=#{uId} and db_battinf.tb_battinf.stationname1 like '%${uNote}%' and db_battinf.tb_battinf.stationname like '%${UName}%' |
| | | ORDER BY db_battinf.tb_battinf.stationname1,db_battinf.tb_battinf.BattGroupId |
| | | </select> |
| | | <select id="searchStationByStationName1" resultType="com.whyc.pojo.Battinf"> |
| | | select distinct |
| | | db_battinf.tb_battinf.stationname,db_battinf.tb_battinf.stationid,db_battinf.tb_battinf.fBSDeviceId |
| | | from db_battinf.tb_battinf left outer join db_user.tb_user_battgroup_baojigroup_battgroup on |
| | | db_user.tb_user_battgroup_baojigroup_battgroup.stationid=db_battinf.tb_battinf.stationid left outer join |
| | | db_user.tb_user_battgroup_baojigroup_usr on |
| | | db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id |
| | | left outer join db_user.tb_user_inf on tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid |
| | | <where> |
| | | db_user.tb_user_inf.uid=#{userId} |
| | | <if test="stationName1!=null and stationName1!='' and stationName1!='null'"> |
| | | and db_battinf.tb_battinf.stationname1 like CONCAT('%',#{stationName1},'%') |
| | | </if> |
| | | </where> |
| | | ORDER BY db_battinf.tb_battinf.stationname1,db_battinf.tb_battinf.BattGroupId |
| | | </select> |
| | | <select id="searchBattGroupIdInGroup" resultType="com.whyc.pojo.Battinf"> |
| | | select distinct |
| | | db_battinf.tb_battinf.battgroupid,db_battinf.tb_battinf.stationName,db_battinf.tb_battinf.battgroupname,db_battinf.tb_battinf.moncount,db_battinf.tb_battinf.GroupIndexInFBSDevice,db_battinf.tb_battinf.FBSDeviceId |
| | | from db_battinf.tb_battinf left outer join db_user.tb_user_battgroup_baojigroup_battgroup on |
| | | db_user.tb_user_battgroup_baojigroup_battgroup.BattGroupId=db_battinf.tb_battinf.BattGroupId left outer join |
| | | db_user.tb_user_battgroup_baojigroup_usr on |
| | | db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id |
| | | left outer join db_user.tb_user_inf on tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid where |
| | | db_user.tb_user_inf.uid=#{uId} and db_battinf.tb_battinf.stationname1 like '%${uNote}%' and |
| | | db_battinf.tb_battinf.stationname like '%${UName}%' |
| | | ORDER BY db_battinf.tb_battinf.stationname1,db_battinf.tb_battinf.BattGroupId |
| | | |
| | | </select> |
| | | </select> |
| | | |
| | | <select id="getStationList" resultType="com.whyc.pojo.Battinf"> |
| | | select distinct b.StationId,b.StationName |
| | | from |
| | | db_user.tb_user_battgroup_baojigroup_battgroup bb, |
| | | (select distinct StationId,StationName from ((select StationId,StationName from db_battinf.tb_battinf) union (select StationId,StationName from db_pwrdev_inf.tb_pwrdev_inf))temp) b |
| | | db_user.tb_user_battgroup_baojigroup_battgroup bb, |
| | | (select distinct StationId,StationName from ((select StationId,StationName from db_battinf.tb_battinf) union |
| | | (select StationId,StationName from db_pwrdev_inf.tb_pwrdev_inf))temp) b |
| | | where bb.StationId = b.StationId |
| | | and bb.baoji_group_id = #{baoJiGroupId} order by b.StationName |
| | | </select> |
| | | <select id="getStationInfoList" resultType="com.whyc.pojo.Battinf"> |
| | | select distinct StationId,StationName from db_battinf.tb_battinf where StationId in |
| | | ( |
| | | <include refid="com.whyc.mapper.BattGroupStationUserMapper.sql_stationListOfUser"/> |
| | | ) |
| | | </select> |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | delete from tb_user_battgroup_baojigroup_battgroup |
| | | where num = #{num,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.whyc.pojo.BaojiGroupBattGroup"> |
| | | insert into tb_user_battgroup_baojigroup_battgroup (num, baoji_group_id, StationId, |
| | | BattGroupId) |
| | | values (#{num,jdbcType=BIGINT}, #{baojiGroupId,jdbcType=INTEGER}, #{stationid,jdbcType=INTEGER}, |
| | | #{battgroupid,jdbcType=INTEGER}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.whyc.pojo.BaojiGroupBattGroup"> |
| | | insert into tb_user_battgroup_baojigroup_battgroup |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="num != null"> |
| | | num, |
| | | </if> |
| | | <if test="baojiGroupId != null"> |
| | | baoji_group_id, |
| | | </if> |
| | | <if test="stationid != null"> |
| | | StationId, |
| | | </if> |
| | | <if test="battgroupid != null"> |
| | | BattGroupId, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="num != null"> |
| | | #{num,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="baojiGroupId != null"> |
| | | #{baojiGroupId,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="stationid != null"> |
| | | #{stationid,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="battgroupid != null"> |
| | | #{battgroupid,jdbcType=INTEGER}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.whyc.pojo.BaojiGroupBattGroup"> |
| | | update tb_user_battgroup_baojigroup_battgroup |
| | | <set> |
| | | <if test="baojiGroupId != null"> |
| | | baoji_group_id = #{baojiGroupId,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="stationid != null"> |
| | | delete from tb_user_battgroup_baojigroup_battgroup |
| | | where num = #{num,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.whyc.pojo.BaojiGroupBattGroup"> |
| | | insert into tb_user_battgroup_baojigroup_battgroup (num, baoji_group_id, StationId, |
| | | BattGroupId) |
| | | values (#{num,jdbcType=BIGINT}, #{baojiGroupId,jdbcType=INTEGER}, #{stationid,jdbcType=INTEGER}, |
| | | #{battgroupid,jdbcType=INTEGER}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.whyc.pojo.BaojiGroupBattGroup"> |
| | | insert into tb_user_battgroup_baojigroup_battgroup |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="num != null"> |
| | | num, |
| | | </if> |
| | | <if test="baojiGroupId != null"> |
| | | baoji_group_id, |
| | | </if> |
| | | <if test="stationid != null"> |
| | | StationId, |
| | | </if> |
| | | <if test="battgroupid != null"> |
| | | BattGroupId, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="num != null"> |
| | | #{num,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="baojiGroupId != null"> |
| | | #{baojiGroupId,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="stationid != null"> |
| | | #{stationid,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="battgroupid != null"> |
| | | #{battgroupid,jdbcType=INTEGER}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.whyc.pojo.BaojiGroupBattGroup"> |
| | | update tb_user_battgroup_baojigroup_battgroup |
| | | <set> |
| | | <if test="baojiGroupId != null"> |
| | | baoji_group_id = #{baojiGroupId,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="stationid != null"> |
| | | StationId = #{stationid,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="battgroupid != null"> |
| | | BattGroupId = #{battgroupid,jdbcType=INTEGER}, |
| | | </if> |
| | | </set> |
| | | where num = #{num,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.whyc.pojo.BaojiGroupBattGroup"> |
| | | update tb_user_battgroup_baojigroup_battgroup |
| | | set baoji_group_id = #{baojiGroupId,jdbcType=INTEGER}, |
| | | StationId = #{stationid,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="battgroupid != null"> |
| | | BattGroupId = #{battgroupid,jdbcType=INTEGER}, |
| | | </if> |
| | | </set> |
| | | where num = #{num,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.whyc.pojo.BaojiGroupBattGroup"> |
| | | update tb_user_battgroup_baojigroup_battgroup |
| | | set baoji_group_id = #{baojiGroupId,jdbcType=INTEGER}, |
| | | StationId = #{stationid,jdbcType=INTEGER}, |
| | | BattGroupId = #{battgroupid,jdbcType=INTEGER} |
| | | where num = #{num,jdbcType=BIGINT} |
| | | </update> |
| | | <delete id="deleteStationList"> |
| | | <foreach collection="list" item="item" separator=";" > |
| | | delete from db_user.tb_user_battgroup_baojigroup_usr where baoji_group_id = #{item.baojiGroupId} and StationId = #{item.stationId} |
| | | </foreach> |
| | | </delete> |
| | | BattGroupId = #{battgroupid,jdbcType=INTEGER} |
| | | where num = #{num,jdbcType=BIGINT} |
| | | </update> |
| | | <delete id="deleteStationList"> |
| | | <foreach collection="list" item="item" separator=";"> |
| | | delete from db_user.tb_user_battgroup_baojigroup_usr where baoji_group_id = #{item.baojiGroupId} and |
| | | StationId = #{item.stationId} |
| | | </foreach> |
| | | </delete> |
| | | </mapper> |