IntelligentRemindServiceMaterialMapper.xml 3.34 KB
<?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="cn.com.glsx.dj.weapp.mapper.IntelligentRemindServiceMaterialMapper" >
  <resultMap id="BaseResultMap" type="cn.com.glsx.dj.weapp.model.IntelligentRemindServiceMaterial" >
    <!--
      WARNING - @mbg.generated
    -->
    <id column="id" property="id" jdbcType="INTEGER" />
    <result column="intelligent_remind_service_id" property="intelligentRemindServiceId" jdbcType="INTEGER" />
    <result column="material_belong" property="materialBelong" jdbcType="SMALLINT" />
    <result column="material_type" property="materialType" jdbcType="SMALLINT" />
    <result column="material_content" property="materialContent" jdbcType="VARCHAR" />
    <result column="sort" property="sort" jdbcType="SMALLINT" />
    <result column="created_by" property="createdBy" jdbcType="VARCHAR" />
    <result column="created_date" property="createdDate" jdbcType="TIMESTAMP" />
    <result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
    <result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
    <result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
  </resultMap>

  <sql id="Base_Column_List" >
    <!--
      WARNING - @mbg.generated
    -->
    id, intelligent_remind_service_id, material_belong, material_type, material_content, 
    sort, created_by, created_date, updated_by, updated_date, deleted_flag
  </sql>
  <select id="getById" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from dj_weapp_intelligent_remind_service_material
    where intelligent_remind_service_id = #{serviceId} and deleted_flag = 'N'
  </select>

  <update id="update" parameterType="cn.com.glsx.dj.weapp.model.IntelligentRemindServiceMaterial" >
    <!--
      WARNING - @mbg.generated
    -->
    update dj_weapp_intelligent_remind_service_material
    <set >
      <if test="record.materialBelong != null" >
        material_belong = #{record.materialBelong,jdbcType=SMALLINT},
      </if>
      <if test="record.materialType != null" >
        material_type = #{record.materialType,jdbcType=SMALLINT},
      </if>
      <if test="record.materialContent != null" >
        material_content = #{record.materialContent,jdbcType=VARCHAR},
      </if>
      <if test="record.sort != null" >
        sort = #{record.sort,jdbcType=SMALLINT},
      </if>
      <if test="record.createdBy != null" >
        created_by = #{record.createdBy,jdbcType=VARCHAR},
      </if>
      <if test="record.createdDate != null" >
        created_date = #{record.createdDate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.updatedBy != null" >
        updated_by = #{record.updatedBy,jdbcType=VARCHAR},
      </if>
      <if test="record.updatedDate != null" >
        updated_date = #{record.updatedDate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.deletedFlag != null" >
        deleted_flag = #{record.deletedFlag,jdbcType=CHAR},
      </if>
    </set>
    where intelligent_remind_service_id = #{record.intelligentRemindServiceId,jdbcType=INTEGER}
  </update>

  <update id="deleteById" parameterType="java.lang.Integer">
    update dj_weapp_intelligent_remind_service_material
    set
    deleted_flag = 'D'
    where id = #{id}
  </update>
</mapper>