<?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.project.tr.methodCriterion.mapper.MethodCriterionMapper">
|
|
<resultMap type="MethodCriterion" id="MethodCriterionResult">
|
<result property="criterionId" column="criterion_id" />
|
<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="criterionName" column="criterion_name" />
|
<result property="companyId" column="company_id" />
|
<result property="methodId" column="method_id" />
|
</resultMap>
|
|
<sql id="selectMethodCriterionVo">
|
select criterion_id, create_by, create_time, update_by, update_time, remark, criterion_name, company_id, method_id from tr_method_criterion
|
</sql>
|
|
<select id="selectMethodCriterionList" parameterType="MethodCriterion" resultMap="MethodCriterionResult">
|
<include refid="selectMethodCriterionVo"/>
|
<where>
|
<if test="criterionId != null "> and criterion_id = #{criterionId}</if>
|
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
|
<if test="createTime != null "> and create_time = #{createTime}</if>
|
<if test="criterionName != null and criterionName != ''"> and criterion_name like concat('%', #{criterionName}, '%')</if>
|
<if test="companyId != null "> and company_id = #{companyId}</if>
|
<if test="methodId != null "> and method_id = #{methodId}</if>
|
</where>
|
</select>
|
|
<select id="selectMethodCriterionById" parameterType="Long" resultMap="MethodCriterionResult">
|
<include refid="selectMethodCriterionVo"/>
|
where criterion_id = #{criterionId}
|
</select>
|
|
<insert id="insertMethodCriterion" parameterType="MethodCriterion">
|
insert into tr_method_criterion
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="criterionId != null ">criterion_id,</if>
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
<if test="createTime != null ">create_time,</if>
|
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
<if test="updateTime != null ">update_time,</if>
|
<if test="remark != null and remark != ''">remark,</if>
|
<if test="criterionName != null and criterionName != ''">criterion_name,</if>
|
<if test="companyId != null ">company_id,</if>
|
<if test="methodId != null ">method_id,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="criterionId != null ">#{criterionId},</if>
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
<if test="createTime != null ">#{createTime},</if>
|
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
<if test="updateTime != null ">#{updateTime},</if>
|
<if test="remark != null and remark != ''">#{remark},</if>
|
<if test="criterionName != null and criterionName != ''">#{criterionName},</if>
|
<if test="companyId != null ">#{companyId},</if>
|
<if test="methodId != null ">#{methodId},</if>
|
</trim>
|
</insert>
|
|
<update id="updateMethodCriterion" parameterType="MethodCriterion">
|
update tr_method_criterion
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
<if test="createTime != null ">create_time = #{createTime},</if>
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
<if test="updateTime != null ">update_time = #{updateTime},</if>
|
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
<if test="criterionName != null and criterionName != ''">criterion_name = #{criterionName},</if>
|
<if test="companyId != null ">company_id = #{companyId},</if>
|
<if test="methodId != null ">method_id = #{methodId},</if>
|
</trim>
|
where criterion_id = #{criterionId}
|
</update>
|
|
<delete id="deleteMethodCriterionById" parameterType="Long">
|
delete from tr_method_criterion where criterion_id = #{criterionId}
|
</delete>
|
|
<delete id="deleteMethodCriterionByIds" parameterType="String">
|
delete from tr_method_criterion where criterion_id in
|
<foreach item="criterionId" collection="array" open="(" separator="," close=")">
|
#{criterionId}
|
</foreach>
|
</delete>
|
|
</mapper>
|