<?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.unis.base.server.dao.DjgjcDao" >
  <resultMap id="BaseResultMap" type="com.unis.base.server.entity.DjgjcDO" >
    <id column="JCDID" property="jcdid" jdbcType="VARCHAR" />
    <result column="JCDBM" property="jcdbm" jdbcType="VARCHAR" />
    <result column="JCDSSQY" property="jcdssqy" jdbcType="VARCHAR" />
    <result column="JCDSSQYBM" property="jcdssqybm" jdbcType="VARCHAR" />
    <result column="JCDJD" property="jcdjd" jdbcType="VARCHAR" />
    <result column="JGJCPZ" property="jgjcpz" jdbcType="VARCHAR" />
    <result column="JGJCPZBH" property="jgjcpzbh" jdbcType="VARCHAR" />
    <result column="JGJCDLX" property="jgjcdlx" jdbcType="VARCHAR" />
    <result column="JCDWD" property="jcdwd" jdbcType="VARCHAR" />
    <result column="CREATOR" property="creator" jdbcType="VARCHAR" />
    <result column="CREATOR_CODE" property="creatorCode" jdbcType="VARCHAR" />
    <result column="CREATE_DATE" property="createDate" jdbcType="TIMESTAMP" />
    <result column="REFRESHER" property="refresher" jdbcType="VARCHAR" />
    <result column="REFRESHER_CODE" property="refresherCode" jdbcType="VARCHAR" />
    <result column="REFRESH_TIME" property="refreshTime" jdbcType="TIMESTAMP" />
    <result column="REMARK" property="remark" jdbcType="VARCHAR" />
    <result column="STATUS" property="status" jdbcType="DECIMAL" />
  </resultMap>
  
  <sql id="Base_Column_List" >
    JCDID, JCDBM, JCDSSQY, JCDSSQYBM, JCDJD, JGJCPZ, JGJCPZBH, JGJCDLX, JCDWD, CREATOR, 
    CREATOR_CODE, CREATE_DATE, REFRESHER, REFRESHER_CODE, REFRESH_TIME, REMARK,
    STATUS
  </sql>

  <select id="getMoneyMonitorDetail" parameterType="String" resultMap="BaseResultMap">
    SELECT <include refid="Base_Column_List"/>
    FROM D_JGJC
    WHERE jcdid = #{jcdid}
  </select>

<!--  价格监测-分页查询-->
  <select id="getMoneyMonitorList" resultMap="BaseResultMap">
    SELECT <include refid="Base_Column_List"/>
    FROM D_JGJC
  </select>

<!--  价格监测-删除-->
  <update id="deleteMoneyMonitor" parameterType="String">
    UPDATE D_JGJC
    SET status = 0
    WHERE jcdid = #{jcdid}
  </update>

  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
    delete from D_JGJC
    where JCDID = #{jcdid,jdbcType=VARCHAR}
  </delete>

