|
|
|
@@ -6,6 +6,9 @@ |
|
|
|
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> |
|
|
|
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/> |
|
|
|
<result column="c_user_id" jdbcType="BIGINT" property="cUserId" /> |
|
|
|
|
|
|
|
<result column="phone" jdbcType="VARCHAR" property="userPhone" /> |
|
|
|
|
|
|
|
<result column="car_number" jdbcType="VARCHAR" property="carNumber" /> |
|
|
|
<result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> |
|
|
|
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> |
|
|
|
@@ -15,80 +18,72 @@ |
|
|
|
</resultMap> |
|
|
|
|
|
|
|
<sql id="allColumns"> |
|
|
|
`id`,`tenant_id`,`parent_tenant_id`,`c_user_id`,`car_number`,`create_date`,`update_date`,`vendor_type`,`vendor_params`,`vendor_person_id` |
|
|
|
wcuc.`id`,wcuc.`tenant_id`,wcuc.`parent_tenant_id`,wcuc.`c_user_id`,wcuc.`car_number`,wcuc.`create_date`,wcuc.`update_date`,wcuc.`vendor_type`,wcuc.`vendor_params`,wcuc.`vendor_person_id`,wcubi.`phone` |
|
|
|
</sql> |
|
|
|
|
|
|
|
<sql id="dynamicWhereConditions"> |
|
|
|
where 1 = 1 |
|
|
|
|
|
|
|
where 1 = 1 |
|
|
|
<if test=" null != id "> |
|
|
|
and `id` = #{id} |
|
|
|
|
|
|
|
and wcuc.`id` = #{id} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != tenantId and '' != tenantId"> |
|
|
|
and `tenant_id` = #{tenantId} |
|
|
|
and wcuc.`tenant_id` = #{tenantId} |
|
|
|
</if> |
|
|
|
<if test=" null != parentTenantId and '' != parentTenantId"> |
|
|
|
and `parent_tenant_id` = #{parentTenantId} |
|
|
|
and wcuc.`parent_tenant_id` = #{parentTenantId} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != cUserId "> |
|
|
|
and `c_user_id` = #{cUserId} |
|
|
|
|
|
|
|
and wcuc.`c_user_id` = #{cUserId} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != carNumber "> |
|
|
|
and `car_number` = #{carNumber} |
|
|
|
and wcuc.`car_number` = #{carNumber} |
|
|
|
</if> |
|
|
|
<!-- <if test=" null != carNumber "> |
|
|
|
and `car_number` like concat('%', #{carNumber},'%') |
|
|
|
|
|
|
|
and `car_number` like concat('%', #{carNumber},'%') |
|
|
|
</if> --> |
|
|
|
|
|
|
|
<if test=" null != createDate "> |
|
|
|
and `create_date` = #{createDate} |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != updateDate "> |
|
|
|
and `update_date` = #{updateDate} |
|
|
|
|
|
|
|
</if> |
|
|
|
and wcuc.`create_date` = #{createDate} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != vendorType "> |
|
|
|
and `vendor_type` = #{vendorType} |
|
|
|
|
|
|
|
and wcuc.`vendor_type` = #{vendorType} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != vendorParams "> |
|
|
|
and `vendor_params` like concat('%', #{vendorParams},'%') |
|
|
|
|
|
|
|
</if> |
|
|
|
<!--<if test=" null != vendorParams "> |
|
|
|
and `vendor_params` like concat('%', #{vendorParams},'%') |
|
|
|
</if>--> |
|
|
|
|
|
|
|
<if test=" null != vendorPersonId "> |
|
|
|
and `vendor_person_id` = #{vendorPersonId} |
|
|
|
|
|
|
|
and wcuc.`vendor_person_id` = #{vendorPersonId} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != ids "> |
|
|
|
and id in |
|
|
|
and wcuc.id in |
|
|
|
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> |
|
|
|
#{idItem} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
<if test=" null != sortColumns"> order by ${sortColumns} </if> |
|
|
|
<!-- <if test=" null != sortColumns"> order by ${sortColumns} </if>--> |
|
|
|
order by wcuc.create_date |
|
|
|
</sql> |
|
|
|
|
|
|
|
<select id="findList" parameterType="com.iformall.domain.po.WxCUserCar" resultMap="BaseResultMap"> |
|
|
|
select |
|
|
|
<include refid="allColumns"/> |
|
|
|
from wx_c_user_car |
|
|
|
from wx_c_user_car wcuc |
|
|
|
left join wx_c_user_basic_info wcubi on wcubi.id = wcuc.c_user_id |
|
|
|
<include refid="dynamicWhereConditions" /> |
|
|
|
<if test=" null != userPhone"> |
|
|
|
and wcubi.`phone` = like concat('%', #{userPhone},'%') |
|
|
|
</if> |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="countList" parameterType="com.iformall.domain.po.WxCUserCar" resultType="java.lang.Integer"> |
|
|
|
select count(1) from wx_c_user_car |
|
|
|
select count(1) from wx_c_user_car wcuc |
|
|
|
<include refid="dynamicWhereConditions" /> |
|
|
|
</select> |
|
|
|
|
|
|
|
|