123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- <?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.CompanyEmailConfigMapper">
- <insert id="saveCompanyEmailConfig">
- insert into company_email_config(
- <if test="companyId != null and companyId != ''">company_id,</if>
- <if test="companyName != null and companyName != ''">company_name,</if>
- <if test="email != null and email != ''">email,</if>
- <if test="openStatus != null">open_status,</if>
- <if test="remark != null and remark != ''">remark,</if>
- <if test="creatorId != null and creatorId != ''">creatorid,</if>
- <if test="updaterId != null and updaterId != ''">updaterId,</if>
- isvalid,
- createtime,
- updatetime
- )values(
- <if test="companyId != null and companyId != ''">#{companyId},</if>
- <if test="companyName != null and companyName != ''">#{companyName},</if>
- <if test="email != null and email != ''">#{email},</if>
- <if test="openStatus != null">#{openStatus},</if>
- <if test="remark != null and remark != ''">#{remark},</if>
- <if test="creatorId != null and creatorId != ''">#{creatorId},</if>
- <if test="updaterId != null and updaterId != ''">#{updaterId},</if>
- 1,
- now(),
- now()
- )
- </insert>
- <update id="updateCompanyEmailConfig">
- update company_email_config
- <set>
- <if test="companyId != null and companyId != ''">company_id=#{companyId},</if>
- <if test="companyName != null and companyName != ''">company_name=#{companyName},</if>
- <if test="email != null and email != ''">email=#{email},</if>
- <if test="openStatus != null">open_status=#{openStatus},</if>
- <if test="remark != null and remark != ''">remark=#{remark},</if>
- <if test="updaterId != null and updaterId != ''">updaterid=#{updaterId},</if>
- <if test="updateTime != null">updatetime=#{updateTime},</if>
- </set>
- where id = #{id} and isvalid=1
- </update>
- <update id="deleteCompanyEmailConfig">
- update company_email_config set isvalid =0,updatetime=now(),updaterid=#{updaterId} where id=#{id}
- </update>
- <resultMap id="BaseResultMap" type="com.simuwang.base.pojo.dos.CompanyEmailConfigDO">
- <id column="id" property="id"/>
- <result column="company_id" property="companyId"/>
- <result column="company_name" property="companyName"/>
- <result column="email" property="email"/>
- <result column="open_status" property="openStatus"/>
- <result column="remark" property="remark"/>
- <result column="creatorid" property="creatorId"/>
- <result column="updaterid" property="updaterId"/>
- <result column="createtime" property="createTime"/>
- <result column="updatetime" property="updateTime"/>
- <result column="isvalid" property="isvalid"/>
- </resultMap>
- <sql id="selectCompanyEmailConfigDo">
- select id,company_id, company_name, email, open_status,remark, creatorid, createtime, updaterid, updatetime,isvalid
- from company_email_config
- </sql>
- <!-- 查询条件 -->
- <sql id="sqlwhereSearch">
- <where>
- isvalid=1
- <if test="id !=null">
- and id = #{id}
- </if>
- </where>
- </sql>
- <select id="selectCompanyEmailConfigById" resultMap="BaseResultMap">
- <include refid="selectCompanyEmailConfigDo"/>
- <include refid="sqlwhereSearch"/>
- </select>
- <select id="searchEmailByCompanyId" resultType="java.lang.String" parameterType="java.lang.String">
- select email from company_email_config where company_id = #{companyId} and isvalid =1
- </select>
- <resultMap id="BaseVOMap" type="com.simuwang.base.pojo.vo.CompanyEmailConfigVO">
- <id column="id" property="id"/>
- <result column="company_id" property="companyId"/>
- <result column="company_name" property="companyName"/>
- <result column="email" property="email"/>
- <result column="open_status" property="openStatus"/>
- <result column="remark" property="sendRemark"/>
- </resultMap>
- <select id="searchEmailConfig" resultMap="BaseVOMap">
- select id,company_id,company_name,email,open_status,remark from
- company_email_config where isvalid =1 and company_id=#{companyId}
- limit #{offset},#{pageSize}
- </select>
- <select id="countEmailConfig" resultType="java.lang.Long" parameterType="java.lang.String">
- select count(1) from company_email_config where isvalid =1 and company_id=#{companyId}
- </select>
- <select id="searchEmailConfigByCompanyId" resultMap="BaseVOMap">
- select id,company_id,company_name,email,open_status,remark from
- company_email_config where isvalid =1 and company_id=#{companyId}
- </select>
- <select id="selectEmailConfig" resultMap="BaseResultMap">
- select id,company_id,company_name,email,open_status,remark from
- company_email_config where isvalid =1 and company_id=#{companyId} and email=#{email} limit 1
- </select>
- <select id="getAllCompanyConfig" resultMap="BaseResultMap">
- select id,company_id,company_name,email,open_status,remark from
- company_email_config where isvalid =1 and open_status=1
- </select>
- <select id="selectCompanyEmailConfigByIdList" resultMap="BaseResultMap">
- select id,company_id,company_name,email,open_status,remark from
- company_email_config where isvalid =1 and open_status=1
- and id in
- <foreach item="id" collection="idList" open="(" separator="," close=")">
- #{id}
- </foreach>
- </select>
- </mapper>
|