|
@@ -1,8 +1,73 @@
|
|
|
<?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 PPW_EMAIL.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 and openStatus != ''">open_status,</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 and openStatus != ''">#{openStatus},</if>
|
|
|
+ <if test="creatorId != null and creatorId != ''">#{creatorId},</if>
|
|
|
+ <if test="updaterId != null and updaterId != ''">#{updaterId},</if>
|
|
|
+ 1,
|
|
|
+ sysdate(),
|
|
|
+ sysdate()
|
|
|
+ )
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateCompanyEmailConfig">
|
|
|
+ update PPW_EMAIL.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 and openStatus != ''">open_status=#{openStatus},</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 PPW_EMAIL.company_email_config set isvalid =0 where email=#{email}
|
|
|
</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="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="selectConfigDo">
|
|
|
+ select company_id, company_name, email, open_status, creatorid, createtime, updaterid, updatetime,isvalid
|
|
|
+ from PPW_EMAIL.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="selectConfigDo"/>
|
|
|
+ <include refid="sqlwhereSearch"/>
|
|
|
+ </select>
|
|
|
</mapper>
|