123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- <?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.HostedEmailInfoMapper">
- <resultMap id="BaseResultMap" type="com.simuwang.base.pojo.dos.HostedEmailInfoDO" >
- <id column="id" property="id" jdbcType="INTEGER" />
- <result column="company_id" property="companyId" jdbcType="VARCHAR" />
- <result column="company_name" property="companyName" jdbcType="VARCHAR" />
- <result column="email" property="email" 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" />
- <result column="open_status" property="openStatus" jdbcType="INTEGER" />
- </resultMap>
- <insert id="saveHostedEmailInfoDO">
- insert into hosted_email_info(company_id,email,creatorid,createtime,updaterid,updatetime,isvalid,open_status)
- values
- (#{companyId},#{email},#{creatorId},#{createTime},#{updaterId},#{updateTime},#{isvalid},#{openStatus})
- </insert>
- <update id="deleteHostEmail">
- update hosted_email_info set isvalid=0,updaterid=#{userId} where id in
- <foreach item="id" collection="idList" open="(" separator="," close=")">
- #{id}
- </foreach>
- </update>
- <select id="selectHostedEmailInfoDO" resultMap="BaseResultMap">
- select hei.id,
- hei.company_id,
- ci.company_name,
- hei.open_status,
- hei.email,
- hei.creatorid,
- hei.createtime,
- hei.updaterid,
- hei.updatetime,
- hei.isvalid
- from hosted_email_info hei
- join pvn_company_info ci
- on ci.company_id = hei.company_id
- where hei.isvalid=1 and ci.isvalid=1 and hei.email=#{email}
- </select>
- <select id="searchHostEmailPage" resultMap="BaseResultMap">
- select hei.id,
- hei.company_id,
- ci.company_name,
- hei.email,
- hei.open_status,
- hei.creatorid,
- hei.createtime,
- hei.updaterid,
- hei.updatetime,
- hei.isvalid
- from hosted_email_info hei
- join pvn_company_info ci
- on ci.company_id = hei.company_id
- where hei.isvalid=1 and ci.isvalid=1
- <if test="companyName != null and companyName != ''">
- and (ci.company_name like concat('%',#{companyName},'%') or ci.company_short_name like concat('%',#{companyName},'%'))
- </if>
- <if test="email != null and email != ''">
- and hei.email like concat('%',#{email},'%')
- </if>
- <if test="openStatus != null">
- and hei.open_status =#{openStatus}
- </if>
- limit #{offset},#{pageSize}
- </select>
- <select id="countHostEmailPage" resultType="java.lang.Long">
- select count(hei.id)
- from hosted_email_info hei
- join pvn_company_info ci
- on ci.company_id = hei.company_id
- where hei.isvalid=1 and ci.isvalid=1
- <if test="companyName != null and companyName != ''">
- and (ci.company_name like concat('%',#{companyName},'%') or ci.company_short_name like concat('%',#{companyName},'%'))
- </if>
- <if test="email != null and email != ''">
- and hei.email like concat('%',#{email},'%')
- </if>
- <if test="openStatus != null">
- and hei.open_status =#{openStatus}
- </if>
- </select>
- <select id="getAllHostedEmail" resultType="java.lang.String">
- select email from hosted_email_info where isvalid=1 and open_status=1 group by email
- </select>
- </mapper>
|