<?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.bootdo.datas.dao.GyUnitDao">

    <select id="getGyUnit" resultType="java.lang.Integer">
        SELECT
            count(*)
        FROM gy_unit
        <where>
            STATUS = '0' and REPORTER_UNIT = #{reporterUnit} and CREDIT_CODE = #{creditCode}
        </where>
    </select>

    <insert id="save" parameterType="com.bootdo.datas.domain.GyUnitDO" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
        insert into gy_unit
        (
         REPORTER_UNIT,
         CREDIT_CODE,
         UNIT_CHARACTER,
         INDUSTRY_TYPE_ONE,
         INDUSTRY_TYPE_TWO,
         UNIT_PROVINCE,
         UNIT_CITY,
         DATA_SECURITY_MAN,
         DATA_SECURITY_OFFICE,
         DATA_SECURITY_WAY,
         STATUS,
         CREATE_TIME,
         UPDATE_TIME,
         NOTE)
        values (
            #{reporterUnit},
            #{creditCode},
            #{unitCharacter},
            #{industryTypeOne},
            #{industryTypeTwo},
            #{unitProvince},
            #{unitCity},
            #{dataSecurityMan},
            #{dataSecurityOffice},
            #{dataSecurityWay},
            #{status},
            #{createTime},
            #{updateTime},
            #{note}
        )
    </insert>

</mapper>