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.
162 lines
6.5 KiB
162 lines
6.5 KiB
|
4 months ago
|
<?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.newstocksystem.mapper.TIndustryBasicMapper">
|
||
|
|
|
||
|
|
<resultMap type="com.ruoyi.newstocksystem.domain.TIndustryBasic" id="TIndustryBasicResult">
|
||
|
|
<result property="industryCode" column="industry_code" />
|
||
|
|
<result property="industryName" column="industry_name" />
|
||
|
|
<result property="industryLevel" column="industry_level" />
|
||
|
|
<result property="parentIndustryCode" column="parent_industry_code" />
|
||
|
|
<result property="description" column="description" />
|
||
|
|
<result property="status" column="status" />
|
||
|
|
<result property="sortOrder" column="sort_order" />
|
||
|
|
<result property="createTime" column="create_time" />
|
||
|
|
<result property="updateTime" column="update_time" />
|
||
|
|
</resultMap>
|
||
|
|
|
||
|
|
<sql id="selectTIndustryBasicVo">
|
||
|
|
select industry_code, industry_name, industry_level, parent_industry_code, description, status, sort_order, create_time, update_time
|
||
|
|
from t_industry_basic
|
||
|
|
</sql>
|
||
|
|
|
||
|
|
<select id="selectTIndustryBasicByCode" parameterType="String" resultMap="TIndustryBasicResult">
|
||
|
|
<include refid="selectTIndustryBasicVo"/>
|
||
|
|
where industry_code = #{industryCode}
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="selectTIndustryBasicList" parameterType="com.ruoyi.newstocksystem.domain.TIndustryBasic" resultMap="TIndustryBasicResult">
|
||
|
|
<include refid="selectTIndustryBasicVo"/>
|
||
|
|
<where>
|
||
|
|
<if test="industryCode != null and industryCode != ''">
|
||
|
|
AND industry_code = #{industryCode}
|
||
|
|
</if>
|
||
|
|
<if test="industryName != null and industryName != ''">
|
||
|
|
AND industry_name like concat('%', #{industryName}, '%')
|
||
|
|
</if>
|
||
|
|
<if test="industryLevel != null ">
|
||
|
|
AND industry_level = #{industryLevel}
|
||
|
|
</if>
|
||
|
|
<if test="parentIndustryCode != null and parentIndustryCode != ''">
|
||
|
|
AND parent_industry_code = #{parentIndustryCode}
|
||
|
|
</if>
|
||
|
|
<if test="status != null ">
|
||
|
|
AND status = #{status}
|
||
|
|
</if>
|
||
|
|
</where>
|
||
|
|
order by sort_order asc
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<insert id="insertTIndustryBasic" parameterType="com.ruoyi.newstocksystem.domain.TIndustryBasic" useGeneratedKeys="false">
|
||
|
|
insert into t_industry_basic
|
||
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="industryCode != null and industryCode != ''">
|
||
|
|
industry_code,
|
||
|
|
</if>
|
||
|
|
<if test="industryName != null and industryName != ''">
|
||
|
|
industry_name,
|
||
|
|
</if>
|
||
|
|
<if test="industryLevel != null">
|
||
|
|
industry_level,
|
||
|
|
</if>
|
||
|
|
<if test="parentIndustryCode != null">
|
||
|
|
parent_industry_code,
|
||
|
|
</if>
|
||
|
|
<if test="description != null">
|
||
|
|
description,
|
||
|
|
</if>
|
||
|
|
<if test="status != null">
|
||
|
|
status,
|
||
|
|
</if>
|
||
|
|
<if test="sortOrder != null">
|
||
|
|
sort_order,
|
||
|
|
</if>
|
||
|
|
</trim>
|
||
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="industryCode != null and industryCode != ''">
|
||
|
|
#{industryCode},
|
||
|
|
</if>
|
||
|
|
<if test="industryName != null and industryName != ''">
|
||
|
|
#{industryName},
|
||
|
|
</if>
|
||
|
|
<if test="industryLevel != null">
|
||
|
|
#{industryLevel},
|
||
|
|
</if>
|
||
|
|
<if test="parentIndustryCode != null">
|
||
|
|
#{parentIndustryCode},
|
||
|
|
</if>
|
||
|
|
<if test="description != null">
|
||
|
|
#{description},
|
||
|
|
</if>
|
||
|
|
<if test="status != null">
|
||
|
|
#{status},
|
||
|
|
</if>
|
||
|
|
<if test="sortOrder != null">
|
||
|
|
#{sortOrder},
|
||
|
|
</if>
|
||
|
|
</trim>
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
<update id="updateTIndustryBasic" parameterType="com.ruoyi.newstocksystem.domain.TIndustryBasic">
|
||
|
|
update t_industry_basic
|
||
|
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
|
<if test="industryName != null and industryName != ''">
|
||
|
|
industry_name = #{industryName},
|
||
|
|
</if>
|
||
|
|
<if test="industryLevel != null">
|
||
|
|
industry_level = #{industryLevel},
|
||
|
|
</if>
|
||
|
|
<if test="parentIndustryCode != null">
|
||
|
|
parent_industry_code = #{parentIndustryCode},
|
||
|
|
</if>
|
||
|
|
<if test="description != null">
|
||
|
|
description = #{description},
|
||
|
|
</if>
|
||
|
|
<if test="status != null">
|
||
|
|
status = #{status},
|
||
|
|
</if>
|
||
|
|
<if test="sortOrder != null">
|
||
|
|
sort_order = #{sortOrder},
|
||
|
|
</if>
|
||
|
|
<if test="updateTime != null">
|
||
|
|
update_time = #{updateTime},
|
||
|
|
</if>
|
||
|
|
</trim>
|
||
|
|
where industry_code = #{industryCode}
|
||
|
|
</update>
|
||
|
|
|
||
|
|
<delete id="deleteTIndustryBasicByCode" parameterType="String">
|
||
|
|
delete from t_industry_basic where industry_code = #{industryCode}
|
||
|
|
</delete>
|
||
|
|
|
||
|
|
<delete id="deleteTIndustryBasicByCodes" parameterType="String">
|
||
|
|
delete from t_industry_basic where industry_code in
|
||
|
|
<foreach item="industryCode" collection="array" open="(" separator="," close=")">
|
||
|
|
#{industryCode}
|
||
|
|
</foreach>
|
||
|
|
</delete>
|
||
|
|
|
||
|
|
<insert id="batchUpsertIndustryBasic" parameterType="com.ruoyi.newstocksystem.domain.TIndustryBasic">
|
||
|
|
INSERT INTO t_industry_basic(
|
||
|
|
industry_code, industry_name, industry_level, parent_industry_code,
|
||
|
|
description, status, sort_order, create_time, update_time
|
||
|
|
) VALUES
|
||
|
|
<foreach collection="list" item="item" separator=",">
|
||
|
|
(
|
||
|
|
#{item.industryCode}, #{item.industryName}, #{item.industryLevel},
|
||
|
|
#{item.parentIndustryCode}, #{item.description}, #{item.status},
|
||
|
|
#{item.sortOrder}, now(), now()
|
||
|
|
)
|
||
|
|
</foreach>
|
||
|
|
ON DUPLICATE KEY UPDATE
|
||
|
|
industry_name = VALUES(industry_name),
|
||
|
|
industry_level = VALUES(industry_level),
|
||
|
|
parent_industry_code = VALUES(parent_industry_code),
|
||
|
|
description = VALUES(description),
|
||
|
|
status = VALUES(status),
|
||
|
|
sort_order = VALUES(sort_order),
|
||
|
|
update_time = now()
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
</mapper>
|