<?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.mosty.base.manager.mapper.TbJcglPzfzMapper">

    <resultMap type="com.mosty.base.model.entity.jcgl.TbJcglPzfz" id="tbJcglPzfz">
        <result property="id" column="id" jdbcType="VARCHAR"/>
        <result property="pzlx" column="pzlx" jdbcType="VARCHAR"/>
        <result property="pzfz" column="pzfz" jdbcType="INTEGER"/>
        <result property="pzsjfw" column="pzsjfw" jdbcType="INTEGER"/>
        <result property="pzrid" column="pzrid" jdbcType="VARCHAR"/>
        <result property="pzrxm" column="pzrxm" jdbcType="VARCHAR"/>
        <result property="pzrsfzh" column="pzrsfzh" jdbcType="TIMESTAMP"/>
        <result property="xtSjly" column="xt_sjly" jdbcType="VARCHAR"/>
        <result property="xtSjzt" column="xt_sjzt" jdbcType="VARCHAR"/>
        <result property="xtScbz" column="xt_scbz" jdbcType="VARCHAR"/>
        <result property="xtCjip" column="xt_cjip" jdbcType="VARCHAR"/>
        <result property="xtCjsj" column="xt_cjsj" jdbcType="VARCHAR"/>
        <result property="xtCjrId" column="xt_cjr_id" jdbcType="VARCHAR"/>
        <result property="xtCjr" column="xt_cjr" jdbcType="VARCHAR"/>
        <result property="xtCjbmdm" column="xt_cjbmdm" jdbcType="VARCHAR"/>
        <result property="xtCjbmmc" column="xt_cjbmmc" jdbcType="VARCHAR"/>
        <result property="xtZhgxip" column="xt_zhgxip" jdbcType="VARCHAR"/>
        <result property="xtZhgxsj" column="xt_zhgxsj" jdbcType="VARCHAR"/>
        <result property="xtZhgxrid" column="xt_zhgxrid" jdbcType="VARCHAR"/>
        <result property="xtZhgxr" column="xt_zhgxr" jdbcType="VARCHAR"/>
        <result property="xtZhgxbmdm" column="xt_zhgxbmdm" jdbcType="VARCHAR"/>
        <result property="xtZhgxbm" column="xt_zhgxbm" jdbcType="VARCHAR"/>
        <result property="bz" column="bz" jdbcType="VARCHAR"/>
    </resultMap>

    <sql id="base_column_list">
        id, pzlx, pzfz, pzsjfw, pzrid, pzrxm, pzrsfzh, xt_sjly, xt_sjzt, xt_scbz,
        xt_cjip, xt_cjsj, xt_cjr_id, xt_cjr, xt_cjbmdm, xt_cjbmmc, xt_zhgxip, xt_zhgxsj, xt_zhgxrid,
        xt_zhgxr, xt_zhgxbmdm, xt_zhgxbm, bz
    </sql>

    <select id="getList" resultType="java.util.Map">
        select
        <include refid="base_column_list" />
        from tb_jcgl_pzfz where xt_scbz = '0' and xt_sjzt = '1'
        <if test="dto.pzlx != null and dto.pzlx !='' ">
            and pzlx = #{dto.pzlx}
        </if>
        limit #{pageIndex},#{pageSize}
    </select>

    <select id="getListCount" resultType="int">
        select count(1) from tb_jcgl_pzfz where xt_scbz = '0' and xt_sjzt = '1'
        <if test="dto.pzlx != null and dto.pzlx !='' ">
            and pzlx = #{dto.pzlx}
        </if>
    </select>

    <select id="getPageListWtj" resultType="java.util.Map">
        select <include refid="base_column_list" /> from tb_jcgl_pzfz where xt_scbz = '0' and xt_sjzt = '1'
        limit #{pageIndex},#{pageSize}
    </select>

    <delete id="deleteByPzfzId">
        delete from tb_jcgl_pzfz where id = #{id}
    </delete>

    <select id="selectPzlx" resultMap="tbJcglPzfz">
        select * from tb_jcgl_pzfz where pzlx = #{pzlx}
    </select>

</mapper>