CompanyMapper.xml
1.27 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.polysoft.template.dao.CompanyMapper" >
<select id="listByCondition" resultType="cn.com.polysoft.template.vo.CompanyVO" parameterType="cn.com.polysoft.template.dto.CompanyDTO">
select id,company_name as companyName, company_code as companyCode,valid_status as validStatus from t_company
<where>
<if test="companyName!=null and companyName!=''">and company_name like #{companyName}</if>
<if test="companyCode!=null and companyCode!=''">and company_code like #{companyCode}</if>
<if test="type!=null and type!=''">and type = #{type}</if>
</where>
order by id
</select>
<select id="listByCompanyEnName" resultType="cn.com.polysoft.template.entity.CompanyEntity">
select * from t_company t where t.company_en_name like #{companyEnName} and t.type = #{type}
</select>
<select id="selectByTreatyId" resultType="cn.com.polysoft.template.entity.CompanyEntity">
select t.* from t_company t join inwardtreatyinfo i on i.inreinscode = t.company_code
where t.type = #{type} and i.treatyid = #{treatyId}
</select>
</mapper>