| | |
| | | <select id="listAll" resultType="com.dsh.guns.modular.system.model.TStoreListVo"> |
| | | select t1.*, |
| | | coalesce(t2.name, t4.name) as userName, |
| | | coalesce(nullif(t2.phone, ''), nullif(t4.phone, ''), nullif(t1.phone, ''), '') as phone, |
| | | coalesce(nullif(t2.phone, ''), nullif(t4.phone, ''), nullif(t1.phone, ''), '') as userPhone, |
| | | coalesce(t1.phone, '') as phone, |
| | | t3.name as yysName |
| | | from t_store t1 |
| | | left join sys_user t2 on t1.storeStaffId = t2.id |
| | |
| | | and coalesce(t2.name, t4.name) like concat("%",#{name},"%") |
| | | </if> |
| | | <if test="phone !=null and phone !=''"> |
| | | and coalesce(nullif(t2.phone, ''), nullif(t4.phone, ''), nullif(t1.phone, '')) like concat("%",#{phone},"%") |
| | | and t1.phone like concat("%",#{phone},"%") |
| | | </if> |
| | | <if test="shopName !=null and shopName !=''"> |
| | | and t1.name like concat("%",#{shopName},"%") |
| | |
| | | <select id="listAllStore" resultType="com.dsh.guns.modular.system.model.TStoreListVo"> |
| | | select t1.*, |
| | | coalesce(t2.name, t4.name) as userName, |
| | | coalesce(nullif(t2.phone, ''), nullif(t4.phone, ''), nullif(t1.phone, ''), '') as phone, |
| | | coalesce(nullif(t2.phone, ''), nullif(t4.phone, ''), nullif(t1.phone, ''), '') as userPhone, |
| | | coalesce(t1.phone, '') as phone, |
| | | t3.name as yysName |
| | | from t_store t1 |
| | | left join sys_user t2 on t1.storeStaffId = t2.id |
| | |
| | | and coalesce(t2.name, t4.name) like concat("%",#{name},"%") |
| | | </if> |
| | | <if test="phone !=null and phone !=''"> |
| | | and coalesce(nullif(t2.phone, ''), nullif(t4.phone, ''), nullif(t1.phone, '')) like concat("%",#{phone},"%") |
| | | and t1.phone like concat("%",#{phone},"%") |
| | | </if> |
| | | <if test="shopName !=null and shopName !=''"> |
| | | and t1.name like concat("%",#{shopName},"%") |
| | |
| | | <select id="listAllStoresByIds" resultType="com.dsh.guns.modular.system.model.TStoreListVo"> |
| | | select t1.*, |
| | | coalesce(t2.name, t4.name) as userName, |
| | | coalesce(nullif(t2.phone, ''), nullif(t4.phone, ''), nullif(t1.phone, ''), '') as phone, |
| | | coalesce(nullif(t2.phone, ''), nullif(t4.phone, ''), nullif(t1.phone, ''), '') as userPhone, |
| | | coalesce(t1.phone, '') as phone, |
| | | t3.name as yysName |
| | | from t_store t1 |
| | | left join sys_user t2 on t1.storeStaffId = t2.id |
| | |
| | | and coalesce(t2.name, t4.name) like concat("%",#{name},"%") |
| | | </if> |
| | | <if test="phone !=null and phone !=''"> |
| | | and coalesce(nullif(t2.phone, ''), nullif(t4.phone, ''), nullif(t1.phone, '')) like concat("%",#{phone},"%") |
| | | and t1.phone like concat("%",#{phone},"%") |
| | | </if> |
| | | <if test="shopName !=null and shopName !=''"> |
| | | and t1.name like concat("%",#{shopName},"%") |