<?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.victorysoft.business.sys.dao.SysDictDao">
  <resultMap id="BaseResultMap" type="SysFlag">
    <id column="CATEGORY_CODE" jdbcType="VARCHAR" property="categoryCode" />
    <id column="FLAG_CODE" jdbcType="VARCHAR" property="flagCode" />
    <result column="FLAG_NAME" jdbcType="VARCHAR" property="flagName" />
    <result column="FLAG_VALUE" jdbcType="VARCHAR" property="flagValue" />
    <result column="FLAG_ORDER" jdbcType="NUMERIC" property="flagOrder" />
    <result column="FLAG_TEXT1" jdbcType="VARCHAR" property="flagText1" />
  </resultMap>

  <sql id="Base_Column_List">
    CATEGORY_CODE, FLAG_CODE, FLAG_NAME, FLAG_VALUE, FLAG_ORDER, FLAG_TEXT1
  </sql>

  <select id="selectByCategory" parameterType="String" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from V_SYS_FLAG
    where CATEGORY_CODE = #{categoryCode,jdbcType=VARCHAR}
    order by FLAG_ORDER
  </select>

  <select id="selectByPrimaryKey" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from V_SYS_FLAG
    where CATEGORY_CODE = #{categoryCode,jdbcType=VARCHAR}
    and FLAG_CODE = #{flagCode,jdbcType=VARCHAR}
    order by FLAG_ORDER
  </select>

  <select id="selectWellType" resultType="WellType">
    select DM, MC, PX
    from YS_FLA3
    order by PX
  </select>

  <select id="selectRodDevicePump" resultType="RodDevicePump">
    select DEVICE_ID, DEVICE_NAME, PUMP_TYPE, DP, F, DV, DE, "K", L, CLASSIFY
    from ROD_DEVICE_PUMP
  </select>

  <select id="selectRodDeviceRod" resultType="RodDeviceRod">
    select DEVICE_ID, DEVICE_NAME, ROD_TYPE, DIA_OUT, DIA_IN, TENSION, CLASSIFY
    from ROD_DEVICE_ROD
  </select>

  <select id="selectRodDeviceSucker" resultType="RodDeviceSucker">
    select DEVICE_ID, DEVICE_NAME, L_FRONT, L_BACK, H_VERTICAL, H_HORIZONAL, L_MIDDLE, WEIGHT_RATIO,
    SLIST, CRANK_RADIUS, FORCEMAX, TORQUEMAX, RATING, SUCKER_TYPE
    from ROD_DEVICE_SUCKER
  </select>

  <select id="selectRodDeviceTube" resultType="RodDeviceTube">
    select DEVICE_ID, DEVICE_NAME, TUBE_TYPE, DIA_OUT, DIA_IN, TENSION, CLASSIFY
    from ROD_DEVICE_TUBE
  </select>
</mapper>