<!--  价格监测-新增-->
  <insert id="insertMoneyMonitor" parameterType="com.unis.base.server.entity.DjgjcDO" >
    insert into D_JGJC
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="jcdid != null" >
        JCDID,
      </if>
      <if test="jcdbm != null" >
        JCDBM,
      </if>
      <if test="jcdssqy != null" >
        JCDSSQY,
      </if>
      <if test="jcdssqybm != null" >
        JCDSSQYBM,
      </if>
      <if test="jcdjd != null" >
        JCDJD,
      </if>
      <if test="jgjcpz != null" >
        JGJCPZ,
      </if>
      <if test="jgjcpzbh != null" >
        JGJCPZBH,
      </if>
      <if test="jgjcdlx != null" >
        JGJCDLX,
      </if>
      <if test="jcdwd != null" >
        JCDWD,
      </if>
      <if test="creator != null" >
        CREATOR,
      </if>
      <if test="creatorCode != null" >
        CREATOR_CODE,
      </if>
      <if test="createDate != null" >
        CREATE_DATE,
      </if>
      <if test="refresher != null" >
        REFRESHER,
      </if>
      <if test="refresherCode != null" >
        REFRESHER_CODE,
      </if>
      <if test="refreshTime != null" >
        REFRESH_TIME,
      </if>
      <if test="remark != null" >
        REMARK,
      </if>
      <if test="status != null" >
        STATUS,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="jcdid != null" >
        #{jcdid,jdbcType=VARCHAR},
      </if>
      <if test="jcdbm != null" >
        #{jcdbm,jdbcType=VARCHAR},
      </if>
      <if test="jcdssqy != null" >
        #{jcdssqy,jdbcType=VARCHAR},
      </if>
      <if test="jcdssqybm != null" >
        #{jcdssqybm,jdbcType=VARCHAR},
      </if>
      <if test="jcdjd != null" >
        #{jcdjd,jdbcType=VARCHAR},
      </if>
      <if test="jgjcpz != null" >
        #{jgjcpz,jdbcType=VARCHAR},
      </if>
      <if test="jgjcpzbh != null" >
        #{jgjcpzbh,jdbcType=VARCHAR},
      </if>
      <if test="jgjcdlx != null" >
        #{jgjcdlx,jdbcType=VARCHAR},
      </if>
      <if test="jcdwd != null" >
        #{jcdwd,jdbcType=VARCHAR},
      </if>
      <if test="creator != null" >
        #{creator,jdbcType=VARCHAR},
      </if>
      <if test="creatorCode != null" >
        #{creatorCode,jdbcType=VARCHAR},
      </if>
      <if test="createDate != null" >
        #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="refresher != null" >
        #{refresher,jdbcType=VARCHAR},
      </if>
      <if test="refresherCode != null" >
        #{refresherCode,jdbcType=VARCHAR},
      </if>
      <if test="refreshTime != null" >
        #{refreshTime,jdbcType=TIMESTAMP},
      </if>
      <if test="remark != null" >
        #{remark,jdbcType=VARCHAR},
      </if>
      <if test="status != null" >
        #{status,jdbcType=DECIMAL},
      </if>
    </trim>
  </insert>
  
  <update id="updateMoneyMonitor" parameterType="com.unis.base.common.vo.MoneyMonitorVO" >
    update D_JGJC
    <set >
      <if test="jcdbm != null" >
        JCDBM = #{jcdbm,jdbcType=VARCHAR},
      </if>
      <if test="jcdssqy != null" >
        JCDSSQY = #{jcdssqy,jdbcType=VARCHAR},
      </if>
      <if test="jcdssqybm != null" >
        JCDSSQYBM = #{jcdssqybm,jdbcType=VARCHAR},
      </if>
      <if test="jcdjd != null" >
        JCDJD = #{jcdjd,jdbcType=VARCHAR},
      </if>
      <if test="jgjcpz != null" >
        JGJCPZ = #{jgjcpz,jdbcType=VARCHAR},
      </if>
      <if test="jgjcpzbh != null" >
        JGJCPZBH = #{jgjcpzbh,jdbcType=VARCHAR},
      </if>
      <if test="jgjcdlx != null" >
        JGJCDLX = #{jgjcdlx,jdbcType=VARCHAR},
      </if>
      <if test="jcdwd != null" >
        JCDWD = #{jcdwd,jdbcType=VARCHAR},
      </if>
      <if test="creator != null" >
        CREATOR = #{creator,jdbcType=VARCHAR},
      </if>
      <if test="creatorCode != null" >
        CREATOR_CODE = #{creatorCode,jdbcType=VARCHAR},
      </if>
      <if test="createDate != null" >
        CREATE_DATE = #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="refresher != null" >
        REFRESHER = #{refresher,jdbcType=VARCHAR},
      </if>
      <if test="refresherCode != null" >
        REFRESHER_CODE = #{refresherCode,jdbcType=VARCHAR},
      </if>
      <if test="refreshTime != null" >
        REFRESH_TIME = #{refreshTime,jdbcType=TIMESTAMP},
      </if>
      <if test="remark != null" >
        REMARK = #{remark,jdbcType=VARCHAR},
      </if>
      <if test="status != null" >
        STATUS = #{status,jdbcType=DECIMAL},
      </if>
    </set>
    WHERE jcdid = #{jcdid}
  </update>
  
</mapper>