<?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.project.tr.articleRegulation.mapper.ArticleRegulationMapper">
|
|
<resultMap type="ArticleRegulation" id="ArticleRegulationResult">
|
<result property="articleRegulationId" column="article_regulation_id" />
|
<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" />
|
<result property="regulationTitle" column="regulation_title" />
|
<result property="regulationContent" column="regulation_content" />
|
<result property="companyId" column="company_id" />
|
<result property="regulationType" column="regulation_type" />
|
</resultMap>
|
|
<sql id="selectArticleRegulationVo">
|
select article_regulation_id, create_by, create_time, update_by, update_time, remark, regulation_title, regulation_content, company_id, regulation_type from tr_article_regulation
|
</sql>
|
|
<select id="selectArticleRegulationList" parameterType="ArticleRegulation" resultMap="ArticleRegulationResult">
|
<include refid="selectArticleRegulationVo"/>
|
<where>
|
<if test="regulationTitle != null and regulationTitle != ''"> and regulation_title like concat('%',#{regulationTitle},'%')</if>
|
<if test="regulationContent != null and regulationContent != ''"> and regulation_content = #{regulationContent}</if>
|
<if test="companyId != null "> and company_id = #{companyId}</if>
|
<if test="regulationType != null "> and regulation_type = #{regulationType}</if>
|
</where>
|
</select>
|
|
<select id="selectArticleRegulationById" parameterType="Long" resultMap="ArticleRegulationResult">
|
<include refid="selectArticleRegulationVo"/>
|
where article_regulation_id = #{articleRegulationId}
|
</select>
|
|
<insert id="insertArticleRegulation" parameterType="ArticleRegulation" useGeneratedKeys="true" keyProperty="articleRegulationId">
|
insert into tr_article_regulation
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<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>
|
<if test="regulationTitle != null and regulationTitle != ''">regulation_title,</if>
|
<if test="regulationContent != null and regulationContent != ''">regulation_content,</if>
|
<if test="companyId != null ">company_id,</if>
|
<if test="regulationType != null ">regulation_type,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<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>
|
<if test="regulationTitle != null and regulationTitle != ''">#{regulationTitle},</if>
|
<if test="regulationContent != null and regulationContent != ''">#{regulationContent},</if>
|
<if test="companyId != null ">#{companyId},</if>
|
<if test="regulationType != null ">#{regulationType},</if>
|
</trim>
|
</insert>
|
|
<update id="updateArticleRegulation" parameterType="ArticleRegulation">
|
update tr_article_regulation
|
<trim prefix="SET" suffixOverrides=",">
|
<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>
|
<if test="regulationTitle != null and regulationTitle != ''">regulation_title = #{regulationTitle},</if>
|
<if test="regulationContent != null and regulationContent != ''">regulation_content = #{regulationContent},</if>
|
<if test="companyId != null ">company_id = #{companyId},</if>
|
<if test="regulationType != null ">regulation_type = #{regulationType},</if>
|
</trim>
|
where article_regulation_id = #{articleRegulationId}
|
</update>
|
|
<delete id="deleteArticleRegulationById" parameterType="Long">
|
delete from tr_article_regulation where article_regulation_id = #{articleRegulationId}
|
</delete>
|
|
<delete id="deleteArticleRegulationByIds" parameterType="String">
|
delete from tr_article_regulation where article_regulation_id in
|
<foreach item="articleRegulationId" collection="array" open="(" separator="," close=")">
|
#{articleRegulationId}
|
</foreach>
|
</delete>
|
|
</mapper>
|