<?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.zcxk.rmcp.core.dao.ProductMeasuringDictMapper">

  <resultMap id="BaseResultMap" type="com.zcxk.rmcp.core.entity.ProductMeasuringDict">
    <!--@mbg.generated-->
    <!--@Table sc_product_measuring_dict-->
    <id column="point_id" property="pointId" />
    <id column="data_value" property="dataValue" />
    <result column="data_name" property="dataName" />
    <result column="data_desc" property="dataDesc" />
    <result column="status" property="status" />
    <result column="create_by" property="createBy" />
    <result column="update_by" property="updateBy" />
    <result column="create_date" property="createDate" />
    <result column="update_date" property="updateDate" />
  </resultMap>

  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    point_id, data_value, data_name, data_desc, `status`, create_by, update_by, create_date,
    update_date
  </sql>
  <insert id="insertSelective" parameterType="com.zcxk.rmcp.core.entity.ProductMeasuringDict">
    <!--@mbg.generated-->
    insert into rmcp_product_measuring_dict
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="pointId != null">
        point_id,
      </if>
      <if test="dataValue != null">
        data_value,
      </if>
      <if test="dataName != null">
        data_name,
      </if>
      <if test="dataDesc != null">
        data_desc,
      </if>
      <if test="status != null">
        `status`,
      </if>
      <if test="createBy != null">
        create_by,
      </if>
      <if test="updateBy != null">
        update_by,
      </if>
      <if test="dateCreate != null">
        create_date,
      </if>
      <if test="dateUpdate != null">
        dupdate_date,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="pointId != null">
        #{pointId},
      </if>
      <if test="dataValue != null">
        #{dataValue},
      </if>
      <if test="dataName != null">
        #{dataName},
      </if>
      <if test="dataDesc != null">
        #{dataDesc},
      </if>
      <if test="status != null">
        #{status},
      </if>
      <if test="createBy != null">
        #{createBy},
      </if>
      <if test="updateBy != null">
        #{updateBy},
      </if>
      <if test="createDate != null">
        #{createDate},
      </if>
      <if test="updateDate != null">
        #{updateDate},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.zcxk.rmcp.core.entity.ProductMeasuringDict">
    update rmcp_product_measuring_dict
    <set>
      <if test="dataName != null">
        data_name = #{dataName},
      </if>
      <if test="dataDesc != null">
        data_desc = #{dataDesc},
      </if>
      <if test="status != null">
        `status` = #{status},
      </if>
      <if test="createBy != null">
        create_by = #{createBy},
      </if>
      <if test="updateBy != null">
        update_by = #{updateBy},
      </if>
      <if test="createDate != null">
        create_date = #{createDate},
      </if>
      <if test="updateDate != null">
        update_date = #{updateDate},
      </if>
    </set>
    where point_id = #{pointId}
      and data_value = #{dataValue}
  </update>

    <select id="getList" resultType="com.zcxk.rmcp.api.vo.ProductMeasuringDictVo">
      select <include refid="Base_Column_List" /> from rmcp_product_measuring_dict where status = 1
      and point_id = #{pointId}
    </select>
</mapper>