|
@@ -1,184 +0,0 @@
|
|
-<!--<?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.backendsys.mapper.Med.MedMaterialMapper">-->
|
|
|
|
-
|
|
|
|
-<!-- <sql id="includeMaterial">-->
|
|
|
|
-<!-- m.id id,-->
|
|
|
|
-<!-- m.id material_id,-->
|
|
|
|
-<!-- mc.id category_id,-->
|
|
|
|
-<!-- mc.category_name category_name,-->
|
|
|
|
-<!-- m.title title,-->
|
|
|
|
-<!-- COALESCE(m.description, '') description,-->
|
|
|
|
-<!-- COALESCE(m.thumb, '') thumb,-->
|
|
|
|
-<!-- m.material_type material_type,-->
|
|
|
|
-<!-- <!– COALESCE(m.content, '') content, –>-->
|
|
|
|
-<!-- <!– COALESCE(m.file, '') file, –>-->
|
|
|
|
-<!-- m.is_top is_top,-->
|
|
|
|
-<!-- m.status status,-->
|
|
|
|
-<!-- m.audit_status audit_status,-->
|
|
|
|
-<!-- m.create_time create_time,-->
|
|
|
|
-<!-- m.update_time update_time-->
|
|
|
|
-<!-- </sql>-->
|
|
|
|
-
|
|
|
|
-<!-- <sql id="includeMaterialDetail">-->
|
|
|
|
-<!-- m.id id,-->
|
|
|
|
-<!-- m.id material_id,-->
|
|
|
|
-<!-- mc.id category_id,-->
|
|
|
|
-<!-- mc.category_name category_name,-->
|
|
|
|
-<!-- m.title title,-->
|
|
|
|
-<!-- COALESCE(m.description, '') description,-->
|
|
|
|
-<!-- COALESCE(m.thumb, '') thumb,-->
|
|
|
|
-<!-- m.material_type material_type,-->
|
|
|
|
-<!-- COALESCE(m.content, '') content,-->
|
|
|
|
-<!-- COALESCE(m.file, '') file,-->
|
|
|
|
-<!-- m.is_top is_top,-->
|
|
|
|
-<!-- m.status status,-->
|
|
|
|
-<!-- m.audit_status audit_status,-->
|
|
|
|
-<!-- m.create_time create_time,-->
|
|
|
|
-<!-- m.update_time update_time-->
|
|
|
|
-<!-- </sql>-->
|
|
|
|
-<!-- -->
|
|
|
|
-
|
|
|
|
-<!-- <resultMap id="resultMapMaterial" type="java.util.LinkedHashMap">-->
|
|
|
|
-<!-- <id property="id" column="id" jdbcType="BIGINT" />-->
|
|
|
|
-<!-- <result property="material_id" column="material_id" javaType="java.lang.Long"/>-->
|
|
|
|
-<!-- <result property="category_id" column="category_id" javaType="java.lang.Long"/>-->
|
|
|
|
-<!-- <result property="category_name" column="category_name" />-->
|
|
|
|
-<!-- <result property="title" column="title" />-->
|
|
|
|
-<!-- <result property="description" column="description" />-->
|
|
|
|
-<!-- <result property="thumb" column="thumb" />-->
|
|
|
|
-<!-- <result property="material_type" column="material_type" javaType="java.lang.Integer"/>-->
|
|
|
|
-<!-- <!– <result property="content" column="content" /> –>-->
|
|
|
|
-<!-- <!– <result property="file" column="file" /> –>-->
|
|
|
|
-<!-- <result property="is_top" column="is_top" javaType="java.lang.Integer"/>-->
|
|
|
|
-<!-- <result property="status" column="status" javaType="java.lang.Integer"/>-->
|
|
|
|
-<!-- <result property="audit_status" column="audit_status" javaType="java.lang.Integer"/>-->
|
|
|
|
-<!-- <result property="create_time" column="create_time" />-->
|
|
|
|
-<!-- <result property="update_time" column="update_time" />-->
|
|
|
|
-<!-- </resultMap>-->
|
|
|
|
-
|
|
|
|
-<!-- <resultMap id="resultMapMaterialDetail" type="java.util.LinkedHashMap">-->
|
|
|
|
-<!-- <id property="id" column="id" jdbcType="BIGINT" />-->
|
|
|
|
-<!-- <result property="material_id" column="material_id" javaType="java.lang.Long"/>-->
|
|
|
|
-<!-- <result property="category_id" column="category_id" javaType="java.lang.Long"/>-->
|
|
|
|
-<!-- <result property="category_name" column="category_name" />-->
|
|
|
|
-<!-- <result property="title" column="title" />-->
|
|
|
|
-<!-- <result property="description" column="description" />-->
|
|
|
|
-<!-- <result property="thumb" column="thumb" />-->
|
|
|
|
-<!-- <result property="material_type" column="material_type" javaType="java.lang.Integer" />-->
|
|
|
|
-<!-- <result property="content" column="content" />-->
|
|
|
|
-<!-- <result property="file" column="file" />-->
|
|
|
|
-<!-- <result property="is_top" column="is_top" javaType="java.lang.Integer"/>-->
|
|
|
|
-<!-- <result property="status" column="status" javaType="java.lang.Integer"/>-->
|
|
|
|
-<!-- <result property="audit_status" column="audit_status" javaType="java.lang.Integer"/>-->
|
|
|
|
-<!-- <result property="create_time" column="create_time" />-->
|
|
|
|
-<!-- <result property="update_time" column="update_time" />-->
|
|
|
|
-<!-- </resultMap>-->
|
|
|
|
-
|
|
|
|
-<!-- <sql id="leftJoinCategory">-->
|
|
|
|
-<!-- LEFT JOIN med_material_category mc ON m.category_id = mc.id-->
|
|
|
|
-<!-- </sql>-->
|
|
|
|
-
|
|
|
|
-<!-- <!– 查 列表 –>-->
|
|
|
|
-<!-- <select id="queryMaterialList" resultMap="resultMapMaterial">-->
|
|
|
|
-<!-- SELECT-->
|
|
|
|
-<!-- <include refid="includeMaterial" />-->
|
|
|
|
-<!-- FROM med_material m-->
|
|
|
|
-<!-- <include refid="leftJoinCategory" />-->
|
|
|
|
-<!-- <where>-->
|
|
|
|
-<!-- <if test="title != null and title != ''">-->
|
|
|
|
-<!-- AND m.title LIKE CONCAT('%', #{title}, '%')-->
|
|
|
|
-<!-- </if>-->
|
|
|
|
-<!-- <if test="description != null and description != ''">-->
|
|
|
|
-<!-- AND m.description LIKE CONCAT('%', #{description}, '%')-->
|
|
|
|
-<!-- </if>-->
|
|
|
|
-<!-- <if test="category_id != null and category_id != ''">-->
|
|
|
|
-<!-- AND m.category_id = #{category_id}-->
|
|
|
|
-<!-- </if>-->
|
|
|
|
-<!-- <if test="status != null and status != ''">-->
|
|
|
|
-<!-- AND m.status = #{status}-->
|
|
|
|
-<!-- </if>-->
|
|
|
|
-<!-- <if test="audit_status != null and audit_status != ''">-->
|
|
|
|
-<!-- AND m.audit_status = #{audit_status}-->
|
|
|
|
-<!-- </if>-->
|
|
|
|
-<!-- <if test="create_time != null and create_time != ''">-->
|
|
|
|
-<!-- AND m.create_time >= #{create_time}-->
|
|
|
|
-<!-- </if>-->
|
|
|
|
-<!-- </where>-->
|
|
|
|
-<!-- ORDER BY m.is_top = 1 DESC, m.update_time DESC-->
|
|
|
|
-<!-- </select>-->
|
|
|
|
-
|
|
|
|
-<!-- <select id="queryMaterialDetail" resultMap="resultMapMaterialDetail">-->
|
|
|
|
-<!-- SELECT <include refid="includeMaterialDetail" />-->
|
|
|
|
-<!-- FROM med_material m-->
|
|
|
|
-<!-- <include refid="leftJoinCategory" />-->
|
|
|
|
-<!-- WHERE m.id = #{material_id}-->
|
|
|
|
-<!-- </select>-->
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-<!-- <insert id="insertMaterial" parameterType="com.backendsys.entity.Med.MedMaterialDTO"-->
|
|
|
|
-<!-- useGeneratedKeys="true" keyProperty="material_id">-->
|
|
|
|
-<!-- INSERT INTO med_material (-->
|
|
|
|
-<!-- category_id, title, material_type-->
|
|
|
|
-<!-- <if test="description != null and description != ''">, description</if>-->
|
|
|
|
-<!-- <if test="thumb != null and thumb != ''">, thumb</if>-->
|
|
|
|
-<!-- <if test="content != null and content != ''">, content</if>-->
|
|
|
|
-<!-- <if test="file != null and file != ''">, file</if>-->
|
|
|
|
-<!-- <if test="is_top != null and is_top != ''">, is_top</if>-->
|
|
|
|
-<!-- <!– <if test="audit_status != null and audit_status != ''">, audit_status</if> –>-->
|
|
|
|
-<!-- <if test="status != null and status != ''">, status</if>-->
|
|
|
|
-<!-- )-->
|
|
|
|
-<!-- VALUES (-->
|
|
|
|
-<!-- #{category_id}, #{title}, #{material_type}-->
|
|
|
|
-<!-- <if test="description != null and description != ''">, #{description}</if>-->
|
|
|
|
-<!-- <if test="thumb != null and thumb != ''">, #{thumb}</if>-->
|
|
|
|
-<!-- <if test="content != null and content != ''">, #{content}</if>-->
|
|
|
|
-<!-- <if test="file != null and file != ''">, #{file}</if>-->
|
|
|
|
-<!-- <if test="is_top != null and is_top != ''">, #{is_top}</if>-->
|
|
|
|
-<!-- <!– <if test="audit_status != null and audit_status != ''">, #{audit_status}</if> –>-->
|
|
|
|
-<!-- <if test="status != null and status != ''">, #{status}</if>-->
|
|
|
|
-<!-- );-->
|
|
|
|
-<!-- </insert>-->
|
|
|
|
-
|
|
|
|
-<!-- <update id="updateMaterial" parameterType="com.backendsys.entity.Med.MedMaterialDTO"-->
|
|
|
|
-<!-- useGeneratedKeys="true" keyProperty="material_id">-->
|
|
|
|
-<!-- UPDATE med_material-->
|
|
|
|
-<!-- SET-->
|
|
|
|
-<!-- category_id = #{category_id},-->
|
|
|
|
-<!-- title = #{title},-->
|
|
|
|
-<!-- material_type = #{material_type},-->
|
|
|
|
-<!-- <if test="description != null and description != ''">, description = #{description}</if>-->
|
|
|
|
-<!-- <if test="thumb != null and thumb != ''">, thumb = #{thumb}</if>-->
|
|
|
|
-<!-- <if test="content != null and content != ''">, content = #{content}</if>-->
|
|
|
|
-<!-- <if test="file != null and file != ''">, file = #{file}</if>-->
|
|
|
|
-<!-- <if test="is_top != null and is_top != ''">, is_top = #{is_top}</if>-->
|
|
|
|
-<!-- <!– <if test="audit_status != null and audit_status != ''">, audit_status = #{audit_status}</if> –>-->
|
|
|
|
-<!-- <if test="status != null and status != ''">, status = #{status}</if>-->
|
|
|
|
-<!-- WHERE id = #{material_id};-->
|
|
|
|
-<!-- </update>-->
|
|
|
|
-<!-- <!– –>-->
|
|
|
|
-
|
|
|
|
-<!-- <!– 审核 –>-->
|
|
|
|
-<!-- <update id="auditMaterial" parameterType="com.backendsys.entity.Med.MedMaterialDTO">-->
|
|
|
|
-<!-- UPDATE med_material SET-->
|
|
|
|
-<!-- <trim suffixOverrides="," suffix=" ">-->
|
|
|
|
-<!-- <if test="audit_status != null and audit_status != ''">audit_status = #{audit_status},</if>-->
|
|
|
|
-<!-- <if test="audit_note != null and audit_note != ''">audit_note = #{audit_note},</if>-->
|
|
|
|
-<!-- </trim>-->
|
|
|
|
-<!-- WHERE id = #{material_id};-->
|
|
|
|
-<!-- </update>-->
|
|
|
|
-
|
|
|
|
-<!-- <!– 删除 –>-->
|
|
|
|
-<!-- <delete id="deleteMaterial" parameterType="java.lang.Long">-->
|
|
|
|
-<!-- DELETE FROM med_material WHERE id = #{material_id};-->
|
|
|
|
-<!-- </delete>-->
|
|
|
|
-
|
|
|
|
-<!-- <!– 删除 (批量) –>-->
|
|
|
|
-<!-- <delete id="deleteMaterialBatch" parameterType="java.lang.Long">-->
|
|
|
|
-<!-- DELETE FROM med_material WHERE id IN-->
|
|
|
|
-<!-- <foreach collection="ids" item="id" open="(" separator="," close=")">-->
|
|
|
|
-<!-- #{id}-->
|
|
|
|
-<!-- </foreach>-->
|
|
|
|
-<!-- </delete>-->
|
|
|
|
-
|
|
|
|
-<!--</mapper>-->
|
|
|