<?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.cool.store.mapper.MatterConfigMapper">
  <resultMap id="BaseResultMap" type="com.cool.store.entity.MatterConfigDO">
    <!--
      WARNING - @mbg.generated
    -->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="module_code" jdbcType="TINYINT" property="moduleCode" />
    <result column="matter_type" jdbcType="TINYINT" property="matterType" />
    <result column="system_source" jdbcType="VARCHAR" property="systemSource" />
    <result column="jump_type" jdbcType="BIT" property="jumpType" />
    <result column="jump_url" jdbcType="VARCHAR" property="jumpUrl" />
    <result column="status" jdbcType="BIT" property="status" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="create_user_id" jdbcType="VARCHAR" property="createUserId" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="update_user_id" jdbcType="VARCHAR" property="updateUserId" />
    <result column="deleted" jdbcType="BIT" property="deleted" />
    <result column="default_handle_person_info" jdbcType="LONGVARCHAR" property="defaultHandlePersonInfo" />
    <result column="default_store_info" jdbcType="LONGVARCHAR" property="defaultStoreInfo" />
  </resultMap>

  <update id="updateForce" parameterType="com.cool.store.entity.MatterConfigDO">
    UPDATE zxjp_matter_config
    SET
    module_code = #{matterConfigDO.moduleCode,jdbcType=TINYINT},
    matter_type = #{matterConfigDO.matterType,jdbcType=TINYINT},
    system_source = #{matterConfigDO.systemSource,jdbcType=VARCHAR},
    jump_type = #{matterConfigDO.jumpType,jdbcType=BIT},
    jump_url = #{matterConfigDO.jumpUrl,jdbcType=VARCHAR},
    status = #{matterConfigDO.status,jdbcType=BIT},
    remark = #{matterConfigDO.remark,jdbcType=VARCHAR},
    update_time = now(),
    update_user_id = #{matterConfigDO.updateUserId,jdbcType=VARCHAR},
    default_handle_person_info = #{matterConfigDO.defaultHandlePersonInfo,jdbcType=LONGVARCHAR},
    default_store_info = #{matterConfigDO.defaultStoreInfo,jdbcType=LONGVARCHAR}
    WHERE id = #{matterConfigDO.id,jdbcType=BIGINT}
  </update>


  <update id="updateDeleteStatus" parameterType="map">
  UPDATE zxjp_matter_config
  SET
    deleted = 1,
    update_time = now(),
    update_user_id = #{userId,jdbcType=VARCHAR}
  WHERE id IN
  <foreach collection="ids" item="id" open="(" separator="," close=")">
    #{id,jdbcType=BIGINT}
  </foreach>
</update>


  <select id="ListByCondition" resultMap="BaseResultMap">
  SELECT
    *
  FROM zxjp_matter_config
  WHERE deleted = 0
  <if test="request.moduleCode != null">
    AND module_code = #{request.moduleCode,jdbcType=TINYINT}
  </if>
  <if test="request.matterType != null">
    AND matter_type = #{request.matterType,jdbcType=TINYINT}
  </if>
  <if test="request.systemSource != null and request.systemSource != ''">
    AND system_source = #{request.systemSource,jdbcType=VARCHAR}
  </if>
  <if test="request.status != null">
    AND status = #{request.status,jdbcType=BIT}
  </if>
  ORDER BY create_time DESC
</select>



</mapper>