QGCodeConfigMapper.xml 1.45 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.entmicro.mapper.QGCodeConfigMapper">
  <resultMap id="BaseResultMap" type="cn.com.glsx.entmicro.model.QGCodeConfig">
    <!--
      WARNING - @mbg.generated
    -->
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="code_state" jdbcType="VARCHAR" property="codeState" />
    <result column="config_id" jdbcType="VARCHAR" property="configId" />
    <result column="qc_code" jdbcType="VARCHAR" property="qcCode" />
    <result column="created_time" jdbcType="TIMESTAMP" property="createdTime" />
    <result column="updated_time" jdbcType="TIMESTAMP" property="updatedTime" />
    <result column="del_flag" jdbcType="TINYINT" property="delFlag" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--
      WARNING - @mbg.generated
    -->
    id, code_state, config_id, qc_code, created_time, del_flag,updated_time
  </sql>
  <update id="delByTimeOutQc">
    UPDATE qg_code_config
    SET updated_time = NOW(), del_flag = -1
    WHERE del_flag = 0 AND created_time <![CDATA[ <= ]]> NOW() - INTERVAL 30 DAY
  </update>
  <select id="findByCodeState" resultMap="BaseResultMap">
    SELECT * FROM qg_code_config WHERE code_state=#{codeState};
  </select>

  <select id="findNeedDelQc" resultMap="BaseResultMap">
    SELECT * FROM qg_code_config WHERE del_flag=-1;
  </select>
</mapper>