You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
2.7 KiB

<?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.programManagement.mapper.BStandardizationMapper">
<resultMap type="BStandardization" id="BStandardizationResult">
<result property="id" column="id" />
<result property="enterpriseName" column="enterprise_name" />
<result property="standardizedGrade" column="standardized_grade" />
</resultMap>
<sql id="selectBStandardizationVo">
select id, enterprise_name, standardized_grade from b_standardization
</sql>
<select id="selectBStandardizationList" parameterType="BStandardization" resultMap="BStandardizationResult">
<include refid="selectBStandardizationVo"/>
<where>
<if test="enterpriseName != null and enterpriseName != ''"> and enterprise_name like concat('%', #{enterpriseName}, '%')</if>
<if test="standardizedGrade != null and standardizedGrade != ''"> and standardized_grade = #{standardizedGrade}</if>
</where>
</select>
<select id="selectBStandardizationById" parameterType="Long" resultMap="BStandardizationResult">
<include refid="selectBStandardizationVo"/>
where id = #{id}
</select>
<insert id="insertBStandardization" parameterType="BStandardization" useGeneratedKeys="true" keyProperty="id">
insert into b_standardization
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="enterpriseName != null">enterprise_name,</if>
<if test="standardizedGrade != null">standardized_grade,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="enterpriseName != null">#{enterpriseName},</if>
<if test="standardizedGrade != null">#{standardizedGrade},</if>
</trim>
</insert>
<update id="updateBStandardization" parameterType="BStandardization">
update b_standardization
<trim prefix="SET" suffixOverrides=",">
<if test="enterpriseName != null">enterprise_name = #{enterpriseName},</if>
<if test="standardizedGrade != null">standardized_grade = #{standardizedGrade},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteBStandardizationById" parameterType="Long">
delete from b_standardization where id = #{id}
</delete>
<delete id="deleteBStandardizationByIds" parameterType="String">
delete from b_standardization where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>