123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- <?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.simuwang.base.mapper.daq.ChannelMapper">
- <resultMap id="BaseResultMap" type="com.simuwang.base.pojo.dos.ChannelInfoDO" >
- <id column="id" property="id" jdbcType="INTEGER" />
- <result column="channel_name" property="channelName" jdbcType="VARCHAR" />
- <result column="channel_remark" property="channelRemark" jdbcType="VARCHAR" />
- <result column="creatorid" property="creatorId" jdbcType="INTEGER" />
- <result column="createtime" property="createTime" jdbcType="TIMESTAMP" />
- <result column="updaterid" property="updaterId" jdbcType="INTEGER" />
- <result column="updatetime" property="updateTime" jdbcType="TIMESTAMP" />
- <result column="isvalid" property="isvalid" jdbcType="INTEGER" />
- </resultMap>
- <delete id="deleteChannelById">
- update channel_info set isvalid=0,updatetime=now(),updaterid=#{userId} where id=#{id}
- </delete>
- <select id="selectByChannelName" resultMap="BaseResultMap">
- select * from channel_info where isvalid=1 and channel_name=#{channelName}
- </select>
- <resultMap id="BasePageResultMap" type="com.simuwang.base.pojo.dos.ChannelPageInfoDO" >
- <id column="id" property="id" jdbcType="INTEGER" />
- <result column="channel_name" property="channelName" jdbcType="VARCHAR" />
- <result column="user_name" property="userName" jdbcType="VARCHAR" />
- <result column="user_id" property="userId" jdbcType="VARCHAR" />
- <result column="responbility_email" property="responbilityEmail" jdbcType="VARCHAR" />
- <result column="email" property="email" jdbcType="VARCHAR" />
- <result column="channel_remark" property="channelRemark" jdbcType="VARCHAR" />
- <result column="creatorid" property="creatorId" jdbcType="INTEGER" />
- <result column="createtime" property="createTime" jdbcType="TIMESTAMP" />
- <result column="updaterid" property="updaterId" jdbcType="INTEGER" />
- <result column="updatetime" property="updateTime" jdbcType="TIMESTAMP" />
- <result column="isvalid" property="isvalid" jdbcType="INTEGER" />
- </resultMap>
- <select id="searchChannelList" resultMap="BasePageResultMap">
- select info.id,
- info.channel_name,
- info.channel_remark
- from channel_info info
- join user_channel_mapping e
- on info.id = e.channel_id
- where info.isvalid=1 and e.isvalid=1
- <if test="userId !=null and userId !=''">
- and e.user_id=#{userId}
- </if>
- group by info.id,info.channel_name,info.channel_remark
- limit #{offset},#{pageSize}
- </select>
- <select id="countChannelInfo" resultType="java.lang.Long">
- select count(distinct info.id) from channel_info info
- join user_channel_mapping e
- on info.id = e.channel_id
- where info.isvalid=1 and e.isvalid=1
- <if test="userId !=null and userId !=''">
- and e.user_id=#{userId}
- </if>
- </select>
- <select id="selectChannelIdByEmail" resultType="java.lang.Integer">
- select channel_id from channel_email_info where isvalid=1 and email=#{email}
- </select>
- <select id="searchChannelPage" resultMap="BasePageResultMap">
- select info.id,
- info.channel_name,
- info.channel_remark,
- wm_concat(e.email) as email,
- info.createtime,
- info.updatetime,
- info.isvalid,
- info.creatorid,
- info.updaterid,
- su.user_id,
- su.user_name,
- su.email as responbility_email
- from channel_info info
- left join channel_email_info e
- on info.id = e.channel_id and e.isvalid=1
- left join channel_responsibility_mapping crm
- on crm.channel_id = info.id and crm.isvalid=1
- left join sys_user su
- on su.user_id = crm.user_id and su.isvalid=1
- where info.isvalid=1
- <if test="channelName != null and channelName !=''">
- and info.channel_name like concat('%',#{channelName},'%')
- </if>
- GROUP BY info.channel_name
- order by info.createtime
- limit #{offset},#{pageSize}
- </select>
- <select id="countChannelInfoPage" resultType="java.lang.Long">
- select count(*) from channel_info where isvalid=1
- <if test="channelName != null and channelName !=''">
- and channel_name like concat('%',#{channelName},'%')
- </if>
- </select>
- <select id="selectAllChannel" resultMap="BaseResultMap">
- select id,channel,email,channel_remark from channel_info
- where isvalid=1
- </select>
- </mapper>
|