|
@@ -0,0 +1,144 @@
|
|
|
+<?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.ruixuan.jinniu.mapper.RxProjectMapper">
|
|
|
+
|
|
|
+ <resultMap type="com.ruixuan.jinniu.entity.RxProject" id="RxProjectResult">
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="projectName" column="project_name"/>
|
|
|
+ <result property="mediaCode" column="media_code"/>
|
|
|
+ <result property="supplierCode" column="supplier_code"/>
|
|
|
+ <result property="saleId" column="sale_id"/>
|
|
|
+ <result property="saleName" column="sale_name"/>
|
|
|
+ <result property="businessId" column="business_id"/>
|
|
|
+ <result property="businessName" column="business_name"/>
|
|
|
+ <result property="designResponsibleId" column="design_responsible_id"/>
|
|
|
+ <result property="designResponsibleName" column="design_responsible_name"/>
|
|
|
+ <result property="ocpxActionType" column="ocpx_action_type"/>
|
|
|
+ <result property="advertiserName" column="advertiser_name"/>
|
|
|
+ <result property="advertiserId" column="advertiser_id"/>
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
+ <result property="updateTime" column="update_time"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectRxProjectVo">
|
|
|
+ select id,
|
|
|
+ project_name,
|
|
|
+ media_code,
|
|
|
+ supplier_code,
|
|
|
+ sale_id,
|
|
|
+ sale_name,
|
|
|
+ business_id,
|
|
|
+ business_name,
|
|
|
+ design_responsible_id,
|
|
|
+ design_responsible_name,
|
|
|
+ ocpx_action_type,
|
|
|
+ advertiser_name,
|
|
|
+ advertiser_id,
|
|
|
+ create_time,
|
|
|
+ update_time
|
|
|
+ from rx_project
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectRxProjectList" parameterType="com.ruixuan.jinniu.entity.RxProject" resultMap="RxProjectResult">
|
|
|
+ <include refid="selectRxProjectVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="projectName != null and projectName != ''">and project_name like concat('%', #{projectName},
|
|
|
+ '%')
|
|
|
+ </if>
|
|
|
+ <if test="mediaCode != null and mediaCode != ''">and media_code = #{mediaCode}</if>
|
|
|
+ <if test="supplierCode != null and supplierCode != ''">and supplier_code = #{supplierCode}</if>
|
|
|
+ <if test="saleId != null ">and sale_id = #{saleId}</if>
|
|
|
+ <if test="saleName != null and saleName != ''">and sale_name like concat('%', #{saleName}, '%')</if>
|
|
|
+ <if test="businessId != null ">and business_id = #{businessId}</if>
|
|
|
+ <if test="businessName != null and businessName != ''">and business_name like concat('%', #{businessName},
|
|
|
+ '%')
|
|
|
+ </if>
|
|
|
+ <if test="designResponsibleId != null ">and design_responsible_id = #{designResponsibleId}</if>
|
|
|
+ <if test="designResponsibleName != null and designResponsibleName != ''">and design_responsible_name like
|
|
|
+ concat('%', #{designResponsibleName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="ocpxActionType != null and ocpxActionType != ''">and ocpx_action_type = #{ocpxActionType}</if>
|
|
|
+ <if test="advertiserName != null and advertiserName != ''">and advertiser_name like concat('%',
|
|
|
+ #{advertiserName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="advertiserId != null and advertiserId != ''">and advertiser_id = #{advertiserId}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectRxProjectById" parameterType="Long" resultMap="RxProjectResult">
|
|
|
+ <include refid="selectRxProjectVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertRxProject" parameterType="com.ruixuan.jinniu.entity.RxProject" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into rx_project
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="projectName != null">project_name,</if>
|
|
|
+ <if test="mediaCode != null">media_code,</if>
|
|
|
+ <if test="supplierCode != null">supplier_code,</if>
|
|
|
+ <if test="saleId != null">sale_id,</if>
|
|
|
+ <if test="saleName != null">sale_name,</if>
|
|
|
+ <if test="businessId != null">business_id,</if>
|
|
|
+ <if test="businessName != null">business_name,</if>
|
|
|
+ <if test="designResponsibleId != null">design_responsible_id,</if>
|
|
|
+ <if test="designResponsibleName != null">design_responsible_name,</if>
|
|
|
+ <if test="ocpxActionType != null">ocpx_action_type,</if>
|
|
|
+ <if test="advertiserName != null">advertiser_name,</if>
|
|
|
+ <if test="advertiserId != null">advertiser_id,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="projectName != null">#{projectName},</if>
|
|
|
+ <if test="mediaCode != null">#{mediaCode},</if>
|
|
|
+ <if test="supplierCode != null">#{supplierCode},</if>
|
|
|
+ <if test="saleId != null">#{saleId},</if>
|
|
|
+ <if test="saleName != null">#{saleName},</if>
|
|
|
+ <if test="businessId != null">#{businessId},</if>
|
|
|
+ <if test="businessName != null">#{businessName},</if>
|
|
|
+ <if test="designResponsibleId != null">#{designResponsibleId},</if>
|
|
|
+ <if test="designResponsibleName != null">#{designResponsibleName},</if>
|
|
|
+ <if test="ocpxActionType != null">#{ocpxActionType},</if>
|
|
|
+ <if test="advertiserName != null">#{advertiserName},</if>
|
|
|
+ <if test="advertiserId != null">#{advertiserId},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateRxProject" parameterType="com.ruixuan.jinniu.entity.RxProject">
|
|
|
+ update rx_project
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="projectName != null">project_name = #{projectName},</if>
|
|
|
+ <if test="mediaCode != null">media_code = #{mediaCode},</if>
|
|
|
+ <if test="supplierCode != null">supplier_code = #{supplierCode},</if>
|
|
|
+ <if test="saleId != null">sale_id = #{saleId},</if>
|
|
|
+ <if test="saleName != null">sale_name = #{saleName},</if>
|
|
|
+ <if test="businessId != null">business_id = #{businessId},</if>
|
|
|
+ <if test="businessName != null">business_name = #{businessName},</if>
|
|
|
+ <if test="designResponsibleId != null">design_responsible_id = #{designResponsibleId},</if>
|
|
|
+ <if test="designResponsibleName != null">design_responsible_name = #{designResponsibleName},</if>
|
|
|
+ <if test="ocpxActionType != null">ocpx_action_type = #{ocpxActionType},</if>
|
|
|
+ <if test="advertiserName != null">advertiser_name = #{advertiserName},</if>
|
|
|
+ <if test="advertiserId != null">advertiser_id = #{advertiserId},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteRxProjectById" parameterType="Long">
|
|
|
+ delete
|
|
|
+ from rx_project
|
|
|
+ where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteRxProjectByIds" parameterType="String">
|
|
|
+ delete from rx_project where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|