TechMediumEnterpriseMapper.xml
3.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?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.web.business.techMediumEnterprise.mapper.TechMediumEnterpriseMapper">
<resultMap type="TechMediumEnterprise" id="TechMediumEnterpriseResult">
<result property="id" column="id"/>
<result property="enterpriseName" column="enterprise_name"/>
<result property="creditCode" column="credit_code"/>
<result property="year" column="year"/>
<result property="createTime" column="create_time"/>
<result property="num" column="num"/>
</resultMap>
<sql id="selectTechMediumEnterpriseVo">
select id, enterprise_name, credit_code, year, create_time, num from tech_medium_enterprise
</sql>
<select id="selectTechMediumEnterpriseById" parameterType="Long" resultMap="TechMediumEnterpriseResult">
<include refid="selectTechMediumEnterpriseVo"/>
where id = #{id}
</select>
<select id="selectTechMediumEnterpriseList" parameterType="TechMediumEnterprise" resultMap="TechMediumEnterpriseResult">
<include refid="selectTechMediumEnterpriseVo"/>
<where>
<if test="enterpriseName != null and enterpriseName != ''"> and enterprise_name like concat('%', #{enterpriseName}, '%')</if>
<if test="creditCode != null and creditCode != ''"> and credit_code = #{creditCode}</if>
<if test="year != null "> and year = #{year}</if>
<if test="num != null and num != ''"> and num = #{num}</if>
</where>
</select>
<insert id="insertTechMediumEnterprise" parameterType="TechMediumEnterprise" useGeneratedKeys="true" keyProperty="id">
insert into tech_medium_enterprise
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="enterpriseName != null and enterpriseName != ''">enterprise_name,</if>
<if test="creditCode != null and creditCode != ''">credit_code,</if>
<if test="year != null">year,</if>
<if test="createTime != null">create_time,</if>
<if test="num != null and num != ''">num,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="enterpriseName != null and enterpriseName != ''">#{enterpriseName},</if>
<if test="creditCode != null and creditCode != ''">#{creditCode},</if>
<if test="year != null">#{year},</if>
<if test="createTime != null">#{createTime},</if>
<if test="num != null and num != ''">#{num},</if>
</trim>
</insert>
<update id="updateTechMediumEnterprise" parameterType="TechMediumEnterprise">
update tech_medium_enterprise
<trim prefix="SET" suffixOverrides=",">
<if test="enterpriseName != null and enterpriseName != ''">enterprise_name = #{enterpriseName},</if>
<if test="creditCode != null and creditCode != ''">credit_code = #{creditCode},</if>
<if test="year != null">year = #{year},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="num != null and num != ''">num = #{num},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteTechMediumEnterpriseById" parameterType="Long">
delete from tech_medium_enterprise where id = #{id}
</delete>
<delete id="deleteTechMediumEnterpriseByIds" parameterType="String">
delete from tech_medium_enterprise where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>