<?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.superdesk.uniorder.dao.mapper.invoice.common.InvoiceTypeMapperEx">

	<select id="findAll" resultMap="cn.superdesk.uniorder.dao.mapper.invoice.common.InvoiceTypeMapper.BaseResultMap">
		select
			<include refid="cn.superdesk.uniorder.dao.mapper.invoice.common.InvoiceTypeMapper.Base_Column_List"/>
		from
			invoice_type
	</select>

	<!-- Base_Column_List BaseResultMap -->
	<!-- Blob_Column_List ResultMapWithBLOBs -->

	<select id="selectQuery" resultMap="cn.superdesk.uniorder.dao.mapper.invoice.common.InvoiceTypeMapper.ResultMapWithBLOBs">
		select
		<include refid="cn.superdesk.uniorder.dao.mapper.invoice.common.InvoiceTypeMapper.Base_Column_List"/>
		,
		<include refid="cn.superdesk.uniorder.dao.mapper.invoice.common.InvoiceTypeMapper.Blob_Column_List"/>
		from
			invoice_type
		<where>
			and 1=1
		<choose>
			<when test="enabled != null">
				and ${queryCriteriaModule}_enable = #{enabled,jdbcType=TINYINT}
			</when>
			<otherwise>

			</otherwise>
		</choose>
		<choose>
			<when test="isDefault != null">
				and ${queryCriteriaModule}_is_default = #{isDefault,jdbcType=TINYINT}
			</when>
			<otherwise>

			</otherwise>
		</choose>
		<choose>
			<when test="orderByClause != null and orderByClause != '' ">
				order by ${orderByClause}
			</when>
			<otherwise>
				order by id asc
			</otherwise>
		</choose>
		</where>
	</select>

</mapper>
