123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- <?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.oa.mapper.CmcContractCommentMapper">
-
- <resultMap type="CmcContractComment" id="CmcContractCommentResult">
- <result property="commentId" column="comment_id" />
- <result property="contractId" column="contract_id" />
- <result property="deptId" column="dept_id" />
- <result property="userId" column="user_id" />
- <result property="comment" column="comment" />
- <result property="commentTime" column="comment_time" />
- </resultMap>
-
- <sql id="selectCmcContractCommentVo">
- select comment_id, contract_id, dept_id, user_id, comment, comment_time from cmc_contract_comment
- </sql>
-
- <select id="selectCmcContractCommentList" parameterType="CmcContractComment" resultMap="CmcContractCommentResult">
- <include refid="selectCmcContractCommentVo"/>
- <where>
- <if test="contractId != null and contractId != ''"> and contract_id like concat('%', #{contractId}, '%')</if>
- <if test="deptId != null "> and dept_id = #{deptId}</if>
- <if test="userId != null "> and user_id = #{userId}</if>
- <if test="comment != null and comment != ''"> and comment = #{comment}</if>
- <if test="commentTime != null "> and comment_time = #{commentTime}</if>
- </where>
- </select>
-
- <select id="selectCmcContractCommentByCommentId" parameterType="String" resultMap="CmcContractCommentResult">
- <include refid="selectCmcContractCommentVo"/>
- where comment_id = #{commentId}
- </select>
-
- <insert id="insertCmcContractComment" parameterType="CmcContractComment">
- insert into cmc_contract_comment
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="commentId != null">comment_id,</if>
- <if test="contractId != null">contract_id,</if>
- <if test="deptId != null">dept_id,</if>
- <if test="userId != null">user_id,</if>
- <if test="comment != null">comment,</if>
- <if test="commentTime != null">comment_time,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="commentId != null">#{commentId},</if>
- <if test="contractId != null">#{contractId},</if>
- <if test="deptId != null">#{deptId},</if>
- <if test="userId != null">#{userId},</if>
- <if test="comment != null">#{comment},</if>
- <if test="commentTime != null">#{commentTime},</if>
- </trim>
- </insert>
-
- <update id="updateCmcContractComment" parameterType="CmcContractComment">
- update cmc_contract_comment
- <trim prefix="SET" suffixOverrides=",">
- <if test="contractId != null">contract_id = #{contractId},</if>
- <if test="deptId != null">dept_id = #{deptId},</if>
- <if test="userId != null">user_id = #{userId},</if>
- <if test="comment != null">comment = #{comment},</if>
- <if test="commentTime != null">comment_time = #{commentTime},</if>
- </trim>
- where comment_id = #{commentId}
- </update>
-
- <delete id="deleteCmcContractCommentByCommentId" parameterType="String">
- delete from cmc_contract_comment where comment_id = #{commentId}
- </delete>
-
- <delete id="deleteCmcContractCommentByCommentIds" parameterType="String">
- delete from cmc_contract_comment where comment_id in
- <foreach item="commentId" collection="array" open="(" separator="," close=")">
- #{commentId}
- </foreach>
- </delete>
- </mapper>
|