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.ruoyi.system.mapper.InterestsTableMapper">
-
- <resultMap type="InterestsTable" id="InterestsTableResult">
- <result property="id" column="id" />
- <result property="merchantsId" column="merchants_id" />
- <result property="merchantsName" column="merchants_name" />
- <result property="interestsPolicyId" column="interests_policy_id" />
- <result property="interestsPolicyName" column="interests_policy_name" />
- <result property="account" column="account" />
- <result property="createBy" column="create_by" />
- <result property="createTime" column="create_time" />
- <result property="updateBy" column="update_by" />
- <result property="updateTime" column="update_time" />
- <result property="isDel" column="is_del" />
- <collection property="interestsNumberTableList" javaType="java.util.List" resultMap="InterestsNumberTableResult"/>
- </resultMap>
- <resultMap type="InterestsNumberTable" id="InterestsNumberTableResult">
- <result property="id" column="id" />
- <result property="interestsId" column="interests_id" />
- <result property="rightsRank" column="rights_rank" />
- <result property="number" column="number" />
- <result property="numberId" column="numberId" />
- </resultMap>
- <sql id="selectInterestsTableVo">
- select id, merchants_id, merchants_name,interests_policy_id,interests_policy_name, account, create_by, create_time, update_by, update_time, is_del from interests_table
- </sql>
- <select id="selectInterestsTableList" parameterType="InterestsTable" resultMap="InterestsTableResult">
- select i.id, i.merchants_id, i.merchants_name,i.interests_policy_id,i.interests_policy_name, i.account, i.create_by, i.create_time, i.update_by, i.update_time, i.is_del,
- n.interests_id, n.rights_rank, n.number
- from interests_table i
- left join interests_number_table n on i.id = n.interests_id
- <where>
- <if test="merchantsName != null and merchantsName != ''"> and merchants_name like concat('%', #{merchantsName}, '%')</if>
- <if test="account != null and account != ''"> and account = #{account}</if>
- <if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if>
- </where>
- </select>
-
- <select id="selectInterestsTableById" parameterType="Long" resultMap="InterestsTableResult">
- select i.id, i.merchants_id, i.merchants_name,i.interests_policy_id,i.interests_policy_name, i.account, i.create_by, i.create_time, i.update_by, i.update_time, i.is_del,
- n.id as numberId, n.interests_id, n.rights_rank, n.number
- from interests_table i
- left join interests_number_table n on i.id = n.interests_id
- where i.id = #{id}
- </select>
-
- <insert id="insertInterestsTable" parameterType="InterestsTable" useGeneratedKeys="true" keyProperty="id">
- insert into interests_table
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="merchantsId != null">merchants_id,</if>
- <if test="merchantsName != null and merchantsName != ''">merchants_name,</if>
- <if test="interestsPolicyId != null and interestsPolicyId != ''">interests_policy_id,</if>
- <if test="interestsPolicyName != null and interestsPolicyName != ''">interests_policy_name,</if>
- <if test="account != null">account,</if>
- <if test="createBy != null">create_by,</if>
- <if test="createTime != null">create_time,</if>
- <if test="updateBy != null">update_by,</if>
- <if test="updateTime != null">update_time,</if>
- <if test="isDel != null and isDel != ''">is_del,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="merchantsId != null">#{merchantsId},</if>
- <if test="merchantsName != null and merchantsName != ''">#{merchantsName},</if>
- <if test="interestsPolicyId != null and interestsPolicyId != ''">#{interestsPolicyId},</if>
- <if test="interestsPolicyName != null and interestsPolicyName != ''">#{interestsPolicyName},</if>
- <if test="account != null">#{account},</if>
- <if test="createBy != null">#{createBy},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="updateBy != null">#{updateBy},</if>
- <if test="updateTime != null">#{updateTime},</if>
- <if test="isDel != null and isDel != ''">#{isDel},</if>
- </trim>
- </insert>
- <update id="updateInterestsTable" parameterType="InterestsTable">
- update interests_table
- <trim prefix="SET" suffixOverrides=",">
- <if test="merchantsId != null">merchants_id = #{merchantsId},</if>
- <if test="merchantsName != null and merchantsName != ''">merchants_name = #{merchantsName},</if>
- <if test="interestsPolicyId != null and interestsPolicyId != ''">interests_policy_id = #{interestsPolicyId},</if>
- <if test="interestsPolicyName != null and interestsPolicyName != ''">interests_policy_name = #{interestsPolicyName},</if>
- <if test="account != null">account = #{account},</if>
- <if test="createBy != null">create_by = #{createBy},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="updateBy != null">update_by = #{updateBy},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- <if test="isDel != null and isDel != ''">is_del = #{isDel},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteInterestsTableById" parameterType="Long">
- delete from interests_table where id = #{id}
- </delete>
- <delete id="deleteInterestsTableByIds" parameterType="String">
- delete from interests_table where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|