123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- <?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.dgtly.companyext.mapper.CompanyHonourMapper">
-
- <resultMap type="CompanyHonour" id="CompanyHonourResult">
- <result property="honourId" column="honour_id" />
- <result property="companyId" column="company_id" />
- <result property="des" column="des" />
- <result property="img" column="img" />
- <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" />
- </resultMap>
- <sql id="selectCompanyHonourVo">
- select honour_id, company_id, des, img, create_by, create_time, update_by, update_time, remark from company_honour
- </sql>
- <select id="selectCompanyHonourList" parameterType="CompanyHonour" resultMap="CompanyHonourResult">
- <include refid="selectCompanyHonourVo"/>
- <where>
- <if test="companyId != null "> and company_id = #{companyId}</if>
- <if test="des != null and des != ''"> and des = #{des}</if>
- <if test="img != null and img != ''"> and img = #{img}</if>
- </where>
- </select>
-
- <select id="selectCompanyHonourById" parameterType="Long" resultMap="CompanyHonourResult">
- <include refid="selectCompanyHonourVo"/>
- where honour_id = #{honourId}
- </select>
-
- <insert id="insertCompanyHonour" parameterType="CompanyHonour" useGeneratedKeys="true" keyProperty="honourId">
- insert into company_honour
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="companyId != null ">company_id,</if>
- <if test="des != null and des != ''">des,</if>
- <if test="img != null and img != ''">img,</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>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="companyId != null ">#{companyId},</if>
- <if test="des != null and des != ''">#{des},</if>
- <if test="img != null and img != ''">#{img},</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>
- </trim>
- </insert>
- <update id="updateCompanyHonour" parameterType="CompanyHonour">
- update company_honour
- <trim prefix="SET" suffixOverrides=",">
- <if test="companyId != null ">company_id = #{companyId},</if>
- <if test="des != null and des != ''">des = #{des},</if>
- <if test="img != null and img != ''">img = #{img},</if>
- <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>
- </trim>
- where honour_id = #{honourId}
- </update>
- <delete id="deleteCompanyHonourById" parameterType="Long">
- delete from company_honour where honour_id = #{honourId}
- </delete>
- <delete id="deleteCompanyHonourByIds" parameterType="String">
- delete from company_honour where honour_id in
- <foreach item="honourId" collection="array" open="(" separator="," close=")">
- #{honourId}
- </foreach>
- </delete>
-
- </mapper>
|