91 lines
4.9 KiB
XML
91 lines
4.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.ruoyi.system.mapper.FateJobPromotionsMapper">
|
|
|
|
<resultMap type="FateJobPromotions" id="FateJobPromotionsResult">
|
|
<result property="promotionId" column="promotion_id" />
|
|
<result property="fromJobId" column="from_job_id" />
|
|
<result property="toJobId" column="to_job_id" />
|
|
<result property="requiredLevel" column="required_level" />
|
|
<result property="requiredItems" column="required_items" />
|
|
<result property="requiredSkills" column="required_skills" />
|
|
<result property="successRate" column="success_rate" />
|
|
<result property="description" column="description" />
|
|
<result property="createdAt" column="created_at" />
|
|
</resultMap>
|
|
|
|
<sql id="selectFateJobPromotionsVo">
|
|
select promotion_id, from_job_id, to_job_id, required_level, required_items, required_skills, success_rate, description, created_at from fate_job_promotions
|
|
</sql>
|
|
|
|
<select id="selectFateJobPromotionsList" parameterType="FateJobPromotions" resultMap="FateJobPromotionsResult">
|
|
<include refid="selectFateJobPromotionsVo"/>
|
|
<where>
|
|
<if test="fromJobId != null "> and from_job_id = #{fromJobId}</if>
|
|
<if test="toJobId != null "> and to_job_id = #{toJobId}</if>
|
|
<if test="requiredLevel != null "> and required_level = #{requiredLevel}</if>
|
|
<if test="requiredItems != null and requiredItems != ''"> and required_items = #{requiredItems}</if>
|
|
<if test="requiredSkills != null and requiredSkills != ''"> and required_skills = #{requiredSkills}</if>
|
|
<if test="successRate != null "> and success_rate = #{successRate}</if>
|
|
<if test="description != null and description != ''"> and description = #{description}</if>
|
|
<if test="createdAt != null "> and created_at = #{createdAt}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectFateJobPromotionsByPromotionId" parameterType="Long" resultMap="FateJobPromotionsResult">
|
|
<include refid="selectFateJobPromotionsVo"/>
|
|
where promotion_id = #{promotionId}
|
|
</select>
|
|
|
|
<insert id="insertFateJobPromotions" parameterType="FateJobPromotions" useGeneratedKeys="true" keyProperty="promotionId">
|
|
insert into fate_job_promotions
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="fromJobId != null">from_job_id,</if>
|
|
<if test="toJobId != null">to_job_id,</if>
|
|
<if test="requiredLevel != null">required_level,</if>
|
|
<if test="requiredItems != null">required_items,</if>
|
|
<if test="requiredSkills != null">required_skills,</if>
|
|
<if test="successRate != null">success_rate,</if>
|
|
<if test="description != null">description,</if>
|
|
<if test="createdAt != null">created_at,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="fromJobId != null">#{fromJobId},</if>
|
|
<if test="toJobId != null">#{toJobId},</if>
|
|
<if test="requiredLevel != null">#{requiredLevel},</if>
|
|
<if test="requiredItems != null">#{requiredItems},</if>
|
|
<if test="requiredSkills != null">#{requiredSkills},</if>
|
|
<if test="successRate != null">#{successRate},</if>
|
|
<if test="description != null">#{description},</if>
|
|
<if test="createdAt != null">#{createdAt},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateFateJobPromotions" parameterType="FateJobPromotions">
|
|
update fate_job_promotions
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="fromJobId != null">from_job_id = #{fromJobId},</if>
|
|
<if test="toJobId != null">to_job_id = #{toJobId},</if>
|
|
<if test="requiredLevel != null">required_level = #{requiredLevel},</if>
|
|
<if test="requiredItems != null">required_items = #{requiredItems},</if>
|
|
<if test="requiredSkills != null">required_skills = #{requiredSkills},</if>
|
|
<if test="successRate != null">success_rate = #{successRate},</if>
|
|
<if test="description != null">description = #{description},</if>
|
|
<if test="createdAt != null">created_at = #{createdAt},</if>
|
|
</trim>
|
|
where promotion_id = #{promotionId}
|
|
</update>
|
|
|
|
<delete id="deleteFateJobPromotionsByPromotionId" parameterType="Long">
|
|
delete from fate_job_promotions where promotion_id = #{promotionId}
|
|
</delete>
|
|
|
|
<delete id="deleteFateJobPromotionsByPromotionIds" parameterType="String">
|
|
delete from fate_job_promotions where promotion_id in
|
|
<foreach item="promotionId" collection="array" open="(" separator="," close=")">
|
|
#{promotionId}
|
|
</foreach>
|
|
</delete>
|
|
</mapper> |