87 lines
3.9 KiB
XML
87 lines
3.9 KiB
XML
<?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.stdiet.custom.mapper.SysWxSaleAccountMapper">
|
|
|
|
<resultMap type="SysWxSaleAccount" id="SysWxSaleAccountResult">
|
|
<result property="id" column="id" />
|
|
<result property="nickName" column="nick_name" />
|
|
<result property="accountId" column="account_id" />
|
|
<result property="wxId" column="wx_id" />
|
|
<result property="phone" column="phone" />
|
|
<result property="remark" column="remark" />
|
|
<result property="imgUrl" column="img_url" />
|
|
<result property="count" column="count" />
|
|
<result property="mediaId" column="media_id" />
|
|
</resultMap>
|
|
|
|
<sql id="selectSysWxSaleAccountVo">
|
|
select id, nick_name, account_id, wx_id, phone, remark, img_url, count, media_id from sys_wx_sale_account
|
|
</sql>
|
|
|
|
<select id="selectSysWxSaleAccountList" parameterType="SysWxSaleAccount" resultMap="SysWxSaleAccountResult">
|
|
<include refid="selectSysWxSaleAccountVo"/>
|
|
<where>
|
|
<if test="nickName != null and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
|
|
<if test="accountId != null "> and account_id = #{accountId}</if>
|
|
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectSysWxSaleAccountById" parameterType="Long" resultMap="SysWxSaleAccountResult">
|
|
<include refid="selectSysWxSaleAccountVo"/>
|
|
where id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertSysWxSaleAccount" parameterType="SysWxSaleAccount" useGeneratedKeys="true" keyProperty="id">
|
|
insert into sys_wx_sale_account
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="nickName != null">nick_name,</if>
|
|
<if test="accountId != null">account_id,</if>
|
|
<if test="wxId != null">wx_id,</if>
|
|
<if test="phone != null">phone,</if>
|
|
<if test="remark != null">remark,</if>
|
|
<if test="imgUrl != null">img_url,</if>
|
|
<if test="count != null">count,</if>
|
|
<if test="mediaId != null">media_id,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="nickName != null">#{nickName},</if>
|
|
<if test="accountId != null">#{accountId},</if>
|
|
<if test="wxId != null">#{wxId},</if>
|
|
<if test="phone != null">#{phone},</if>
|
|
<if test="remark != null">#{remark},</if>
|
|
<if test="imgUrl != null">#{imgUrl},</if>
|
|
<if test="count != null">#{count},</if>
|
|
<if test="mediaId != null">#{mediaId},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateSysWxSaleAccount" parameterType="SysWxSaleAccount">
|
|
update sys_wx_sale_account
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="nickName != null">nick_name = #{nickName},</if>
|
|
<if test="accountId != null">account_id = #{accountId},</if>
|
|
<if test="wxId != null">wx_id = #{wxId},</if>
|
|
<if test="phone != null">phone = #{phone},</if>
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
<if test="imgUrl != null">img_url = #{imgUrl},</if>
|
|
<if test="count != null">count = #{count},</if>
|
|
<if test="mediaId != null">media_id = #{mediaId},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteSysWxSaleAccountById" parameterType="Long">
|
|
delete from sys_wx_sale_account where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteSysWxSaleAccountByIds" parameterType="String">
|
|
delete from sys_wx_sale_account where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
|
|
</mapper> |