|
@@ -0,0 +1,76 @@
|
|
|
|
|
+<?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.fs.his.mapper.FsSubMerchantMapper">
|
|
|
|
|
+
|
|
|
|
|
+ <resultMap type="FsSubMerchant" id="FsSubMerchantResult">
|
|
|
|
|
+ <result property="id" column="id" />
|
|
|
|
|
+ <result property="merchantName" column="merchant_name" />
|
|
|
|
|
+ <result property="merchantNo" column="merchant_no" />
|
|
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
|
|
+ <result property="masterMerchantNo" column="master_merchant_no" />
|
|
|
|
|
+ </resultMap>
|
|
|
|
|
+
|
|
|
|
|
+ <sql id="selectFsSubMerchantVo">
|
|
|
|
|
+ select id, merchant_name, merchant_no, create_time, update_time, master_merchant_no from fs_sub_merchant
|
|
|
|
|
+ </sql>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectFsSubMerchantList" parameterType="FsSubMerchant" resultMap="FsSubMerchantResult">
|
|
|
|
|
+ <include refid="selectFsSubMerchantVo"/>
|
|
|
|
|
+ <where>
|
|
|
|
|
+ <if test="merchantName != null and merchantName != ''"> and merchant_name like concat('%', #{merchantName}, '%')</if>
|
|
|
|
|
+ <if test="merchantNo != null and merchantNo != ''"> and merchant_no = #{merchantNo}</if>
|
|
|
|
|
+ <if test="masterMerchantNo != null and masterMerchantNo != ''"> and master_merchant_no = #{masterMerchantNo}</if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectFsSubMerchantById" parameterType="Long" resultMap="FsSubMerchantResult">
|
|
|
|
|
+ <include refid="selectFsSubMerchantVo"/>
|
|
|
|
|
+ where id = #{id}
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <insert id="insertFsSubMerchant" parameterType="FsSubMerchant">
|
|
|
|
|
+ insert into fs_sub_merchant
|
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
+ <if test="id != null">id,</if>
|
|
|
|
|
+ <if test="merchantName != null">merchant_name,</if>
|
|
|
|
|
+ <if test="merchantNo != null">merchant_no,</if>
|
|
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
|
|
+ <if test="masterMerchantNo != null">master_merchant_no,</if>
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
+ <if test="id != null">#{id},</if>
|
|
|
|
|
+ <if test="merchantName != null">#{merchantName},</if>
|
|
|
|
|
+ <if test="merchantNo != null">#{merchantNo},</if>
|
|
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
|
|
+ <if test="masterMerchantNo != null">#{masterMerchantNo},</if>
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ </insert>
|
|
|
|
|
+
|
|
|
|
|
+ <update id="updateFsSubMerchant" parameterType="FsSubMerchant">
|
|
|
|
|
+ update fs_sub_merchant
|
|
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
+ <if test="merchantName != null">merchant_name = #{merchantName},</if>
|
|
|
|
|
+ <if test="merchantNo != null">merchant_no = #{merchantNo},</if>
|
|
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
|
|
+ <if test="masterMerchantNo != null">master_merchant_no = #{masterMerchantNo},</if>
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ where id = #{id}
|
|
|
|
|
+ </update>
|
|
|
|
|
+
|
|
|
|
|
+ <delete id="deleteFsSubMerchantById" parameterType="Long">
|
|
|
|
|
+ delete from fs_sub_merchant where id = #{id}
|
|
|
|
|
+ </delete>
|
|
|
|
|
+
|
|
|
|
|
+ <delete id="deleteFsSubMerchantByIds" parameterType="String">
|
|
|
|
|
+ delete from fs_sub_merchant where id in
|
|
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
|
+ #{id}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </delete>
|
|
|
|
|
+</mapper>
|