修改资讯查询模糊搜索,字段信息管理排序

This commit is contained in:
gognqingkai 2024-04-18 14:52:39 +08:00
parent d48a5c3348
commit 1a41b74097
4 changed files with 97 additions and 89 deletions

View File

@ -50,10 +50,10 @@
and info_category_name = #{infoCategoryName} and info_category_name = #{infoCategoryName}
</if> </if>
<if test="infoTitle != null and infoTitle != ''"> <if test="infoTitle != null and infoTitle != ''">
and info_title = #{infoTitle} and info_title like concat('%', #{infoTitle}, '%')
</if> </if>
<if test="infoCode != null and infoCode != ''"> <if test="infoCode != null and infoCode != ''">
and info_code = #{infoCode} and info_code like concat('%', #{infoCode}, '%')
</if> </if>
<if test="infoContent != null and infoContent != ''"> <if test="infoContent != null and infoContent != ''">
and info_content = #{infoContent} and info_content = #{infoContent}

View File

@ -5,114 +5,123 @@
<mapper namespace="com.xinelu.manage.mapper.infocategory.InfoCategoryMapper"> <mapper namespace="com.xinelu.manage.mapper.infocategory.InfoCategoryMapper">
<resultMap type="InfoCategory" id="InfoCategoryResult"> <resultMap type="InfoCategory" id="InfoCategoryResult">
<result property="id" column="id"/> <result property="id" column="id"/>
<result property="infoCategoryCode" column="info_category_code"/> <result property="infoCategoryCode" column="info_category_code"/>
<result property="infoCategoryName" column="info_category_name"/> <result property="infoCategoryName" column="info_category_name"/>
<result property="infoCategoryType" column="info_category_type"/> <result property="infoCategoryType" column="info_category_type"/>
<result property="infoCategorySort" column="info_category_sort"/> <result property="infoCategorySort" column="info_category_sort"/>
<result property="infoCategoryCreator" column="info_category_creator"/> <result property="infoCategoryCreator" column="info_category_creator"/>
<result property="infoCategoryCreateTime" column="info_category_create_time"/> <result property="infoCategoryCreateTime" column="info_category_create_time"/>
</resultMap> </resultMap>
<sql id="selectInfoCategoryVo"> <sql id="selectInfoCategoryVo">
select id, info_category_code, info_category_name, info_category_type, info_category_sort, info_category_creator, info_category_create_time from info_category select id,
info_category_code,
info_category_name,
info_category_type,
info_category_sort,
info_category_creator,
info_category_create_time
from info_category
</sql> </sql>
<select id="selectInfoCategoryList" parameterType="InfoCategory" resultMap="InfoCategoryResult"> <select id="selectInfoCategoryList" parameterType="InfoCategory" resultMap="InfoCategoryResult">
<include refid="selectInfoCategoryVo"/> <include refid="selectInfoCategoryVo"/>
<where> <where>
<if test="infoCategoryCode != null and infoCategoryCode != ''"> <if test="infoCategoryCode != null and infoCategoryCode != ''">
and info_category_code = #{infoCategoryCode} and info_category_code like concat('%', #{infoCategoryCode}, '%')
</if> </if>
<if test="infoCategoryName != null and infoCategoryName != ''"> <if test="infoCategoryName != null and infoCategoryName != ''">
and info_category_name like concat('%', #{infoCategoryName}, '%') and info_category_name like concat('%', #{infoCategoryName}, '%')
</if> </if>
<if test="infoCategoryType != null and infoCategoryType != ''"> <if test="infoCategoryType != null and infoCategoryType != ''">
and info_category_type = #{infoCategoryType} and info_category_type = #{infoCategoryType}
</if> </if>
<if test="infoCategorySort != null "> <if test="infoCategorySort != null ">
and info_category_sort = #{infoCategorySort} and info_category_sort = #{infoCategorySort}
</if> </if>
<if test="infoCategoryCreator != null and infoCategoryCreator != ''"> <if test="infoCategoryCreator != null and infoCategoryCreator != ''">
and info_category_creator = #{infoCategoryCreator} and info_category_creator = #{infoCategoryCreator}
</if> </if>
<if test="infoCategoryCreateTime != null "> <if test="infoCategoryCreateTime != null ">
and info_category_create_time = #{infoCategoryCreateTime} and info_category_create_time = #{infoCategoryCreateTime}
</if> </if>
</where> </where>
order by info_category_sort order by info_category_sort
</select> </select>
<select id="selectInfoCategoryByName" parameterType="String" resultMap="InfoCategoryResult"> <select id="selectInfoCategoryByName" parameterType="String" resultMap="InfoCategoryResult">
<include refid="selectInfoCategoryVo"/> <include refid="selectInfoCategoryVo"/>
where info_category_name = #{info_category_name} where info_category_name = #{info_category_name}
</select> </select>
<select id="selectInfoCategoryById" parameterType="Long" resultMap="InfoCategoryResult"> <select id="selectInfoCategoryById" parameterType="Long" resultMap="InfoCategoryResult">
<include refid="selectInfoCategoryVo"/> <include refid="selectInfoCategoryVo"/>
where id = #{id} where id = #{id}
</select> </select>
<insert id="insertInfoCategory" parameterType="InfoCategory" useGeneratedKeys="true" <insert id="insertInfoCategory" parameterType="InfoCategory" useGeneratedKeys="true"
keyProperty="id"> keyProperty="id">
insert into info_category insert into info_category
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="infoCategoryCode != null">info_category_code, <if test="infoCategoryCode != null">info_category_code,
</if> </if>
<if test="infoCategoryName != null">info_category_name, <if test="infoCategoryName != null">info_category_name,
</if> </if>
<if test="e != null">info_category_type, <if test="e != null">info_category_type,
</if> </if>
<if test="infoCategorySort != null">info_category_sort, <if test="infoCategorySort != null">info_category_sort,
</if> </if>
<if test="infoCategoryCreator != null">info_category_creator, <if test="infoCategoryCreator != null">info_category_creator,
</if> </if>
<if test="infoCategoryCreateTime != null">info_category_create_time, <if test="infoCategoryCreateTime != null">info_category_create_time,
</if> </if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="infoCategoryCode != null">#{infoCategoryCode}, <if test="infoCategoryCode != null">#{infoCategoryCode},
</if> </if>
<if test="infoCategoryName != null">#{infoCategoryName}, <if test="infoCategoryName != null">#{infoCategoryName},
</if> </if>
<if test="infoCategoryType != null">#{infoCategoryType}, <if test="infoCategoryType != null">#{infoCategoryType},
</if> </if>
<if test="infoCategorySort != null">#{infoCategorySort}, <if test="infoCategorySort != null">#{infoCategorySort},
</if> </if>
<if test="infoCategoryCreator != null">#{infoCategoryCreator}, <if test="infoCategoryCreator != null">#{infoCategoryCreator},
</if> </if>
<if test="infoCategoryCreateTime != null">#{infoCategoryCreateTime}, <if test="infoCategoryCreateTime != null">#{infoCategoryCreateTime},
</if> </if>
</trim> </trim>
</insert> </insert>
<update id="updateInfoCategory" parameterType="InfoCategory"> <update id="updateInfoCategory" parameterType="InfoCategory">
update info_category update info_category
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="infoCategoryCode != null">info_category_code = <if test="infoCategoryCode != null">info_category_code =
#{infoCategoryCode}, #{infoCategoryCode},
</if> </if>
<if test="infoCategoryName != null">info_category_name = <if test="infoCategoryName != null">info_category_name =
#{infoCategoryName}, #{infoCategoryName},
</if> </if>
<if test="infoCategoryType != null">info_category_type = <if test="infoCategoryType != null">info_category_type =
#{infoCategoryType}, #{infoCategoryType},
</if> </if>
<if test="infoCategorySort != null">info_category_sort = <if test="infoCategorySort != null">info_category_sort =
#{infoCategorySort}, #{infoCategorySort},
</if> </if>
<if test="infoCategoryCreator != null">info_category_creator = <if test="infoCategoryCreator != null">info_category_creator =
#{infoCategoryCreator}, #{infoCategoryCreator},
</if> </if>
<if test="infoCategoryCreateTime != null">info_category_create_time = <if test="infoCategoryCreateTime != null">info_category_create_time =
#{infoCategoryCreateTime}, #{infoCategoryCreateTime},
</if> </if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
<delete id="deleteInfoCategoryById" parameterType="Long"> <delete id="deleteInfoCategoryById" parameterType="Long">
delete from info_category where id = #{id} delete
from info_category
where id = #{id}
</delete> </delete>
<delete id="deleteInfoCategoryByIds" parameterType="String"> <delete id="deleteInfoCategoryByIds" parameterType="String">
@ -130,7 +139,6 @@
</select> </select>
<insert id="insertInfoCategoryList"> <insert id="insertInfoCategoryList">
insert into info_category( insert into info_category(
info_category_code, info_category_code,

View File

@ -77,7 +77,7 @@
#{fieldMark} #{fieldMark}
</if> </if>
</where> </where>
order by create_time DESC order by content_sort, create_time DESC
</select> </select>
<select id="selectLabelFieldContentById" parameterType="Long" <select id="selectLabelFieldContentById" parameterType="Long"
@ -162,40 +162,40 @@
update label_field_content update label_field_content
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="fieldId != null">field_id = <if test="fieldId != null">field_id =
#{fieldId}, #{fieldId},
</if> </if>
<if test="fieldName != null">field_name = <if test="fieldName != null">field_name =
#{fieldName}, #{fieldName},
</if> </if>
<if test="contentName != null">content_name = <if test="contentName != null">content_name =
#{contentName}, #{contentName},
</if> </if>
<if test="contentCode != null">content_code = <if test="contentCode != null">content_code =
#{contentCode}, #{contentCode},
</if> </if>
<if test="resultPreview != null">result_preview = <if test="resultPreview != null">result_preview =
#{resultPreview}, #{resultPreview},
</if> </if>
<if test="contentSort != null">content_sort = <if test="contentSort != null">content_sort =
#{contentSort}, #{contentSort},
</if> </if>
<if test="contentRemark != null">content_remark = <if test="contentRemark != null">content_remark =
#{contentRemark}, #{contentRemark},
</if> </if>
<if test="fieldMark != null">field_mark = <if test="fieldMark != null">field_mark =
#{fieldMark}, #{fieldMark},
</if> </if>
<if test="createBy != null">create_by = <if test="createBy != null">create_by =
#{createBy}, #{createBy},
</if> </if>
<if test="createTime != null">create_time = <if test="createTime != null">create_time =
#{createTime}, #{createTime},
</if> </if>
<if test="updateBy != null">update_by = <if test="updateBy != null">update_by =
#{updateBy}, #{updateBy},
</if> </if>
<if test="updateTime != null">update_time = <if test="updateTime != null">update_time =
#{updateTime}, #{updateTime},
</if> </if>
</trim> </trim>
where id = #{id} where id = #{id}

View File

@ -57,7 +57,7 @@
#{fieldRemark} #{fieldRemark}
</if> </if>
</where> </where>
order by create_time DESC order by field_sort, create_time DESC
</select> </select>