You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
2.3 KiB
XML

<?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.glxp.mipsdl.admin.dao.thrsys.ThrInvWarehouseDao">
<select id="filterThrInvWarehouse" parameterType="com.glxp.mipsdl.admin.req.thrsys.FilterThrInvWarehouseRequest"
resultType="com.glxp.mipsdl.admin.entity.thrsys.ThrInvWarehouseEntity">
SELECT *
FROM thr_inv_warehouse thrInv
left join basic_third_sys thrSys on thrInv.thirdSysFk = thrSys.thirdId
<where>
thrSys.enabled = true
<if test="id != '' and id != null">
AND id = #{id}
</if>
<if test="pid != '' and pid != null">
AND pid = #{pid}
</if>
<if test="code != '' and code != null">
AND code = #{code}
</if>
<if test="name != '' and name != null">
AND name = #{name}
</if>
<if test="advanceType != null">
AND advanceType = #{advanceType}
</if>
<if test="isDefault != null">
AND isDefault = #{isDefault}
</if>
<if test="key != null">
and (code like concat('%', #{key}, '%')
or `name` like concat('%', #{key}, '%'))
</if>
<if test="lastUpdateTime != null and lastUpdateTime != ''">
<![CDATA[
and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S') >= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
<if test="thirdSysFk != null">
and thirdSysFk = #{thirdSysFk}
</if>
</where>
</select>
<select id="selectByCode" resultType="com.glxp.mipsdl.admin.entity.thrsys.ThrInvWarehouseEntity">
select * from thr_inv_warehouse thrInv
left join basic_third_sys thrSys on thrInv.thirdSysFk = thrSys.thirdId
<where>
<if test="code != '' and code != null">
AND code = #{code}
</if>
<if test="thirdSysFk != '' and thirdSysFk != null">
AND thirdSysFk = #{thirdSysFk}
</if>
</where>
limit 1
</select>
</mapper>