Commit 4e787dd1 by 徐高华

群发

parent f8c642ce
<?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.gic.haoban.manage.service.dao.mapper.TabMaterialContentMapper">
<resultMap type="com.gic.haoban.manage.service.entity.TabMaterialContent" id="result-map-tabHaobanMaterialContent">
<result column="material_id" property="materialId"/>
<result column="material_type" property="materialType"/>
<result column="wx_last_upload_time" property="wxLastUploadTime"/>
<result column="media_id" property="mediaId"/>
<result column="wx_enterprise_id" property="wxEnterpriseId"/>
<result column="img_url" property="imgUrl"/>
<result column="url_md5" property="urlMd5"/>
<result column="status_flag" property="statusFlag"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="media_type" property="mediaType" />
</resultMap>
<sql id="Base_Column_List">
material_id,
material_type,
wx_last_upload_time,
media_id,
wx_enterprise_id,
img_url,
url_md5,
status_flag,
create_time,
update_time , media_type
</sql>
<!-- ===================== 新增 ======================== -->
<insert id="insert" parameterType="com.gic.haoban.manage.service.entity.TabMaterialContent" useGeneratedKeys="true" keyProperty="id">
<![CDATA[
INSERT INTO tab_haoban_material_content(
material_id,
material_type,
wx_last_upload_time,
media_id,
wx_enterprise_id,
img_url,
url_md5,
status_flag,
create_time,
update_time ,
media_type
)VALUES(
#{materialId,jdbcType=VARCHAR},
#{materialType,jdbcType=INTEGER},
#{wxLastUploadTime,jdbcType=TIMESTAMP},
#{mediaId,jdbcType=VARCHAR},
#{wxEnterpriseId,jdbcType=VARCHAR},
#{imgUrl,jdbcType=VARCHAR},
#{urlMd5,jdbcType=VARCHAR},
1,
now(),
now() , #{mediaType}
)
]]>
</insert>
<!-- ==================更新 ========== -->
<update id="updateByPrimaryKey" parameterType="com.gic.haoban.manage.service.entity.TabMaterialContent">
<![CDATA[
UPDATE tab_haoban_material_content SET
wx_last_upload_time=#{wxLastUploadTime,jdbcType=TIMESTAMP},
media_id=#{mediaId,jdbcType=VARCHAR},
wx_enterprise_id=#{wxEnterpriseId,jdbcType=VARCHAR},
status_flag=#{statusFlag,jdbcType=INTEGER},
update_time= now()
where material_id = #{materialId}
]]>
</update>
<!-- ============ 查询=============-->
<select id="selectById" parameterType="String" resultMap="result-map-tabHaobanMaterialContent">
SELECT
<include refid="Base_Column_List"/>
FROM tab_haoban_material_content WHERE material_id=#{id} and status_flag = 1
</select>
<select id="selectByUrl" resultMap="result-map-tabHaobanMaterialContent">
SELECT
<include refid="Base_Column_List"/>
FROM tab_haoban_material_content WHERE wx_enterprise_id=#{wxEnterpriseId} and url_md5=#{urlMd5} and status_flag = 1
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment