123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191 |
- <?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.zhyc.xps.common.mapper.MsgCatMapper">
- <resultMap id="MessageCatDtoResultMap" type="com.zhyc.xps.common.dto.MsgCatDto">
- <result column="msg_cat_id" property="msgCatId" jdbcType="BIGINT" />
- <result column="msg_cat_title" property="msgCatTitle" jdbcType="VARCHAR"/>
- <result column="msg_cat_link" property="msgCatLink" jdbcType="VARCHAR"/>
- <result column="msg_cat_link_params" property="msgCatLinkParams" jdbcType="VARCHAR"/>
- <result column="msg_cat_desc" property="msgCatDesc" jdbcType="VARCHAR"/>
- <result column="is_detailed" property="isDetailed" jdbcType="BIGINT" />
- <result column="is_link" property="isLink" jdbcType="BIGINT" />
- <result column="is_fixed" property="isFixed" jdbcType="BIGINT" />
- </resultMap>
- <sql id="MessageCatDto_Cols">
- msg_cat_id,
- msg_cat_title,
- msg_cat_desc,
- is_detailed,
- is_link,
- msg_cat_link,
- msg_cat_link_params,
- is_fixed
- </sql>
- <!--基于ID查询-->
- <select id="getById" resultMap="MessageCatDtoResultMap">
- SELECT
- <include refid="MessageCatDto_Cols"/>
- FROM msg_cat
- WHERE deleted_flag = 0
- <if test="msgCatId != null">
- AND msg_cat_id = #{msgCatId ,jdbcType=BIGINT}
- </if>
- </select>
- <!--分页查询-->
- <select id="getByPage" parameterType="java.util.Map" resultMap="MessageCatDtoResultMap">
- SELECT
- <include refid="MessageCatDto_Cols"/>
- FROM msg_cat
- WHERE deleted_flag = 0
- <if test="msgCatId != null">
- AND msg_cat_id = #{msgCatId ,jdbcType=BIGINT}
- </if>
- <if test="keywords != null and keywords != ''">
- AND msg_cat_title like "%"#{keywords}"%"
- </if>
- ORDER BY msg_cat_id ASC
- </select>
- <!--列表查询-->
- <select id="getByList" parameterType="java.util.Map" resultMap="MessageCatDtoResultMap" >
- SELECT
- <include refid="MessageCatDto_Cols"/>
- FROM msg_cat
- WHERE deleted_flag = 0
- </select>
- <!--新增Create-->
- <insert id="create" parameterType="com.zhyc.xps.common.entity.MsgCat">
- INSERT INTO msg_cat
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="msgCatId != null">
- msg_cat_id,
- </if>
- <if test="msgCatTitle != null and msgCatTitle !=''">
- msg_cat_title,
- </if>
- <if test="msgCatLink != null and msgCatLink !=''">
- msg_cat_link,
- </if>
- <if test="msgCatLinkParams != null and msgCatLinkParams !=''">
- msg_cat_link_params,
- </if>
- <if test="msgCatDesc != null and msgCatDesc !=''">
- msg_cat_desc,
- </if>
- <if test="isDetailed != null">
- is_detailed,
- </if>
- <if test="isLink != null">
- is_link,
- </if>
- <if test="isFixed != null">
- is_fixed,
- </if>
- <if test="createdBy != null">
- created_by,
- </if>
- <if test="createdAt != null">
- created_at,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="msgCatId != null">
- #{msgCatId ,jdbcType=BIGINT},
- </if>
- <if test="msgCatTitle != null and msgCatTitle != ''">
- #{msgCatTitle ,jdbcType=VARCHAR},
- </if>
- <if test="msgCatLink != null and msgCatLink !=''">
- #{msgCatLink ,jdbcType=VARCHAR},
- </if>
- <if test="msgCatLinkParams != null and msgCatLinkParams !=''">
- #{msgCatLinkParams ,jdbcType=VARCHAR},
- </if>
- <if test="msgCatDesc != null and msgCatDesc != ''">
- #{msgCatDesc ,jdbcType=VARCHAR},
- </if>
- <if test="isDetailed != null">
- #{isDetailed ,jdbcType=BIGINT},
- </if>
- <if test="isLink != null">
- #{isLink ,jdbcType=BIGINT},
- </if>
- <if test="isFixed != null">
- #{isFixed ,jdbcType=BIGINT},
- </if>
- <if test="createdBy != null">
- #{createdBy ,jdbcType=BIGINT},
- </if>
- <if test="createdAt != null">
- #{createdAt ,jdbcType=TIMESTAMP},
- </if>
- </trim>
- </insert>
- <!--更新Update-->
- <update id="update" parameterType="com.zhyc.xps.common.entity.MsgCat">
- UPDATE msg_cat
- <trim suffixOverrides=",">
- <set>
- <if test="msgCatTitle != null and msgCatTitle != ''">
- msg_cat_title = #{msgCatTitle, jdbcType=VARCHAR},
- </if>
- <if test="msgCatDesc != null and msgCatDesc != ''">
- msg_cat_desc = #{msgCatDesc, jdbcType=VARCHAR},
- </if>
- <if test="msgCatLink != null and msgCatLink !=''">
- msg_cat_link = #{msgCatLink ,jdbcType=VARCHAR},
- </if>
- <if test="msgCatLinkParams != null and msgCatLinkParams !=''">
- msg_cat_link_params = #{msgCatLinkParams ,jdbcType=VARCHAR},
- </if>
- <if test="isDetailed != null">
- is_detailed = #{isDetailed ,jdbcType=BIGINT},
- </if>
- <if test="isLink != null">
- is_link = #{isLink ,jdbcType=BIGINT},
- </if>
- <if test="isFixed != null">
- is_fixed = #{isFixed ,jdbcType=BIGINT},
- </if>
- <if test="updatedBy != null ">
- updated_by = #{updatedBy ,jdbcType=BIGINT},
- </if>
- <if test="updatedAt != null">
- updated_at = #{updatedAt ,jdbcType=TIMESTAMP},
- </if>
- </set>
- </trim>
- WHERE 1 = 1
- <if test="msgCatId != null">
- AND msg_cat_id = #{msgCatId ,jdbcType=BIGINT}
- </if>
- </update>
- <!--删除Delete-->
- <update id="delete" parameterType="java.util.Map">
- UPDATE msg_cat
- <trim suffixOverrides=",">
- <set>
- <if test="deletedFlag != null">
- deleted_flag = #{deletedFlag,jdbcType=BIGINT},
- </if>
- <if test="deletedTime != null">
- deleted_time = #{deletedTime,jdbcType=VARCHAR},
- </if>
- <if test="deletedBy != null">
- deleted_by = #{deletedBy,jdbcType=BIGINT},
- </if>
- </set>
- </trim>
- WHERE 1 = 1
- <if test="msgCatId != null">
- AND msg_cat_id = #{msgCatId ,jdbcType=BIGINT}
- </if>
- </update>
- </mapper>
|