<?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.tms.mapper.TmsQuotePlanMapper">
|
|
<resultMap type="com.ruoyi.tms.domain.TmsQuotePlan" id="TmsQuotePlanResult">
|
<result property="id" column="id" />
|
<result property="systemCode" column="system_code" />
|
<result property="planName" column="plan_name" />
|
<result property="customerId" column="customer_id" />
|
<result property="customerName" column="customer_name" />
|
<result property="projectId" column="project_id" />
|
<result property="projectName" column="project_name" />
|
<result property="contractId" column="contract_id" />
|
<result property="contractName" column="contract_name" />
|
<result property="effectiveDate" column="effective_date" />
|
<result property="expiryDate" column="expiry_date" />
|
<result property="status" column="status" />
|
<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="remark" column="remark" />
|
<result property="planType" column="plan_type" />
|
</resultMap>
|
|
<sql id="selectTmsQuotePlanVo">
|
select thisTab.id, thisTab.system_code, thisTab.plan_name, thisTab.customer_id, thisTab.customer_name, thisTab.project_id, thisTab.project_name, thisTab.contract_id, thisTab.contract_name, thisTab.effective_date, thisTab.expiry_date, thisTab.status, thisTab.create_by, thisTab.create_time, thisTab.update_by, thisTab.update_time, thisTab.remark, thisTab.plan_type from tms_quote_plan AS thisTab
|
</sql>
|
<sql id="selectTmsQuotePlanVoCount">
|
select count(0) from tms_quote_plan as thisTab
|
</sql>
|
|
<sql id="whereCondition">
|
<if test="systemCode != null and systemCode != ''"> and thisTab.system_code = #{systemCode}</if>
|
<if test="planName != null and planName != ''"> and thisTab.plan_name like concat('%', #{planName}, '%')</if>
|
<if test="customerId != null "> and thisTab.customer_id = #{customerId}</if>
|
<if test="customerName != null and customerName != ''"> and thisTab.customer_name like concat('%', #{customerName}, '%')</if>
|
<if test="projectId != null "> and thisTab.project_id = #{projectId}</if>
|
<if test="projectName != null and projectName != ''"> and thisTab.project_name like concat('%', #{projectName}, '%')</if>
|
<if test="contractId != null "> and thisTab.contract_id = #{contractId}</if>
|
<if test="contractName != null and contractName != ''"> and thisTab.contract_name like concat('%', #{contractName}, '%')</if>
|
<if test="effectiveDate != null "> and thisTab.effective_date = #{effectiveDate}</if>
|
<if test="expiryDate != null "> and thisTab.expiry_date = #{expiryDate}</if>
|
<if test="status != null "> and thisTab.status = #{status}</if>
|
<if test="planType != null "> and thisTab.plan_type = #{planType}</if>
|
</sql>
|
|
<!--查询-->
|
<select id="selectTmsQuotePlanById" parameterType="Integer" resultMap="TmsQuotePlanResult">
|
<include refid="selectTmsQuotePlanVo"/>
|
where id = #{id}
|
</select>
|
|
<select id="selectTmsQuotePlanCount" parameterType="com.ruoyi.tms.domain.TmsQuotePlan" resultType="int">
|
<include refid="selectTmsQuotePlanVoCount"/>
|
<where>
|
<include refid="whereCondition"/>
|
</where>
|
</select>
|
|
|
<select id="selectTmsQuotePlanList" parameterType="com.ruoyi.tms.domain.TmsQuotePlan" resultMap="TmsQuotePlanResult">
|
<include refid="selectTmsQuotePlanVo"/>
|
<where>
|
<include refid="whereCondition"/>
|
</where>
|
order by thisTab.id desc
|
</select>
|
|
<!-- 新增 -->
|
<insert id="insertTmsQuotePlan" parameterType="com.ruoyi.tms.domain.TmsQuotePlan" useGeneratedKeys="true" keyProperty="id">
|
insert into tms_quote_plan
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="systemCode != null and systemCode != ''">system_code,</if>
|
<if test="planName != null and planName != ''">plan_name,</if>
|
<if test="customerId != null">customer_id,</if>
|
<if test="customerName != null and customerName != ''">customer_name,</if>
|
<if test="projectId != null">project_id,</if>
|
<if test="projectName != null and projectName != ''">project_name,</if>
|
<if test="contractId != null">contract_id,</if>
|
<if test="contractName != null and contractName != ''">contract_name,</if>
|
<if test="effectiveDate != null">effective_date,</if>
|
<if test="expiryDate != null">expiry_date,</if>
|
<if test="status != null">status,</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="remark != null">remark,</if>
|
<if test="planType != null">plan_type,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="systemCode != null and systemCode != ''">#{systemCode},</if>
|
<if test="planName != null and planName != ''">#{planName},</if>
|
<if test="customerId != null">#{customerId},</if>
|
<if test="customerName != null and customerName != ''">#{customerName},</if>
|
<if test="projectId != null">#{projectId},</if>
|
<if test="projectName != null and projectName != ''">#{projectName},</if>
|
<if test="contractId != null">#{contractId},</if>
|
<if test="contractName != null and contractName != ''">#{contractName},</if>
|
<if test="effectiveDate != null">#{effectiveDate},</if>
|
<if test="expiryDate != null">#{expiryDate},</if>
|
<if test="status != null">#{status},</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="remark != null">#{remark},</if>
|
<if test="planType != null">#{planType},</if>
|
</trim>
|
</insert>
|
|
<insert id="insertTmsQuotePlanBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
|
insert into tms_quote_plan
|
<trim prefix="(" suffix=") values" suffixOverrides=",">
|
id,system_code,plan_name,customer_id,customer_name,project_id,project_name,contract_id,contract_name,effective_date,expiry_date,status,create_by,create_time,update_by,update_time,remark,plan_type,
|
</trim>
|
<foreach item="item" index="index" collection="list" separator=",">
|
<trim prefix="(" suffix=") " suffixOverrides=",">
|
#{item.id},#{item.systemCode},#{item.planName},#{item.customerId},#{item.customerName},#{item.projectId},#{item.projectName},#{item.contractId},#{item.contractName},#{item.effectiveDate},#{item.expiryDate},#{item.status},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.remark},#{item.planType},
|
</trim>
|
</foreach>
|
</insert>
|
|
<!-- 修改 -->
|
<update id="updateTmsQuotePlan" parameterType="com.ruoyi.tms.domain.TmsQuotePlan">
|
update tms_quote_plan
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="systemCode != null and systemCode != ''">system_code = #{systemCode},</if>
|
<if test="planName != null and planName != ''">plan_name = #{planName},</if>
|
<if test="customerId != null">customer_id = #{customerId},</if>
|
<if test="customerName != null and customerName != ''">customer_name = #{customerName},</if>
|
<if test="projectId != null">project_id = #{projectId},</if>
|
<if test="projectName != null and projectName != ''">project_name = #{projectName},</if>
|
<if test="contractId != null">contract_id = #{contractId},</if>
|
<if test="contractName != null and contractName != ''">contract_name = #{contractName},</if>
|
<if test="effectiveDate != null">effective_date = #{effectiveDate},</if>
|
<if test="expiryDate != null">expiry_date = #{expiryDate},</if>
|
<if test="status != null">status = #{status},</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="remark != null">remark = #{remark},</if>
|
<if test="planType != null">plan_type = #{planType},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
<!-- 修改 -->
|
<update id="updateTmsQuotePlanBatch" parameterType="java.util.List">
|
<foreach collection="list" item="item" index="index" separator=";">
|
update tms_quote_plan
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="item.systemCode != null and item.systemCode != ''">system_code = #{item.systemCode},</if>
|
<if test="item.planName != null and item.planName != ''">plan_name = #{item.planName},</if>
|
<if test="item.customerId != null">customer_id = #{item.customerId},</if>
|
<if test="item.customerName != null and item.customerName != ''">customer_name = #{item.customerName},</if>
|
<if test="item.projectId != null">project_id = #{item.projectId},</if>
|
<if test="item.projectName != null and item.projectName != ''">project_name = #{item.projectName},</if>
|
<if test="item.contractId != null">contract_id = #{item.contractId},</if>
|
<if test="item.contractName != null and item.contractName != ''">contract_name = #{item.contractName},</if>
|
<if test="item.effectiveDate != null">effective_date = #{item.effectiveDate},</if>
|
<if test="item.expiryDate != null">expiry_date = #{item.expiryDate},</if>
|
<if test="item.status != null">status = #{item.status},</if>
|
<if test="item.createBy != null">create_by = #{item.createBy},</if>
|
<if test="item.createTime != null">create_time = #{item.createTime},</if>
|
<if test="item.updateBy != null">update_by = #{item.updateBy},</if>
|
<if test="item.updateTime != null">update_time = #{item.updateTime},</if>
|
<if test="item.remark != null">remark = #{item.remark},</if>
|
<if test="item.planType != null">plan_type = #{item.planType},</if>
|
</trim>
|
where id = #{item.id}
|
</foreach>
|
</update>
|
|
<!--删除-->
|
<delete id="deleteTmsQuotePlanById" parameterType="Integer">
|
delete from tms_quote_plan where id = #{id}
|
</delete>
|
<delete id="deleteTmsQuotePlanByIds" parameterType="Integer">
|
delete from tms_quote_plan where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
|
</mapper>
|