|
@@ -0,0 +1,148 @@
|
|
|
+<?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.ygj.yuemum.dao.wxmini.WXContentDao" >
|
|
|
+
|
|
|
+ <resultMap id="BaseResultMap" type="com.ygj.yuemum.domain.wxmini.WXContent" >
|
|
|
+ <id column="id" property="id" jdbcType="INTEGER" />
|
|
|
+ <result column="wc_title" property="wc_title" jdbcType="VARCHAR" />
|
|
|
+ <result column="wc_content" property="wc_content" jdbcType="VARCHAR" />
|
|
|
+ <result column="wc_type" property="wc_type" jdbcType="VARCHAR" />
|
|
|
+ <result column="wc_showtime" property="wc_showtime" jdbcType="INTEGER" />
|
|
|
+ <result column="wc_create_user" property="wc_create_user" jdbcType="INTEGER" />
|
|
|
+ <result column="wc_create_date" property="wc_create_date" jdbcType="DATE" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <!--获取所有数据-->
|
|
|
+ <select id="getWXContents" resultType="com.ygj.yuemum.domain.wxmini.WXContent" >
|
|
|
+ select
|
|
|
+ *
|
|
|
+ from wx_content
|
|
|
+ order by id desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="getWXContentByID" resultType="com.ygj.yuemum.domain.wxmini.WXContent" parameterType="java.lang.Integer">
|
|
|
+ SELECT
|
|
|
+ wx_content.id,
|
|
|
+ wx_content.wc_title,
|
|
|
+ wx_content.wc_content,
|
|
|
+ wx_content.wc_type,
|
|
|
+ wx_content.wc_showtime,
|
|
|
+ wx_content_type.wct_step
|
|
|
+ FROM
|
|
|
+ wx_content
|
|
|
+ LEFT JOIN wx_content_type ON wx_content.wc_type = wx_content_type.wct_code
|
|
|
+ where
|
|
|
+ wx_content.id = #{id,jdbcType=VARCHAR}
|
|
|
+ order by id desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="queryWXContents" resultType="com.ygj.yuemum.domain.wxmini.WXContent" parameterType="com.ygj.yuemum.domain.wxmini.WXContent">
|
|
|
+ SELECT
|
|
|
+ wx_content.id,
|
|
|
+ wc_title,
|
|
|
+ wc_content,
|
|
|
+ wc_type,
|
|
|
+ wct_name,
|
|
|
+ wc_showtime,
|
|
|
+ wct_frequency,
|
|
|
+ wc_create_user,
|
|
|
+ fgetuser_name (wc_create_user) wc_create_user_name,
|
|
|
+ wc_create_date
|
|
|
+ FROM
|
|
|
+ wx_content
|
|
|
+ LEFT JOIN wx_content_type ON wx_content.wc_type = wx_content_type.wct_code
|
|
|
+ where 1=1
|
|
|
+ <if test="wc_title != null and wc_title != ''">
|
|
|
+ and wc_title like "%"#{wc_title,jdbcType=VARCHAR}"%"
|
|
|
+ </if>
|
|
|
+ <if test="wc_content != null and wc_content != ''">
|
|
|
+ and wc_content like "%"#{wc_content,jdbcType=VARCHAR}"%"
|
|
|
+ </if>
|
|
|
+ <if test="wc_type != null and wc_type != ''">
|
|
|
+ and wc_type = #{wc_type,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="wc_showtime != null and wc_showtime != ''">
|
|
|
+ and wc_showtime = #{wc_showtime,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ order by id desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertWXContent" parameterType="com.ygj.yuemum.domain.wxmini.WXContent" >
|
|
|
+ insert into wx_content
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides="," >
|
|
|
+ <if test="wc_title != null" >
|
|
|
+ wc_title,
|
|
|
+ </if>
|
|
|
+ <if test="wc_content != null" >
|
|
|
+ wc_content,
|
|
|
+ </if>
|
|
|
+ <if test="wc_type != null" >
|
|
|
+ wc_type,
|
|
|
+ </if>
|
|
|
+ <if test="wc_showtime != null" >
|
|
|
+ wc_showtime,
|
|
|
+ </if>
|
|
|
+ <if test="wc_create_user != null" >
|
|
|
+ wc_create_user,
|
|
|
+ </if>
|
|
|
+ <if test="wc_create_date != null" >
|
|
|
+ wc_create_date
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides="," >
|
|
|
+ <if test="wc_title != null" >
|
|
|
+ #{wc_title,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="wc_content != null" >
|
|
|
+ #{wc_content,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="wc_type != null" >
|
|
|
+ #{wc_type,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="wc_showtime != null" >
|
|
|
+ #{wc_showtime,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="wc_create_user != null" >
|
|
|
+ #{wc_create_user,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="wc_create_date != null" >
|
|
|
+ #{wc_create_date,jdbcType=DATE}
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <delete id="deleteWXContent" parameterType="java.lang.Integer" >
|
|
|
+ delete from wx_content
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <update id="updateWXContent" parameterType="com.ygj.yuemum.domain.wxmini.WXContent" >
|
|
|
+ update wx_content
|
|
|
+ <set >
|
|
|
+ <if test="wc_title != null" >
|
|
|
+ wc_title = #{wc_title,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="wc_content != null" >
|
|
|
+ wc_content = #{wc_content,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="wc_type != null" >
|
|
|
+ wc_type = #{wc_type,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="wc_showtime != null" >
|
|
|
+ wc_showtime = #{wc_showtime,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="wc_create_user != null" >
|
|
|
+ wc_create_user = #{wc_create_user,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="wc_create_date != null" >
|
|
|
+ wc_create_date = #{wc_create_date,jdbcType=DATE}
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
+ </update>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+</mapper>
|